summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-01-02 11:04:37 +0000
committerrubidium <rubidium@openttd.org>2014-01-02 11:04:37 +0000
commitfb4db0b022489fe70b99f5bdef92c46721f3cfbb (patch)
treeed578bea667744c9102640930b461b1db8f8529b /src
parent868a67111b6c5b8b743356d268cf00fa39d88567 (diff)
downloadopenttd-fb4db0b022489fe70b99f5bdef92c46721f3cfbb.tar.xz
(svn r26201) -Fix: unscaling by a negative value is the same as scaling by a positive number
Diffstat (limited to 'src')
-rw-r--r--src/spritecache.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/spritecache.cpp b/src/spritecache.cpp
index 3ffd74a8c..6d514a8f6 100644
--- a/src/spritecache.cpp
+++ b/src/spritecache.cpp
@@ -162,7 +162,7 @@ uint GetMaxSpriteID()
static bool ResizeSpriteIn(SpriteLoader::Sprite *sprite, ZoomLevel src, ZoomLevel tgt)
{
- uint8 scaled_1 = UnScaleByZoom(1, (ZoomLevel)(tgt - src));
+ uint8 scaled_1 = ScaleByZoom(1, (ZoomLevel)(src - tgt));
/* Check for possible memory overflow. */
if (sprite[src].width * scaled_1 > UINT16_MAX || sprite[src].height * scaled_1 > UINT16_MAX) return false;