const char * type_get_encoding (const type_t *type) { static dstring_t *encoding; if (!encoding) encoding = dstring_newstr(); else dstring_clearstr (encoding); encode_type (encoding, type); return save_string (encoding->str); }
void CL_ClearState (void) { int i; S_StopAllSounds (); // wipe the entire cl structure if (cl.serverinfo) Info_Destroy (cl.serverinfo); memset (&cl, 0, sizeof (cl)); r_data->force_fullscreen = 0; cl.maxclients = MAX_CLIENTS; // Note: we should probably hack around this and give diff values for // diff gamedirs cl.fpd = FPD_DEFAULT; cl.fbskins = FBSKINS_DEFAULT; for (i = 0; i < UPDATE_BACKUP; i++) cl.frames[i].packet_entities.entities = qw_entstates.frame[i]; cl.serverinfo = Info_ParseString ("", MAX_INFO_STRING, 0); CL_Init_Entity (&cl.viewent); Sys_MaskPrintf (SYS_DEV, "Clearing memory\n"); if (viddef.flush_caches) viddef.flush_caches (); Mod_ClearAll (); if (host_hunklevel) // FIXME: check this... Hunk_FreeToLowMark (host_hunklevel); CL_ClearEnts (); CL_ClearTEnts (); r_funcs->R_ClearState (); SZ_Clear (&cls.netchan.message); if (centerprint) dstring_clearstr (centerprint); }