mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r26201) -Fix: unscaling by a negative value is the same as scaling by a positive number
This commit is contained in:
parent
3d40beeb69
commit
98b320614a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user