Browse Source

engine: client: s_dsp: refactoring from hldsp

pull/4/head
Alibek Omarov 10 months ago
parent
commit
628ac376ed
  1. 12
      engine/client/s_dsp.c
  2. 3
      engine/client/s_mix.c
  3. 3
      engine/client/sound.h

12
engine/client/s_dsp.c

@ -334,7 +334,7 @@ DLY_MovePointer @@ -334,7 +334,7 @@ DLY_MovePointer
Checks overflow and moves pointer
============
*/
_inline void DLY_MovePointer( dly_t *dly )
static void DLY_MovePointer( dly_t *dly )
{
if( ++dly->idelayinput >= dly->cdelaysamplesmax )
dly->idelayinput = 0;
@ -807,13 +807,9 @@ DSP_Process @@ -807,13 +807,9 @@ DSP_Process
(xash dsp interface)
===========
*/
void DSP_Process( int idsp, portable_samplepair_t *pbfront, int sampleCount )
void DSP_Process( portable_samplepair_t *pbfront, int sampleCount )
{
if( dsp_off.value )
return;
// don't process DSP while in menu
if( cls.key_dest == key_menu || !sampleCount )
if( dsp_off.value || !sampleCount )
return;
// preset is already installed by CheckNewDspPresets
@ -940,7 +936,7 @@ static void SX_Profiling_f( void ) @@ -940,7 +936,7 @@ static void SX_Profiling_f( void )
start = Sys_DoubleTime();
for( calls = 10000; calls; calls-- )
{
DSP_Process( idsp_room, testbuffer, 512 );
DSP_Process( testbuffer, 512 );
}
end = Sys_DoubleTime();

3
engine/client/s_mix.c

@ -999,7 +999,8 @@ void MIX_PaintChannels( int endtime ) @@ -999,7 +999,8 @@ void MIX_PaintChannels( int endtime )
MIX_UpsampleAllPaintbuffers( end, count );
// process all sounds with DSP
DSP_Process( idsp_room, MIX_GetPFrontFromIPaint( IROOMBUFFER ), count );
if( cls.key_dest != key_menu )
DSP_Process( MIX_GetPFrontFromIPaint( IROOMBUFFER ), count );
// add music or soundtrack from movie (no dsp)
MIX_MixPaintbuffers( IPAINTBUFFER, IROOMBUFFER, IPAINTBUFFER, count, S_GetMasterVolume() );

3
engine/client/sound.h

@ -255,8 +255,7 @@ void S_InitSounds( void ); @@ -255,8 +255,7 @@ void S_InitSounds( void );
void SX_Init( void );
void SX_Free( void );
void CheckNewDspPresets( void );
void DSP_Process( int idsp, portable_samplepair_t *pbfront, int sampleCount );
float DSP_GetGain( int idsp );
void DSP_Process( portable_samplepair_t *pbfront, int sampleCount );
void DSP_ClearState( void );
qboolean S_Init( void );

Loading…
Cancel
Save