Menu: Proper entity shutdown bobs

This commit is contained in:
Marco Cawthorne 2019-01-19 01:37:31 +01:00
parent 61fcdfcf07
commit 0783533932

View file

@ -6,6 +6,8 @@
*
****/
var int g_initialized = FALSE;
void m_init(void)
{
vector g_btnsize;
@ -17,7 +19,7 @@ void m_init(void)
font_label_p = loadfont( "label_p", "gfx/shell/arialbd.ttf", "16", -1 );
localcmd("plug_load ffmpeg\n");
/* TODO: Shove these into defaults.cfg instead of forcing them */
localcmd("con_textsize -12\n");
localcmd("scr_conalpha 1\n");
@ -36,22 +38,21 @@ void m_init(void)
Colors_Init();
games_init();
main_init();
g_initialized = TRUE;
}
void m_shutdown(void)
{
g_initialized = FALSE;
/*int i = 0;
for (i = 0; i < g_bmp.length; i++) {
freepic(g_bmp[i]);
}
entity e;
i = 1;
while ((e = edict_num(i)) != __NULL__) {
remove(e);
i++;
}*/
entity e;
while((e=nextent(__NULL__)))
remove(e);
memfree(g_sprays);
memfree(g_models);
memfree(g_maps);
@ -66,6 +67,10 @@ void m_draw(vector screensize)
if (!g_active) {
return;
}
if (g_initialized == FALSE) {
return;
}
if ((screensize[0] != g_vidsize[0]) || (screensize[1] != g_vidsize[1])) {
g_vidsize[0] = screensize[0];