mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
Re-enable power generator fan sound effect for UB
This commit is contained in:
@@ -918,7 +918,7 @@ void HandleAddingPowerGenFanSound()
|
|||||||
sGridNo = POWERGENFANSOUND_GRIDNO2;
|
sGridNo = POWERGENFANSOUND_GRIDNO2;
|
||||||
|
|
||||||
//Create the new ambient fan sound
|
//Create the new ambient fan sound
|
||||||
//gJa25SaveStruct.iPowerGenFanPositionSndID = NewPositionSnd( sGridNo, POSITION_SOUND_STATIONATY_OBJECT, 0, POWER_GEN_FAN_SOUND );
|
gJa25SaveStruct.iPowerGenFanPositionSndID = NewPositionSnd( sGridNo, POSITION_SOUND_STATIONATY_OBJECT, 0, POWER_GEN_FAN_SOUND, 30 );
|
||||||
|
|
||||||
SetPositionSndsInActive( );
|
SetPositionSndsInActive( );
|
||||||
SetPositionSndsActive( );
|
SetPositionSndsActive( );
|
||||||
|
|||||||
@@ -2445,7 +2445,7 @@ BOOLEAN SOLDIERTYPE::CreateSoldierCommon( UINT8 ubBodyType, UINT16 usSoldierID,
|
|||||||
|
|
||||||
if ( this->ubBodyType == QUEENMONSTER )
|
if ( this->ubBodyType == QUEENMONSTER )
|
||||||
{
|
{
|
||||||
this->iPositionSndID = NewPositionSnd( NOWHERE, POSITION_SOUND_FROM_SOLDIER, (UINT32)this, QUEEN_AMBIENT_NOISE );
|
this->iPositionSndID = NewPositionSnd( NOWHERE, POSITION_SOUND_FROM_SOLDIER, (UINT32)this, QUEEN_AMBIENT_NOISE, 15 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+21
-12
@@ -774,6 +774,7 @@ typedef struct
|
|||||||
UINT32 uiData;
|
UINT32 uiData;
|
||||||
BOOLEAN fAllocated;
|
BOOLEAN fAllocated;
|
||||||
BOOLEAN fInActive;
|
BOOLEAN fInActive;
|
||||||
|
UINT8 volume;
|
||||||
|
|
||||||
} POSITIONSND;
|
} POSITIONSND;
|
||||||
|
|
||||||
@@ -820,7 +821,7 @@ void RecountPositionSnds( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
INT32 NewPositionSnd( INT32 sGridNo, UINT32 uiFlags, UINT32 uiData, UINT32 iSoundToPlay )
|
INT32 NewPositionSnd( INT32 sGridNo, UINT32 uiFlags, UINT32 uiData, UINT32 iSoundToPlay, UINT8 volume )
|
||||||
{
|
{
|
||||||
POSITIONSND *pPositionSnd;
|
POSITIONSND *pPositionSnd;
|
||||||
INT32 iPositionSndIndex;
|
INT32 iPositionSndIndex;
|
||||||
@@ -849,6 +850,7 @@ INT32 NewPositionSnd( INT32 sGridNo, UINT32 uiFlags, UINT32 uiData, UINT32 iSoun
|
|||||||
pPositionSnd->uiFlags = uiFlags;
|
pPositionSnd->uiFlags = uiFlags;
|
||||||
pPositionSnd->fAllocated = TRUE;
|
pPositionSnd->fAllocated = TRUE;
|
||||||
pPositionSnd->iSoundToPlay = iSoundToPlay;
|
pPositionSnd->iSoundToPlay = iSoundToPlay;
|
||||||
|
pPositionSnd->volume = volume;
|
||||||
|
|
||||||
pPositionSnd->iSoundSampleID = NO_SAMPLE;
|
pPositionSnd->iSoundSampleID = NO_SAMPLE;
|
||||||
|
|
||||||
@@ -892,7 +894,7 @@ void SetPositionSndGridNo( INT32 iPositionSndIndex, INT32 sGridNo )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetPositionSndsActive( )
|
void SetPositionSndsActive()
|
||||||
{
|
{
|
||||||
UINT32 cnt;
|
UINT32 cnt;
|
||||||
POSITIONSND *pPositionSnd;
|
POSITIONSND *pPositionSnd;
|
||||||
@@ -901,20 +903,27 @@ void SetPositionSndsActive( )
|
|||||||
|
|
||||||
for ( cnt = 0; cnt < guiNumPositionSnds; cnt++ )
|
for ( cnt = 0; cnt < guiNumPositionSnds; cnt++ )
|
||||||
{
|
{
|
||||||
pPositionSnd = &gPositionSndData[ cnt ];
|
pPositionSnd = &gPositionSndData[cnt];
|
||||||
|
|
||||||
if ( pPositionSnd->fAllocated )
|
if ( pPositionSnd->fAllocated )
|
||||||
{
|
|
||||||
if ( pPositionSnd->fInActive )
|
|
||||||
{
|
{
|
||||||
pPositionSnd->fInActive = FALSE;
|
if ( pPositionSnd->fInActive )
|
||||||
|
{
|
||||||
|
pPositionSnd->fInActive = FALSE;
|
||||||
|
|
||||||
// Begin sound effect
|
// Begin sound effect
|
||||||
// Volume 0
|
// Volume 0
|
||||||
pPositionSnd->iSoundSampleID = PlayJA2Sample( pPositionSnd->iSoundToPlay, RATE_11025, 0, 0, MIDDLEPAN );
|
if ( pPositionSnd->iSoundToPlay == POWER_GEN_FAN_SOUND )
|
||||||
|
{
|
||||||
|
pPositionSnd->iSoundSampleID = PlayJA2SampleFromFile( "Sounds\\POWERGENFAN.WAV", RATE_11025, 0, 0, MIDDLEPAN);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pPositionSnd->iSoundSampleID = PlayJA2Sample( pPositionSnd->iSoundToPlay, RATE_11025, 0, 0, MIDDLEPAN );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1068,7 +1077,7 @@ void SetPositionSndsVolumeAndPanning( )
|
|||||||
{
|
{
|
||||||
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
|
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
|
||||||
{
|
{
|
||||||
bVolume = PositionSoundVolume( 15, pPositionSnd->sGridNo );
|
bVolume = PositionSoundVolume( pPositionSnd->volume, pPositionSnd->sGridNo );
|
||||||
|
|
||||||
if ( pPositionSnd->uiFlags & POSITION_SOUND_FROM_SOLDIER )
|
if ( pPositionSnd->uiFlags & POSITION_SOUND_FROM_SOLDIER )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -379,7 +379,9 @@ enum SoundDefines
|
|||||||
S_VAL,
|
S_VAL,
|
||||||
//BREAK_LIGHT_IGNITING,
|
//BREAK_LIGHT_IGNITING,
|
||||||
|
|
||||||
NUM_SAMPLES
|
NUM_SAMPLES,
|
||||||
|
POWER_GEN_FAN_SOUND = 5001 // This is a workaround to get the generator fan positional sound working in UB campaign.
|
||||||
|
// Had to special case it because sound effects have been externalized.
|
||||||
};
|
};
|
||||||
|
|
||||||
enum AmbientDefines
|
enum AmbientDefines
|
||||||
@@ -453,7 +455,7 @@ void PlayDelayedJA2Sample( UINT32 uiDelay, UINT32 usNum, UINT32 usRate, UINT32 u
|
|||||||
#define POSITION_SOUND_FROM_SOLDIER 0x00000001
|
#define POSITION_SOUND_FROM_SOLDIER 0x00000001
|
||||||
#define POSITION_SOUND_STATIONATY_OBJECT 0x00000002
|
#define POSITION_SOUND_STATIONATY_OBJECT 0x00000002
|
||||||
|
|
||||||
INT32 NewPositionSnd( INT32 sGridNo, UINT32 uiFlags, UINT32 uiData, UINT32 iSoundToPlay );
|
INT32 NewPositionSnd( INT32 sGridNo, UINT32 uiFlags, UINT32 uiData, UINT32 iSoundToPlay, UINT8 volume );
|
||||||
void DeletePositionSnd( INT32 iPositionSndIndex );
|
void DeletePositionSnd( INT32 iPositionSndIndex );
|
||||||
void SetPositionSndsActive( );
|
void SetPositionSndsActive( );
|
||||||
void SetPositionSndsInActive( );
|
void SetPositionSndsInActive( );
|
||||||
|
|||||||
Reference in New Issue
Block a user