diff --git a/Source/DiabloUI/diabloui.cpp b/Source/DiabloUI/diabloui.cpp index 94fa658ac..9f3f5db63 100644 --- a/Source/DiabloUI/diabloui.cpp +++ b/Source/DiabloUI/diabloui.cpp @@ -401,10 +401,12 @@ void UiHandleEvents(SDL_Event *event) gbActive = false; else if (event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) ReinitializeHardwareCursor(); +#ifndef NOSOUND else if (event->window.event == SDL_WINDOWEVENT_FOCUS_LOST) music_mute(); else if (event->window.event == SDL_WINDOWEVENT_FOCUS_GAINED) music_unmute(); +#endif } #endif } diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 6634d05b0..55f951f52 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -1782,7 +1782,9 @@ void diablo_focus_pause() track_repeat_walk(false); } +#ifndef NOSOUND music_mute(); +#endif MinimizePaused = true; } @@ -1798,7 +1800,9 @@ void diablo_focus_unpause() PauseMode = 0; } +#ifndef NOSOUND music_unmute(); +#endif MinimizePaused = false; } @@ -2131,7 +2135,9 @@ void LoadGameLevel(bool firstflag, lvl_entry lvldir) music_start(leveltype); if (MinimizePaused) { +#ifndef NOSOUND music_mute(); +#endif } while (!IncProgress()) diff --git a/Source/effects_stubs.cpp b/Source/effects_stubs.cpp index 18837ae89..eb14d8b12 100644 --- a/Source/effects_stubs.cpp +++ b/Source/effects_stubs.cpp @@ -12,7 +12,7 @@ bool effect_is_playing(int nSFX) { return false; } void stream_stop() { } void InitMonsterSND(int monst) { } void FreeMonsterSnd() { } -bool CalculateSoundPosition(Point soundPosition, int *plVolume, int *plPan) { } +bool CalculateSoundPosition(Point soundPosition, int *plVolume, int *plPan) { return false; } void PlaySFX(_sfx_id psfx) { } void PlaySfxLoc(_sfx_id psfx, Point position, bool randomizeByCategory) { } void sound_stop() { } diff --git a/Source/monster.cpp b/Source/monster.cpp index 68da681df..8ee4cd783 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -4900,6 +4900,7 @@ void PrintUniqueHistory() void PlayEffect(MonsterStruct &monster, int mode) { +#ifndef NOSOUND if (Players[MyPlayerId].pLvlLoad != 0) { return; } @@ -4921,6 +4922,7 @@ void PlayEffect(MonsterStruct &monster, int mode) return; snd_play_snd(snd, lVolume, lPan); +#endif } void MissToMonst(int i, Point position) diff --git a/Source/objects.cpp b/Source/objects.cpp index 21d021ef7..0cd1deec8 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -799,9 +799,9 @@ void LoadMapObjs(const char *path, Point start) void AddDiabObjs() { - LoadMapObjects("Levels\\L4Data\\diab1.DUN", { 2 * diabquad1x, 2 * diabquad1y }, { diabquad2x, diabquad2y, 11, 12 }, 1); - LoadMapObjects("Levels\\L4Data\\diab2a.DUN", { 2 * diabquad2x, 2 * diabquad2y }, { diabquad3x, diabquad3y, 11, 11 }, 2); - LoadMapObjects("Levels\\L4Data\\diab3a.DUN", { 2 * diabquad3x, 2 * diabquad3y }, { diabquad4x, diabquad4y, 9, 9 }, 3); + LoadMapObjects("Levels\\L4Data\\diab1.DUN", { 2 * diabquad1x, 2 * diabquad1y }, { { diabquad2x, diabquad2y }, { 11, 12 } }, 1); + LoadMapObjects("Levels\\L4Data\\diab2a.DUN", { 2 * diabquad2x, 2 * diabquad2y }, { { diabquad3x, diabquad3y }, { 11, 11 } }, 2); + LoadMapObjects("Levels\\L4Data\\diab3a.DUN", { 2 * diabquad3x, 2 * diabquad3y }, { { diabquad4x, diabquad4y }, { 9, 9 } }, 3); } void AddCryptStoryBook(int s)