summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-05-26 15:20:13 +0000
committertruelight <truelight@openttd.org>2007-05-26 15:20:13 +0000
commita856c160ef8c8554911bb54ca8eb154ad591a914 (patch)
treee4303d75d2e53aa0a7c785c08e51b5e21e4d0f10 /src
parent9ca9d73eea3ca74b569848f616dd9a8c85c23699 (diff)
downloadopenttd-a856c160ef8c8554911bb54ca8eb154ad591a914.tar.xz
(svn r9936) -Fix: (Un)ScaleByZoom missed a minus sign in some cases
Diffstat (limited to 'src')
-rw-r--r--src/zoom.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zoom.hpp b/src/zoom.hpp
index e5e119452..c80f094bf 100644
--- a/src/zoom.hpp
+++ b/src/zoom.hpp
@@ -37,14 +37,14 @@ static inline int ScaleByZoom(int value, ZoomLevel zoom)
{
if (zoom == ZOOM_LVL_NORMAL) return value;
int izoom = (int)zoom - (int)ZOOM_LVL_NORMAL;
- return (zoom > ZOOM_LVL_NORMAL) ? value << izoom : value >> izoom;
+ return (zoom > ZOOM_LVL_NORMAL) ? value << izoom : value >> -izoom;
}
static inline int UnScaleByZoom(int value, ZoomLevel zoom)
{
if (zoom == ZOOM_LVL_NORMAL) return value;
int izoom = (int)zoom - (int)ZOOM_LVL_NORMAL;
- return (zoom > ZOOM_LVL_NORMAL) ? value >> izoom : value << izoom;
+ return (zoom > ZOOM_LVL_NORMAL) ? value >> izoom : value << -izoom;
}
#endif /* ZOOM_HPP */