Browse Source

Allow playing specific sounds with 'PlaySfx'

pull/852/head
Juliano Goncalves 6 years ago committed by Anders Jenbo
parent
commit
379b7c92be
  1. 7
      Source/effects.cpp
  2. 2
      Source/effects.h

7
Source/effects.cpp

@ -1277,9 +1277,12 @@ static int RndSFX(int psfx)
return psfx + random_(165, nRand);
}
void PlaySFX(int psfx)
void PlaySFX(int psfx, bool randomizeByCategory)
{
psfx = RndSFX(psfx);
if (randomizeByCategory) {
psfx = RndSFX(psfx);
}
PlaySFX_priv(&sgSFX[psfx], FALSE, 0, 0);
}

2
Source/effects.h

@ -21,7 +21,7 @@ void InitMonsterSND(int monst);
void FreeMonsterSnd();
BOOL calc_snd_position(int x, int y, int *plVolume, int *plPan);
void PlayEffect(int i, int mode);
void PlaySFX(int psfx);
void PlaySFX(int psfx, bool randomizeByCategory = true);
void PlaySfxLoc(int psfx, int x, int y);
void sound_stop();
void sound_update();

Loading…
Cancel
Save