/* ============ S_Base_Update Called once each time through the main loop ============ */ static void S_Base_Update( void ) { int i; int total; const channel_t *ch; if ( !s_soundStarted || s_soundMuted ) { // Com_DPrintf ("not started or muted\n"); return; } // // debugging output // if ( s_show->integer >= 2 ) { total = 0; ch = s_channels; for (i=0 ; i<MAX_CHANNELS; i++, ch++) { if (ch->thesfx && (ch->leftvol || ch->rightvol) ) { //Com_Printf ("%03d %d %d %s dist %f (listener %f %f %f %d -> %d)\n", i, ch->leftvol, ch->rightvol, ch->thesfx->soundName, ch->entnum != listener_number ? (ch->fixed_origin ? Distance(listener_origin, ch->origin) : Distance(loopSounds[ch->entnum].origin, listener_origin)) : -1.0, listener_origin[0], listener_origin[1], listener_origin[2], listener_number, ch->entnum); Com_Printf ("%d %d %s dist %f %d -> %d %03d\n", ch->leftvol, ch->rightvol, ch->thesfx->soundName, ch->entnum != listener_number ? (ch->fixed_origin ? Distance(listener_origin, ch->origin) : Distance(loopSounds[ch->entnum].origin, listener_origin)) : -1.0, listener_number, ch->entnum, i); total++; } } if (s_show->integer == 2) { Com_Printf ("----(%i)---- painted: %i\n", total, s_paintedtime); } } // add raw data from streamed samples S_UpdateBackgroundTrack(); // mix some sound S_Update_(); }
/* ============ S_Update Called once each time through the main loop ============ */ void S_Base_Update( void ) { int i; int total; channel_t *ch; if ( !s_soundStarted || s_soundMuted ) { // Com_DPrintf ("not started or muted\n"); return; } // // debugging output // if ( s_show->integer == 2 ) { total = 0; ch = s_channels; for (i=0 ; i<MAX_CHANNELS; i++, ch++) { if (ch->thesfx && (ch->leftvol || ch->rightvol) ) { Com_Printf ("%d %d %s\n", ch->leftvol, ch->rightvol, ch->thesfx->soundName); total++; } } Com_Printf ("----(%i)---- painted: %i\n", total, s_paintedtime); } // add raw data from streamed samples S_UpdateBackgroundTrack(); // mix some sound S_Update_(); }
/* Called once each time through the main loop */ static void S_Base_Update(void) { int i; int total; Channel *ch; if(!s_soundStarted || s_soundMuted) /* comdprintf ("not started or muted\n"); */ return; /* * debugging output */ if(s_show->integer == 2) { total = 0; ch = s_channels; for(i=0; i<MAX_CHANNELS; i++, ch++) if(ch->thesfx && (ch->leftvol || ch->rightvol)) { comprintf ("%d %d %s\n", ch->leftvol, ch->rightvol, ch->thesfx->soundName); total++; } comprintf ("----(%i)---- painted: %i\n", total, s_paintedtime); } /* add raw data from streamed samples */ sndupdatebackgroundtrack(); /* mix some sound */ S_Update_(); }
void S_ExtraUpdate (void) { IN_Accumulate (); if (snd_noextraupdate.value) return; // don't pollute timings S_Update_(); }
void S_ExtraUpdate(void) { #ifdef _WIN32 IN_Accumulate(); #endif if (snd_noextraupdate.value) return; /* don't pollute timings */ S_Update_(); }
// Called once each time through the main loop void S_Update(const CVec3 &origin, const CVec3 &right) { int i; if (!sound_started) return; // rebuild scale tables if volume is modified if (s_volume->modified) S_InitScaletable(); listener_origin = origin; listener_right = right; // update spatialization for dynamic sounds channel_t *ch = channels; for (i = 0; i < MAX_CHANNELS; i++, ch++) { if (!ch->sfx) continue; if (ch->autosound) { // autosounds are regenerated fresh each frame memset(ch, 0, sizeof(*ch)); continue; } S_Spatialize(ch); // respatialize channel if (!ch->leftvol && !ch->rightvol) { memset(ch, 0, sizeof(*ch)); continue; } } // add loopsounds AddLoopSounds(); // debugging output if (s_show->integer == 2) { int total = 0; for (i = 0, ch = channels; i < MAX_CHANNELS; i++, ch++) if (ch->sfx && (ch->leftvol || ch->rightvol) ) { appPrintf("%3i %3i %s\n", ch->leftvol, ch->rightvol, *ch->sfx->Name); total++; } appPrintf("----(%i)---- painted: %i\n", total, paintedtime); } // mix some sound S_Update_(); }
void S_ExtraUpdate(void) { #ifndef _arch_dreamcast // BlackAura #ifdef _WIN32 IN_Accumulate(); #endif #endif // BlackAura if (snd_noextraupdate.value) { return; // don't pollute timings } #ifndef FLASH S_Update_(); #endif }
void S_ExtraUpdate (void) { //joe: capturing audio #ifdef _WIN32 if (Movie_IsCapturing() && movie_is_avi) return; #endif #ifdef _WIN32 IN_Accumulate (); #endif if (s_noextraupdate.value || !sound_spatialized) return; // don't pollute timings S_Update_(); }
/* ERR_DiscFail Draws the damaged/dirty disc message, looping forever */ void ERR_DiscFail(bool poll) { // Load the texture: extern const char *Sys_RemapPath( const char *filename ); void *image = SP_LoadFileWithLanguage( Sys_RemapPath("base\\media\\DiscErr") ); if( image ) { SP_DrawTexture(image, 512, 512, 0); Z_Free(image); } for (;;) { extern void MuteBinkSystem(void); MuteBinkSystem(); extern void S_Update_(void); S_Update_(); } }
/* ============ S_Update Called once each time through the main loop ============ */ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up) { int i, j; int total; channel_t *ch; channel_t *combine; if (!sound_started || (snd_blocked > 0)) return; VectorCopy(origin, listener_origin); VectorCopy(forward, listener_forward); VectorCopy(right, listener_right); VectorCopy(up, listener_up); // update general area ambient sound sources S_UpdateAmbientSounds (); combine = NULL; // update spatialization for static and dynamic sounds ch = channels+NUM_AMBIENTS; for (i=NUM_AMBIENTS ; i<total_channels; i++, ch++) { if (!ch->sfx) continue; SND_Spatialize(ch); // respatialize channel if (!ch->leftvol && !ch->rightvol) continue; // try to combine static sounds with a previous channel of the same // sound effect so we don't mix five torches every frame if (i >= MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS) { // see if it can just use the last one if (combine && combine->sfx == ch->sfx) { combine->leftvol += ch->leftvol; combine->rightvol += ch->rightvol; ch->leftvol = ch->rightvol = 0; continue; } // search for one combine = channels+MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS; for (j=MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS ; j<i; j++, combine++) if (combine->sfx == ch->sfx) break; if (j == total_channels) { combine = NULL; } else { if (combine != ch) { combine->leftvol += ch->leftvol; combine->rightvol += ch->rightvol; ch->leftvol = ch->rightvol = 0; } continue; } } } // // debugging output // if (snd_show.value) { total = 0; ch = channels; for (i=0 ; i<total_channels; i++, ch++) if (ch->sfx && (ch->leftvol || ch->rightvol) ) { Con_Printf ("%s %3i %3i\n", ch->sfx->name, ch->leftvol, ch->rightvol); total++; } Con_Printf ("----(%i)----\n", total); } // mix some sound S_Update_(); }
/* ============ S_Update Called once each time through the main loop ============ */ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up) { int i; int total; channel_t *ch; channel_t *combine; if (!sound_started) return; // if the laoding plaque is up, clear everything // out to make sure we aren't looping a dirty // dma buffer while loading if (cls.disable_screen) { S_ClearBuffer (); return; } // rebuild scale tables if volume is modified if (s_volume->modified) S_InitScaletable (); VectorCopy(origin, listener_origin); VectorCopy(forward, listener_forward); VectorCopy(right, listener_right); VectorCopy(up, listener_up); combine = NULL; // update spatialization for dynamic sounds ch = channels; for (i=0 ; i<MAX_CHANNELS; i++, ch++) { if (!ch->sfx) continue; if (ch->autosound) { // autosounds are regenerated fresh each frame memset (ch, 0, sizeof(*ch)); continue; } S_Spatialize(ch); // respatialize channel if (!ch->leftvol && !ch->rightvol) { memset (ch, 0, sizeof(*ch)); continue; } } // add loopsounds S_AddLoopSounds (); // // debugging output // if (s_show->value) { total = 0; ch = channels; for (i=0 ; i<MAX_CHANNELS; i++, ch++) if (ch->sfx && (ch->leftvol || ch->rightvol) ) { Com_Printf ("%3i %3i %s\n", ch->leftvol, ch->rightvol, ch->sfx->name); total++; } Com_Printf ("----(%i)---- painted: %i\n", total, paintedtime); } #ifdef OGG_SUPPORT // Com_DPrintf ("S_Update: calling S_UpdateBackgroundTrack\n"); // debug S_UpdateBackgroundTrack (); // Knightmare added #endif // mix some sound S_Update_(); }
/* ============ S_Update Called once each time through the main loop ============ */ void S_Base_Update( void ) { int i; vec3_t origin; int total; channel_t *ch; if ( !s_soundStarted || s_soundMuted ) { // Com_DPrintf ("not started or muted\n"); return; } // update spatialization for dynamic sounds if (respatialize) { respatialize = qfalse; ch = s_channels; for ( i = 0 ; i < MAX_CHANNELS ; i++, ch++ ) { if ( !ch->thesfx ) { continue; } // local and first person sounds will always be full volume if (ch->fullVolume) { ch->leftvol = ch->master_vol; ch->rightvol = ch->master_vol; } else { if (ch->fixed_origin) { VectorCopy( ch->origin, origin ); } else { VectorCopy( loopSounds[ ch->entnum ].origin, origin ); } S_SpatializeOrigin (origin, ch->master_vol, &ch->leftvol, &ch->rightvol); } } // add loopsounds S_AddLoopSounds (); } // // debugging output // if ( s_show->integer == 2 ) { total = 0; ch = s_channels; for (i=0 ; i<MAX_CHANNELS; i++, ch++) { if (ch->thesfx && (ch->leftvol || ch->rightvol) ) { Com_Printf ("%d %d %s\n", ch->leftvol, ch->rightvol, ch->thesfx->soundName); total++; } } Com_Printf ("----(%i)---- painted: %i\n", total, s_paintedtime); } // add raw data from streamed samples S_UpdateBackgroundTrack(); // mix some sound S_Update_(); }