*/
void CL_UpdateWorld(void)
{
- r_refdef.scene.extraupdate = !r_speeds.integer;
r_refdef.scene.numentities = 0;
r_refdef.scene.numlights = 0;
r_refdef.view.matrix = identitymatrix;
int i;
double timestart, timedelta;
- r_refdef.scene.extraupdate = false;
-
timestart = Sys_DirtyTime();
for (i = 0;i < 128;i++)
{
R_TimeReport("waterworld");
}
- // don't let sound skip if going slow
- if (r_refdef.scene.extraupdate)
- S_ExtraUpdate ();
-
R_DrawModelsAddWaterPlanes();
if (r_timereport_active)
R_TimeReport("watermodels");
R_UpdateFog();
- // don't let sound skip if going slow
- if (r_refdef.scene.extraupdate)
- S_ExtraUpdate ();
-
R_MeshQueue_BeginScene();
R_SkyStartFrame();
if (cl.csqc_vidvars.drawworld)
{
- // don't let sound skip if going slow
- if (r_refdef.scene.extraupdate)
- S_ExtraUpdate ();
-
if (r_refdef.scene.worldmodel && r_refdef.scene.worldmodel->DrawSky)
{
r_refdef.scene.worldmodel->DrawSky(r_refdef.scene.worldentity);
R_TimeReport("world");
}
- // don't let sound skip if going slow
- if (r_refdef.scene.extraupdate)
- S_ExtraUpdate ();
-
R_DrawModels();
if (r_timereport_active)
R_TimeReport("models");
- // don't let sound skip if going slow
- if (r_refdef.scene.extraupdate)
- S_ExtraUpdate ();
-
if (!r_shadow_usingdeferredprepass)
{
R_Shadow_DrawLights();
R_TimeReport("rtlights");
}
- // don't let sound skip if going slow
- if (r_refdef.scene.extraupdate)
- S_ExtraUpdate ();
-
if (cl.csqc_vidvars.drawworld)
{
R_DrawModelDecals();
if (r_timereport_active)
R_TimeReport("coronas");
}
-
- // don't let sound skip if going slow
- if (r_refdef.scene.extraupdate)
- S_ExtraUpdate ();
}
static const unsigned short bboxelements[36] =
S_LocalSound ("sound/misc/menu2.wav");
m_entersound = false;
}
-
- S_ExtraUpdate ();
}
if (R_Shadow_ScissorForBBox(rtlight->cached_cullmins, rtlight->cached_cullmaxs))
return;
- // don't let sound skip if going slow
- if (r_refdef.scene.extraupdate)
- S_ExtraUpdate();
-
numlightentities = rtlight->cached_numlightentities;
numlightentities_noselfshadow = rtlight->cached_numlightentities_noselfshadow;
numshadowentities = rtlight->cached_numshadowentities;
if (R_Shadow_ScissorForBBox(rtlight->cached_cullmins, rtlight->cached_cullmaxs))
return;
- // don't let sound skip if going slow
- if (r_refdef.scene.extraupdate)
- S_ExtraUpdate();
-
numlightentities = rtlight->cached_numlightentities;
numlightentities_noselfshadow = rtlight->cached_numlightentities_noselfshadow;
numsurfaces = rtlight->cached_numsurfaces;
// render model shadowmaps (r_shadows 2) if desired which will be sampled in the forward pass
if (r_shadow_shadowmapatlas_modelshadows_size)
- {
R_Shadow_DrawModelShadowMaps();
- // don't let sound skip if going slow
- if (r_refdef.scene.extraupdate)
- S_ExtraUpdate();
- }
if (R_Shadow_ShadowMappingEnabled())
{
// TODO: really think about which fields should go into scene and which one should stay in refdef [1/7/2008 Black]
// maybe also refactor some of the functions to support different setting sources (ie. fogenabled, etc.) for different scenes
typedef struct r_refdef_scene_s {
- /// whether to call S_ExtraUpdate during render to reduce sound chop
- qbool extraupdate;
-
/// (client gameworld) time for rendering time based effects
double time;
// Linked list of known sfx
static sfx_t *known_sfx = NULL;
-static qbool sound_spatialized = false;
-
qbool simsound = false;
#ifdef CONFIG_VIDEO_CAPTURE
static cvar_t snd_precache = {CF_CLIENT, "snd_precache", "1", "loads sounds before they are used"};
static cvar_t ambient_level = {CF_CLIENT, "ambient_level", "0.3", "volume of environment noises (water and wind)"};
static cvar_t ambient_fade = {CF_CLIENT, "ambient_fade", "100", "rate of volume fading when moving from one environment to another"};
-static cvar_t snd_noextraupdate = {CF_CLIENT, "snd_noextraupdate", "0", "disables extra sound mixer calls that are meant to reduce the chance of sound breakup at very low framerates"};
static cvar_t snd_show = {CF_CLIENT, "snd_show", "0", "shows some statistics about sound mixing"};
// Default sound format is 48KHz, 32bit float, stereo
if (!SndSys_Init(&chosen_fmt))
{
Con_Print("S_Startup: SndSys_Init failed.\n");
- sound_spatialized = false;
return;
}
}
}
else
SndSys_Shutdown();
-
- sound_spatialized = false;
}
static void S_Restart_f(cmd_state_t *cmd)
Cvar_RegisterVariable(&snd_streaming_length);
Cvar_RegisterVariable(&ambient_level);
Cvar_RegisterVariable(&ambient_fade);
- Cvar_RegisterVariable(&snd_noextraupdate);
Cvar_RegisterVariable(&snd_show);
Cvar_RegisterVariable(&snd_waterfx);
Cvar_RegisterVariable(&_snd_mixahead);
}
R_TimeReport("audiospatialize");
- sound_spatialized = true;
-
// debugging output
if (snd_show.integer)
Con_Printf("----(%u)----\n", cls.soundstats.mixedsounds);
S_PaintAndSubmit();
}
-void S_ExtraUpdate (void)
-{
- if (snd_noextraupdate.integer || !sound_spatialized)
- return;
-
- S_PaintAndSubmit();
-}
-
qbool S_LocalSoundEx (const char *sound, int chan, float fvol)
{
sfx_t *sfx;
{
}
-void S_ExtraUpdate (void)
-{
-}
-
qbool S_LocalSound (const char *s)
{
return false;
void S_UnloadAllSounds_f(struct cmd_state_s *cmd);
void S_Update(const matrix4x4_t *listenermatrix);
-void S_ExtraUpdate (void);
sfx_t *S_PrecacheSound (const char *sample, qbool complain, qbool levelsound);
float S_SoundLength(const char *name);