CL_KeepaliveMessage();
Mod_TouchModel(parse_model_precache[i]);
}
+ Mod_PurgeUnused();
+
// do the same for sounds
+ S_ClearUsed();
for (i = 1;i < numsounds;i++)
{
CL_KeepaliveMessage();
S_TouchSound(parse_sound_precache[i]);
}
- // purge anything that was not touched
- Mod_PurgeUnused();
+ S_PurgeUnused();
// now we try to load everything that is new
}
// sounds
- S_BeginPrecaching ();
for (i=1 ; i<numsounds ; i++)
{
CL_KeepaliveMessage();
cl.sound_precache[i] = S_PrecacheSound(parse_sound_precache[i], true);
}
- S_EndPrecaching ();
// local state
ent = &cl_entities[0];
{
// don't totally hog the CPU
if (timeleft >= 0.02)
- Sys_Sleep(timeleft * 1000 - 5);
+ Sys_Sleep((int)(timeleft * 1000) - 5);
return false;
}
}
/*
=========
-S_IsCached
+S_GetCached
=========
*/
void S_TouchSound (char *name)
{
S_FindName(name);
+ // TODO: set the "used" flag for this sound
}
+
+/*
+==================
+S_ClearUsed
+
+==================
+*/
+void S_ClearUsed (void)
+{
+ // TODO: reset the "used" flag of all precached sounds
+}
+
+
+/*
+==================
+S_PurgeUnused
+
+==================
+*/
+void S_PurgeUnused (void)
+{
+ // TODO: free all precached sounds without the "used" flag
+}
+
+
/*
==================
S_PrecacheSound
}
-void S_ClearPrecache (void)
-{
-}
-
-
-void S_BeginPrecaching (void)
-{
-}
-
-
-void S_EndPrecaching (void)
-{
-}
-
-
#define RAWSAMPLESBUFFER 32768
short s_rawsamplesbuffer[RAWSAMPLESBUFFER * 2];
int s_rawsamplesbuffer_start;
if (s->sfxcache && (s->sfxcache->speed == shm->speed))
return s->sfxcache;
- s->silentlymissing = !complain;
-
len = snprintf (namebuffer, sizeof (namebuffer), "sound/%s", s->name);
if (len >= sizeof (namebuffer))
return NULL;
return sc;
// Can't load the sound!
+ s->silentlymissing = !complain;
if (complain)
{
if (modified_name)
return NULL;
}
-void S_ClearPrecache (void)
-{
-}
-
void S_Update(vec3_t origin, vec3_t forward, vec3_t left, vec3_t up)
{
}
{
}
-void S_BeginPrecaching (void)
-{
-}
-
-void S_EndPrecaching (void)
-{
-}
-
void S_ExtraUpdate (void)
{
}
char name[MAX_QPATH];
mempool_t *mempool;
sfxcache_t *sfxcache;
- int silentlymissing; // true if missing and loaded with complain = false
+ qboolean silentlymissing; // true if missing and loaded with complain = false
} sfx_t;
typedef struct
sfx_t *S_GetCached(const char *name);
sfx_t *S_PrecacheSound (char *sample, int complain);
void S_TouchSound (char *sample);
-void S_ClearPrecache (void);
-void S_BeginPrecaching (void);
-void S_EndPrecaching (void);
+void S_ClearUsed (void);
+void S_PurgeUnused (void);
void S_PaintChannels(int endtime);
void S_InitPaintChannels (void);