Skip sound effects handling earlier if effects volume is 0
This commit is contained in:
@@ -256,8 +256,6 @@ void SndCopyToPool()
|
||||
*/
|
||||
static void SndPlayScreenCoordFx(SoundID sound, int left, int right, int top, int bottom)
|
||||
{
|
||||
if (_settings_client.music.effect_vol == 0) return;
|
||||
|
||||
for (const Window *w : Window::IterateFromBack()) {
|
||||
const Viewport *vp = w->viewport;
|
||||
|
||||
@@ -280,6 +278,8 @@ static void SndPlayScreenCoordFx(SoundID sound, int left, int right, int top, in
|
||||
|
||||
void SndPlayTileFx(SoundID sound, TileIndex tile)
|
||||
{
|
||||
if (_settings_client.music.effect_vol == 0) return;
|
||||
|
||||
/* emits sound from center of the tile */
|
||||
int x = std::min(MapMaxX() - 1, TileX(tile)) * TILE_SIZE + TILE_SIZE / 2;
|
||||
int y = std::min(MapMaxY() - 1, TileY(tile)) * TILE_SIZE - TILE_SIZE / 2;
|
||||
@@ -292,6 +292,8 @@ void SndPlayTileFx(SoundID sound, TileIndex tile)
|
||||
|
||||
void SndPlayVehicleFx(SoundID sound, const Vehicle *v)
|
||||
{
|
||||
if (_settings_client.music.effect_vol == 0) return;
|
||||
|
||||
SndPlayScreenCoordFx(sound,
|
||||
v->coord.left, v->coord.right,
|
||||
v->coord.top, v->coord.bottom
|
||||
|
Reference in New Issue
Block a user