mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
Little Alien
Play weapon sounds on higher volume Adjustable in ja2.ini git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@53 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+8
-1
@@ -19,6 +19,7 @@
|
|||||||
#define SET_TACTICAL_AI "JA2 Tactical AI Settings"
|
#define SET_TACTICAL_AI "JA2 Tactical AI Settings"
|
||||||
#define SET_GRAPHIC "JA2 Graphic Settings"
|
#define SET_GRAPHIC "JA2 Graphic Settings"
|
||||||
#define SET_GAMEPLAY "JA2 Gameplay Settings"
|
#define SET_GAMEPLAY "JA2 Gameplay Settings"
|
||||||
|
#define SET_SOUND "JA2 Sound Settings"
|
||||||
|
|
||||||
|
|
||||||
UINT8 gubDeadLockDelay = 15;
|
UINT8 gubDeadLockDelay = 15;
|
||||||
@@ -49,10 +50,12 @@ BOOLEAN gfEnableEmergencyButton_SkipStrategicEvents = FALSE;
|
|||||||
BOOLEAN gfAllowMilitiaGroups = TRUE;
|
BOOLEAN gfAllowMilitiaGroups = TRUE;
|
||||||
BOOLEAN gfAllowReinforcments = TRUE;
|
BOOLEAN gfAllowReinforcments = TRUE;
|
||||||
BOOLEAN gfAllowReinforcmentsOnlyInCity = FALSE;
|
BOOLEAN gfAllowReinforcmentsOnlyInCity = FALSE;
|
||||||
UINT32 guiBaseQueenPoolIncrement = 60;
|
UINT32 guiBaseQueenPoolIncrement = 60;
|
||||||
|
|
||||||
BOOLEAN fAllowTacticalMilitiaCommand = TRUE;
|
BOOLEAN fAllowTacticalMilitiaCommand = TRUE;
|
||||||
|
|
||||||
|
UINT32 guiWeaponSoundEffectsVolume = 0;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
CHAR8* strParamName;
|
CHAR8* strParamName;
|
||||||
@@ -75,6 +78,7 @@ enum
|
|||||||
|
|
||||||
TSetting gpSettings[] =
|
TSetting gpSettings[] =
|
||||||
{
|
{
|
||||||
|
//Video settings
|
||||||
{"fVSync", SET_RESOLUTION, &gfVSync, VT_BOOLEAN},
|
{"fVSync", SET_RESOLUTION, &gfVSync, VT_BOOLEAN},
|
||||||
|
|
||||||
{"PlayerTurnSpeedUpFactor", SET_TURN_SPEED, (LPVOID)&gubPlayerTurnSpeedUpFactor, VT_UINT8},
|
{"PlayerTurnSpeedUpFactor", SET_TURN_SPEED, (LPVOID)&gubPlayerTurnSpeedUpFactor, VT_UINT8},
|
||||||
@@ -83,6 +87,9 @@ TSetting gpSettings[] =
|
|||||||
{"MilitiaTurnSpeedUpFactor", SET_TURN_SPEED, (LPVOID)&gubMilitiaTurnSpeedUpFactor, VT_UINT8},
|
{"MilitiaTurnSpeedUpFactor", SET_TURN_SPEED, (LPVOID)&gubMilitiaTurnSpeedUpFactor, VT_UINT8},
|
||||||
{"CivTurnSpeedUpFactor", SET_TURN_SPEED, (LPVOID)&gubCivTurnSpeedUpFactor, VT_UINT8},
|
{"CivTurnSpeedUpFactor", SET_TURN_SPEED, (LPVOID)&gubCivTurnSpeedUpFactor, VT_UINT8},
|
||||||
|
|
||||||
|
//Sound settings
|
||||||
|
{"WeaponSoundEffectsVolume", SET_SOUND, &guiWeaponSoundEffectsVolume, VT_UINT32},
|
||||||
|
|
||||||
// Militia Settings
|
// Militia Settings
|
||||||
{"AllowTacticalMilitiaCommand", SET_TACTICAL, &fAllowTacticalMilitiaCommand, VT_BOOLEAN},
|
{"AllowTacticalMilitiaCommand", SET_TACTICAL, &fAllowTacticalMilitiaCommand, VT_BOOLEAN},
|
||||||
|
|
||||||
|
|||||||
+32
-7
@@ -19,6 +19,8 @@ UINT32 MIDVOLUME START_MIDVOLUME;
|
|||||||
UINT32 HIGHVOLUME START_HIGHVOLUME;
|
UINT32 HIGHVOLUME START_HIGHVOLUME;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
extern UINT32 guiWeaponSoundEffectsVolume;
|
||||||
|
|
||||||
UINT32 guiSpeechVolume = MIDVOLUME;
|
UINT32 guiSpeechVolume = MIDVOLUME;
|
||||||
UINT32 guiSoundEffectsVolume = MIDVOLUME;
|
UINT32 guiSoundEffectsVolume = MIDVOLUME;
|
||||||
|
|
||||||
@@ -437,17 +439,30 @@ BOOLEAN ShutdownJA2Sound( )
|
|||||||
|
|
||||||
UINT32 PlayJA2Sample( UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
|
UINT32 PlayJA2Sample( UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
|
||||||
{
|
{
|
||||||
SOUNDPARMS spParms;
|
//SoundLog((CHAR8 *)String(" Play sound %s on volume %d", szSoundEffects[usNum], ubVolume));
|
||||||
|
|
||||||
|
SOUNDPARMS spParms;
|
||||||
|
|
||||||
memset(&spParms, 0xff, sizeof(SOUNDPARMS));
|
memset(&spParms, 0xff, sizeof(SOUNDPARMS));
|
||||||
|
|
||||||
spParms.uiSpeed = usRate;
|
spParms.uiSpeed = usRate;
|
||||||
spParms.uiVolume = CalculateSoundEffectsVolume( ubVolume );
|
|
||||||
spParms.uiVolume &= 0xFFL;
|
if ( strstr( szSoundEffects[usNum], "WEAPONS" ) == NULL )
|
||||||
|
{
|
||||||
|
spParms.uiVolume = CalculateSoundEffectsVolume( ubVolume );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spParms.uiVolume = (UINT32)( ( ubVolume / (FLOAT) HIGHVOLUME ) * guiSoundEffectsVolume +.5 ) * (1 + guiWeaponSoundEffectsVolume / 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
spParms.uiVolume &= 0xFFL;
|
||||||
spParms.uiLoop = ubLoops;
|
spParms.uiLoop = ubLoops;
|
||||||
spParms.uiPan = uiPan & 0xFFL;
|
spParms.uiPan = uiPan & 0xFFL;
|
||||||
spParms.uiPriority=GROUP_PLAYER;
|
spParms.uiPriority=GROUP_PLAYER;
|
||||||
|
|
||||||
|
//SoundLog((CHAR8 *)String(" Play sound %s on volume %d", szSoundEffects[usNum], spParms.uiVolume));
|
||||||
|
|
||||||
return(SoundPlay(szSoundEffects[usNum], &spParms));
|
return(SoundPlay(szSoundEffects[usNum], &spParms));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,20 +485,30 @@ UINT32 PlayJA2StreamingSample( UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UIN
|
|||||||
|
|
||||||
UINT32 PlayJA2SampleFromFile( STR8 szFileName, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
|
UINT32 PlayJA2SampleFromFile( STR8 szFileName, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
|
||||||
{
|
{
|
||||||
|
//SoundLog((CHAR8 *)String(" Play sound %s on volume %d", szFileName, ubVolume));
|
||||||
// does the same thing as PlayJA2Sound, but one only has to pass the filename, not the index of the sound array
|
// does the same thing as PlayJA2Sound, but one only has to pass the filename, not the index of the sound array
|
||||||
|
|
||||||
SOUNDPARMS spParms;
|
SOUNDPARMS spParms;
|
||||||
|
|
||||||
memset(&spParms, 0xff, sizeof(SOUNDPARMS));
|
memset(&spParms, 0xff, sizeof(SOUNDPARMS));
|
||||||
|
|
||||||
spParms.uiSpeed = usRate;
|
spParms.uiSpeed = usRate;
|
||||||
spParms.uiVolume = CalculateSoundEffectsVolume( ubVolume );
|
|
||||||
|
if ( strstr( szFileName, "WEAPONS" ) == NULL )
|
||||||
|
{
|
||||||
|
spParms.uiVolume = CalculateSoundEffectsVolume( ubVolume );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spParms.uiVolume = (UINT32)( ( ubVolume / (FLOAT) HIGHVOLUME ) * guiSoundEffectsVolume +.5 ) * (1 + guiWeaponSoundEffectsVolume / 100);
|
||||||
|
}
|
||||||
|
|
||||||
spParms.uiLoop = ubLoops;
|
spParms.uiLoop = ubLoops;
|
||||||
spParms.uiPan = uiPan;
|
spParms.uiPan = uiPan;
|
||||||
spParms.uiPriority=GROUP_PLAYER;
|
spParms.uiPriority=GROUP_PLAYER;
|
||||||
|
|
||||||
//return(SoundPlay(szFileName, &spParms));
|
//SoundLog((CHAR8 *)String(" Play sound %s on volume %d", szFileName, spParms.uiVolume));
|
||||||
|
|
||||||
return(SoundPlay((STR) szFileName, &spParms));
|
return(SoundPlay((STR) szFileName, &spParms));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user