Only use Mix_SetPosition if app.directionAudio is set.

This commit is contained in:
Steve 2017-05-16 19:07:51 +01:00
parent 1ade5e6c38
commit 73fcdbf3ee
2 changed files with 2 additions and 1 deletions

View File

@ -98,7 +98,7 @@ void playBattleSound(int id, int x, int y)
vol /= MAX_BATTLE_SOUND_DISTANCE; vol /= MAX_BATTLE_SOUND_DISTANCE;
vol *= distance; vol *= distance;
if (distance >= MIN_BATTLE_SOUND_DISTANCE) if (app.directionalAudio && distance >= MIN_BATTLE_SOUND_DISTANCE)
{ {
bearing = 360 - getAngle(x, y, lastPlayerX, lastPlayerY); bearing = 360 - getAngle(x, y, lastPlayerX, lastPlayerY);
Mix_SetPosition(channel, (Sint16)bearing, (Uint8)distance); Mix_SetPosition(channel, (Sint16)bearing, (Uint8)distance);

View File

@ -29,4 +29,5 @@ extern int getDistance(int x1, int y1, int x2, int y2);
extern float getAngle(int x1, int y1, int x2, int y2); extern float getAngle(int x1, int y1, int x2, int y2);
extern char *getFileLocation(char *filename); extern char *getFileLocation(char *filename);
extern App app;
extern Entity *player; extern Entity *player;