cl.model_bolt2 = Mod_ForName("progs/bolt2.mdl", false, false, NULL);
cl.model_bolt3 = Mod_ForName("progs/bolt3.mdl", false, false, NULL);
cl.model_beam = Mod_ForName("progs/beam.mdl", false, false, NULL);
- Mod_PurgeUnused();
+
+ // we purge the models and sounds later in CL_SignonReply
+ //Mod_PurgeUnused();
// now we try to load everything that is new
cls.qw_downloadtype = dl_none;
- // load new sounds and unload old ones
- // FIXME: S_ServerSounds does not know about cl.sfx_ sounds
- S_ServerSounds(cl.sound_name, cls.qw_downloadnumber);
+ // clear sound usage flags for purging of unused sounds
+ S_ClearUsed();
// precache any sounds used by the client
cl.sfx_wizhit = S_PrecacheSound(cl_sound_wizardhit.string, false, true);
cl.sfx_ric3 = S_PrecacheSound(cl_sound_ric3.string, false, true);
cl.sfx_r_exp3 = S_PrecacheSound(cl_sound_r_exp3.string, false, true);
- // sounds
+ // sounds used by the game
for (i = 1;i < MAX_SOUNDS && cl.sound_name[i][0];i++)
- {
- // Don't lock the sfx here, S_ServerSounds already did that
- cl.sound_precache[i] = S_PrecacheSound(cl.sound_name[i], true, false);
- }
+ cl.sound_precache[i] = S_PrecacheSound(cl.sound_name[i], true, true);
+
+ // we purge the models and sounds later in CL_SignonReply
+ //S_PurgeUnused();
// check memory integrity
Mem_CheckSentinelsGlobal();
continue;
}
CL_KeepaliveMessage(true);
- // Don't lock the sfx here, S_ServerSounds already did that
- cl.sound_precache[cl.loadsound_current] = S_PrecacheSound(cl.sound_name[cl.loadsound_current], false, false);
+ cl.sound_precache[cl.loadsound_current] = S_PrecacheSound(cl.sound_name[cl.loadsound_current], false, true);
SCR_PopLoadingScreen(false);
}
SCR_PopLoadingScreen(false);
return;
}
}
- // Don't lock the sfx here, S_ServerSounds already did that
- cl.sound_precache[cl.downloadsound_current] = S_PrecacheSound(cl.sound_name[cl.downloadsound_current], false, false);
+ cl.sound_precache[cl.downloadsound_current] = S_PrecacheSound(cl.sound_name[cl.downloadsound_current], false, true);
}
// finished loading sounds
size_t inflated_size;
out = FS_Inflate(cls.qw_downloadmemory, cls.qw_downloadmemorycursize, &inflated_size, tempmempool);
Mem_Free(cls.qw_downloadmemory);
- Con_Printf("Inflated download: new size: %u (%g%%)\n", (unsigned)inflated_size, 100.0 - 100.0*(cls.qw_downloadmemorycursize / (float)inflated_size));
- cls.qw_downloadmemory = out;
- cls.qw_downloadmemorycursize = inflated_size;
+ if(out)
+ {
+ Con_Printf("Inflated download: new size: %u (%g%%)\n", (unsigned)inflated_size, 100.0 - 100.0*(cls.qw_downloadmemorycursize / (float)inflated_size));
+ cls.qw_downloadmemory = out;
+ cls.qw_downloadmemorycursize = inflated_size;
+ }
+ else
+ {
+ cls.qw_downloadmemory = NULL;
+ cls.qw_downloadmemorycursize = 0;
+ Con_Printf("Cannot inflate download, possibly corrupt or zlib not present\n");
+ }
}
if(!cls.qw_downloadmemory)
case 4:
// after the level has been loaded, we shouldn't need the shaders, and
// if they are needed again they will be automatically loaded...
+ // we also don't need the unused models or sounds from the last level
Mod_FreeQ3Shaders();
+ Mod_PurgeUnused();
+ S_PurgeUnused();
Con_ClearNotify();
if (COM_CheckParm("-profilegameonly"))
cl.model_bolt2 = Mod_ForName("progs/bolt2.mdl", false, false, NULL);
cl.model_bolt3 = Mod_ForName("progs/bolt3.mdl", false, false, NULL);
cl.model_beam = Mod_ForName("progs/beam.mdl", false, false, NULL);
- Mod_PurgeUnused();
- // do the same for sounds
- // FIXME: S_ServerSounds does not know about cl.sfx_ sounds
- S_ServerSounds (cl.sound_name, numsounds);
+ // we purge the models and sounds later in CL_SignonReply
+ //Mod_PurgeUnused();
+ //S_PurgeUnused();
+
+ // clear sound usage flags for purging of unused sounds
+ S_ClearUsed();
// precache any sounds used by the client
cl.sfx_wizhit = S_PrecacheSound(cl_sound_wizardhit.string, false, true);
cl.sfx_ric3 = S_PrecacheSound(cl_sound_ric3.string, false, true);
cl.sfx_r_exp3 = S_PrecacheSound(cl_sound_r_exp3.string, false, true);
+ // sounds used by the game
+ for (i = 1;i < MAX_SOUNDS && cl.sound_name[i][0];i++)
+ cl.sound_precache[i] = S_PrecacheSound(cl.sound_name[i], true, true);
+
// now we try to load everything that is new
cl.loadmodel_current = 1;
cl.downloadmodel_current = 1;
VectorCopy(ent->state_current.angles, ent->persistent.newangles);
ent->persistent.trail_allowed = false;
- if(ent->state_current.frame != ent->state_previous.frame)
+ // if(ent->state_current.frame != ent->state_previous.frame)
+ // do this even if we did change the frame
+ // teleport bit is only used if an animation restart, or a jump, is necessary
+ // so it should be always harmless to do this
{
- // if we ALSO changed animation frame in the process (but ONLY then!)
- // then let's reset the animation interpolation too
ent->render.framegroupblend[0].frame = ent->render.framegroupblend[1].frame = ent->state_current.frame;
ent->render.framegroupblend[0].start = ent->render.framegroupblend[1].start = cl.time;
ent->render.framegroupblend[0].lerp = 1;ent->render.framegroupblend[1].lerp = 0;
if (cl.parsingtextmode == CL_PARSETEXTMODE_PING)
{
// if anything goes wrong, we'll assume this is not a ping report
- qboolean expected = cl.parsingtextexpectingpingforscores;
+ qboolean expected = cl.parsingtextexpectingpingforscores != 0;
cl.parsingtextexpectingpingforscores = 0;
cl.parsingtextmode = CL_PARSETEXTMODE_NONE;
t = text;
double timehigh;
cl.mtime[1] = cl.mtime[0];
cl.mtime[0] = newtime;
- if (cls.timedemo || (cl.islocalgame && !sv_fixedframeratesingleplayer.integer) || cl.mtime[1] == cl.mtime[0] || cls.signon < SIGNONS)
+ if (cl_nolerp.integer || cls.timedemo || (cl.islocalgame && !sv_fixedframeratesingleplayer.integer) || cl.mtime[1] == cl.mtime[0] || cls.signon < SIGNONS)
cl.time = cl.mtime[1] = newtime;
else if (cls.demoplayback)
{
break;
case qw_svc_setpause:
- cl.paused = MSG_ReadByte ();
+ cl.paused = MSG_ReadByte () != 0;
if (cl.paused)
CDAudio_Pause ();
else
i -= 32768;
if (i >= 1 && i < MAX_SOUNDS)
{
- sfx_t *sfx = S_PrecacheSound (s, true, false);
+ sfx_t *sfx = S_PrecacheSound (s, true, true);
if (!sfx && snd_initialized.integer)
Con_DPrintf("svc_precache: S_PrecacheSound(\"%s\") failed\n", s);
cl.sound_precache[i] = sfx;
break;
case svc_setpause:
- cl.paused = MSG_ReadByte ();
+ cl.paused = MSG_ReadByte () != 0;
if (cl.paused)
CDAudio_Pause ();
else