diff src/viewport.cpp @ 7006:933d3ee6d37d draft

(svn r10262) -Fix (r10258): some places that needed to be changed to uint64 were hidden/forgotten, which caused memory corruptions and that in caused all kinds of assertions to trigger.
author rubidium <rubidium@openttd.org>
date Thu, 21 Jun 2007 19:08:47 +0000 (2007-06-21)
parents b6cf3513b2c4
children f004782ed538
line wrap: on
line diff
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -58,7 +58,7 @@
 	StringSpriteToDraw *next;
 	int32 x;
 	int32 y;
-	uint32 params[2];
+	uint64 params[2];
 	uint16 width;
 };
 
@@ -580,7 +580,7 @@
 }
 
 /* Returns a StringSpriteToDraw */
-void *AddStringToDraw(int x, int y, StringID string, uint32 params_1, uint32 params_2)
+void *AddStringToDraw(int x, int y, StringID string, uint64 params_1, uint64 params_2)
 {
 	ViewportDrawer *vd = _cur_vd;
 	StringSpriteToDraw *ss;
@@ -2028,7 +2028,7 @@
 * @param to TileIndex of the last tile to highlight */
 void VpSetPresizeRange(TileIndex from, TileIndex to)
 {
-	uint distance = DistanceManhattan(from, to) + 1;
+	uint64 distance = DistanceManhattan(from, to) + 1;
 
 	_thd.selend.x = TileX(to) * TILE_SIZE;
 	_thd.selend.y = TileY(to) * TILE_SIZE;
@@ -2304,7 +2304,7 @@
 		TileIndex t1 = TileVirtXY(x, y);
 		uint distance = DistanceManhattan(t0, t1) + 1;
 		byte index = 0;
-		uint params[2];
+		uint64 params[2];
 
 		if (distance != 1) {
 			int heightdiff = CalcHeightdiff(b, distance, t0, t1);
@@ -2383,7 +2383,7 @@
 				TileIndex t1 = TileVirtXY(x, y);
 				uint distance = DistanceManhattan(t0, t1) + 1;
 				byte index = 0;
-				uint params[2];
+				uint64 params[2];
 
 				if (distance != 1) {
 					/* With current code passing a HT_LINE style to calculate the height
@@ -2416,7 +2416,7 @@
 				uint dx = delta(TileX(t0), TileX(t1)) + 1;
 				uint dy = delta(TileY(t0), TileY(t1)) + 1;
 				byte index = 0;
-				uint params[3];
+				uint64 params[3];
 
 				/* If dragging an area (eg dynamite tool) and it is actually a single
 				 * row/column, change the type to 'line' to get proper calculation for height */