Browse Source

💚 Fix NOSOUND build

pull/2410/head
Anders Jenbo 5 years ago
parent
commit
b591824182
  1. 2
      Source/DiabloUI/diabloui.cpp
  2. 6
      Source/diablo.cpp
  3. 2
      Source/effects_stubs.cpp
  4. 2
      Source/monster.cpp
  5. 6
      Source/objects.cpp

2
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
}

6
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())

2
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() { }

2
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)

6
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)

Loading…
Cancel
Save