Fixed AllowDShowSound=2 not working

Limited NumSoundBuffers to the max of 32.
Fixed replacing Body_Torso with Body_Uncalled (from commit 62f890d)
Corrected the code in the previous commit.
This commit is contained in:
NovaRain
2020-04-23 12:42:20 +08:00
parent cb1d5d359f
commit 1839790dfb
7 changed files with 35 additions and 17 deletions
+4 -2
View File
@@ -574,7 +574,8 @@ void SoundInit() {
// Pause and resume sound playback when the game loses focus
SetFocusFunc(SoundLostFocus);
if (int allowDShowSound = GetConfigInt("Sound", "AllowDShowSound", 0) > 0) {
int allowDShowSound = GetConfigInt("Sound", "AllowDShowSound", 0);
if (allowDShowSound > 0) {
MakeJump(0x4AD499, soundLoad_hack);
const DWORD gmoviePlayStopAddr[] = {0x44E80A, 0x445280};
HookCalls(gmovie_play_hook_stop, gmoviePlayStopAddr); // only play looping music
@@ -584,7 +585,8 @@ void SoundInit() {
CreateSndWnd();
}
if (int sBuff = GetConfigInt("Sound", "NumSoundBuffers", 0)) {
int sBuff = GetConfigInt("Sound", "NumSoundBuffers", 0);
if (sBuff > 0 && sBuff <= 32) {
SafeWrite8(0x451129, (BYTE)sBuff);
}