summaryrefslogtreecommitdiff
path: root/src/sound.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2007-12-17 22:04:07 +0000
committersmatz <smatz@openttd.org>2007-12-17 22:04:07 +0000
commitbda9d4a23633c4ebb6ad18c29218deaf1a92d55d (patch)
treee1686070db2bce48c4953e4bbef6a196640ae495 /src/sound.cpp
parent61dcdbf0e0bbbe231b7adbd0a82da8d9e16dbb88 (diff)
downloadopenttd-bda9d4a23633c4ebb6ad18c29218deaf1a92d55d.tar.xz
(svn r11656) -Codechange: add ZOOM_LVL_BEGIN and postfix operators so ZoomLevel can be used in some iterations
Diffstat (limited to 'src/sound.cpp')
-rw-r--r--src/sound.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sound.cpp b/src/sound.cpp
index 5a3cb7638..312484c42 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -157,7 +157,7 @@ static void StartSound(uint sound, int panning, uint volume)
static const byte _vol_factor_by_zoom[] = {255, 190, 134, 87};
-assert_compile(lengthof(_vol_factor_by_zoom) == ZOOM_LVL_END);
+assert_compile(lengthof(_vol_factor_by_zoom) == ZOOM_LVL_END - ZOOM_LVL_BEGIN);
static const byte _sound_base_vol[] = {
128, 90, 128, 128, 128, 128, 128, 128,
@@ -216,7 +216,7 @@ static void SndPlayScreenCoordFx(SoundFx sound, int x, int y)
StartSound(
sound,
left / max(1, vp->virtual_width / ((PANNING_LEVELS << 1) + 1)) - PANNING_LEVELS,
- (GetSound(sound)->volume * msf.effect_vol * _vol_factor_by_zoom[vp->zoom]) >> 15
+ (GetSound(sound)->volume * msf.effect_vol * _vol_factor_by_zoom[vp->zoom - ZOOM_LVL_BEGIN]) >> 15
);
return;
}