summaryrefslogtreecommitdiff
path: root/viewport.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-03 08:50:44 +0000
committertron <tron@openttd.org>2005-01-03 08:50:44 +0000
commit7a51cb2aef3275f85bf0ca919fdd9cc32b335713 (patch)
tree5c567cb4d90a99802939c3df5715fe67cc68f45b /viewport.c
parent85e6b834c89cffc5e3008db845983bfafc438bbc (diff)
downloadopenttd-7a51cb2aef3275f85bf0ca919fdd9cc32b335713.tar.xz
(svn r1330) Increase size of some vars from int16 to int32 to guard against future overflows
Diffstat (limited to 'viewport.c')
-rw-r--r--viewport.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/viewport.c b/viewport.c
index 3c8d72e92..b6bb6ba03 100644
--- a/viewport.c
+++ b/viewport.c
@@ -18,8 +18,8 @@ typedef struct StringSpriteToDraw {
uint16 string;
uint16 color;
struct StringSpriteToDraw *next;
- int16 x;
- int16 y;
+ int32 x;
+ int32 y;
uint32 params[3];
uint16 width;
} StringSpriteToDraw;
@@ -27,21 +27,28 @@ typedef struct StringSpriteToDraw {
typedef struct TileSpriteToDraw {
uint32 image;
struct TileSpriteToDraw *next;
- int16 x, y;
+ int32 x;
+ int32 y;
byte z;
} TileSpriteToDraw;
typedef struct ChildScreenSpriteToDraw {
uint32 image;
- int16 x,y;
+ int32 x;
+ int32 y;
struct ChildScreenSpriteToDraw *next;
} ChildScreenSpriteToDraw;
typedef struct ParentSpriteToDraw {
uint32 image;
- int16 left, top, right, bottom;
- int16 tile_x, tile_y;
- int16 tile_right, tile_bottom;
+ int32 left;
+ int32 top;
+ int32 right;
+ int32 bottom;
+ int32 tile_x;
+ int32 tile_y;
+ int32 tile_right;
+ int32 tile_bottom;
ChildScreenSpriteToDraw *child;
byte unk16;
byte tile_z;
@@ -333,7 +340,7 @@ Point GetTileZoomCenterWindow(bool in, Window * w)
return GetTileFromScreenXY(x+vp->left, y+vp->top);
}
-void DrawGroundSpriteAt(uint32 image, int16 x, int16 y, byte z)
+void DrawGroundSpriteAt(uint32 image, int32 x, int32 y, byte z)
{
ViewportDrawer *vd = _cur_vd;
TileSpriteToDraw *ts;