(svn r2420) - Codechange: magic number elminitation of cursorsprites.
authorDarkvater
Mon, 06 Jun 2005 13:47:06 +0000
changeset 1914 5ede46fd496f
parent 1913 57f516fa418c
child 1915 0d3195091244
(svn r2420) - Codechange: magic number elminitation of cursorsprites.
airport_gui.c
dock_gui.c
functions.h
gfx.c
gfx.h
industry_gui.c
main_gui.c
misc.c
misc_gui.c
openttd.h
player_gui.c
rail_gui.c
road_gui.c
saveload.c
table/animcursors.h
terraform_gui.c
viewport.c
--- a/airport_gui.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/airport_gui.c	Mon Jun 06 13:47:06 2005 +0000
@@ -40,7 +40,7 @@
 
 static void BuildAirClick_Airport(Window *w)
 {
-	if (HandlePlacePushButton(w, 3, 0xAA4, 1, PlaceAirport)) ShowBuildAirportPicker();
+	if (HandlePlacePushButton(w, 3, SPR_CURSOR_AIRPORT, 1, PlaceAirport)) ShowBuildAirportPicker();
 }
 
 static void BuildAirClick_Demolish(Window *w)
--- a/dock_gui.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/dock_gui.c	Mon Jun 06 13:47:06 2005 +0000
@@ -63,12 +63,12 @@
 
 static void BuildDocksClick_Canal(Window *w)
 {
-	HandlePlacePushButton(w, 3, SPR_OPENTTD_BASE + 11, 1, PlaceDocks_BuildCanal);
+	HandlePlacePushButton(w, 3, SPR_CURSOR_CANAL, 1, PlaceDocks_BuildCanal);
 }
 
 static void BuildDocksClick_Lock(Window *w)
 {
-	HandlePlacePushButton(w, 4, SPR_OPENTTD_BASE + 64, 1, PlaceDocks_BuildLock);
+	HandlePlacePushButton(w, 4, SPR_CURSOR_LOCK, 1, PlaceDocks_BuildLock);
 }
 
 static void BuildDocksClick_Demolish(Window *w)
@@ -78,18 +78,18 @@
 
 static void BuildDocksClick_Depot(Window *w)
 {
-	if (HandlePlacePushButton(w, 7, 0x2D1, 1, PlaceDocks_Depot)) ShowBuildDocksDepotPicker();
+	if (HandlePlacePushButton(w, 7, SPR_CURSOR_SHIP_DEPOT, 1, PlaceDocks_Depot)) ShowBuildDocksDepotPicker();
 }
 
 static void BuildDocksClick_Dock(Window *w)
 {
 
-	if (HandlePlacePushButton(w, 8, 0xE54, 3, PlaceDocks_Dock)) ShowBuildDockStationPicker();
+	if (HandlePlacePushButton(w, 8, SPR_CURSOR_DOCK, 3, PlaceDocks_Dock)) ShowBuildDockStationPicker();
 }
 
 static void BuildDocksClick_Buoy(Window *w)
 {
-	HandlePlacePushButton(w, 9, 0x2BE, 1, PlaceDocks_Buoy);
+	HandlePlacePushButton(w, 9, SPR_CURSOR_BOUY, 1, PlaceDocks_Buoy);
 }
 
 static void BuildDocksClick_Landscaping(Window *w)
--- a/functions.h	Mon Jun 06 13:11:35 2005 +0000
+++ b/functions.h	Mon Jun 06 13:47:06 2005 +0000
@@ -177,8 +177,8 @@
 void DeleteWindowById(WindowClass cls, WindowNumber number);
 void DeleteWindowByClass(WindowClass cls);
 
-void SetObjectToPlaceWnd(int icon, byte mode, Window *w);
-void SetObjectToPlace(int icon, byte mode, WindowClass window_class, WindowNumber window_num);
+void SetObjectToPlaceWnd(CursorID icon, byte mode, Window *w);
+void SetObjectToPlace(CursorID icon, byte mode, WindowClass window_class, WindowNumber window_num);
 
 void ResetObjectToPlace(void);
 
--- a/gfx.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/gfx.c	Mon Jun 06 13:47:06 2005 +0000
@@ -1913,7 +1913,7 @@
 	return true;
 }
 
-static void SetCursorSprite(uint cursor)
+static void SetCursorSprite(CursorID cursor)
 {
 	CursorVars *cv = &_cursor;
 	const Sprite *p;
@@ -1934,12 +1934,12 @@
 static void SwitchAnimatedCursor(void)
 {
 	CursorVars *cv = &_cursor;
-	const uint16 *cur;
-	uint sprite;
+	const CursorID *cur = cv->animate_cur;
+	CursorID sprite;
 
-	cur = cv->animate_cur;
-	if (cur == NULL || *cur == 0xFFFF)
-		cur = cv->animate_list;
+	// ANIM_CURSOR_END is 0xFFFF in table/animcursors.h
+	if (cur == NULL || *cur == 0xFFFF) cur = cv->animate_list;
+
 	sprite = cur[0];
 	cv->animate_timeout = cur[1];
 	cv->animate_cur = cur + 2;
@@ -1954,7 +1954,7 @@
 		SwitchAnimatedCursor();
 }
 
-void SetMouseCursor(uint cursor)
+void SetMouseCursor(CursorID cursor)
 {
 	// Turn off animation
 	_cursor.animate_timeout = 0;
@@ -1962,7 +1962,7 @@
 	SetCursorSprite(cursor);
 }
 
-void SetAnimatedMouseCursor(const uint16 *table)
+void SetAnimatedMouseCursor(const CursorID *table)
 {
 	_cursor.animate_list = table;
 	_cursor.animate_cur = NULL;
--- a/gfx.h	Mon Jun 06 13:11:35 2005 +0000
+++ b/gfx.h	Mon Jun 06 13:47:06 2005 +0000
@@ -20,10 +20,10 @@
 typedef struct CursorVars {
 	Point pos, size, offs, delta;
 	Point draw_pos, draw_size;
-	uint32 sprite;
+	CursorID sprite;
 
 	int wheel; // mouse wheel movement
-	const uint16 *animate_list, *animate_cur;
+	const CursorID *animate_list, *animate_cur;
 	uint animate_timeout;
 
 	bool visible;
@@ -60,7 +60,7 @@
 void DrawOverlappedWindowForAll(int left, int top, int right, int bottom);
 
 void SetMouseCursor(uint cursor);
-void SetAnimatedMouseCursor(const uint16 *table);
+void SetAnimatedMouseCursor(const CursorID *table);
 void CursorTick(void);
 void DrawMouseCursor(void);
 void ScreenSizeChanged(void);
--- a/industry_gui.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/industry_gui.c	Mon Jun 06 13:47:06 2005 +0000
@@ -3,6 +3,7 @@
 #include "debug.h"
 #include "strings.h"
 #include "table/strings.h"
+#include "table/sprites.h"
 #include "map.h"
 #include "gui.h"
 #include "window.h"
@@ -35,7 +36,7 @@
 	case WE_CLICK: {
 		int wid = e->click.widget;
 		if (wid >= 3) {
-			if (HandlePlacePushButton(w, wid, 0xFF1, 1, NULL))
+			if (HandlePlacePushButton(w, wid, SPR_CURSOR_INDUSTRY, 1, NULL))
 				WP(w,def_d).data_1 = wid - 3;
 		}
 	} break;
--- a/main_gui.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/main_gui.c	Mon Jun 06 13:47:06 2005 +0000
@@ -122,7 +122,7 @@
  * @return true if the button is clicked, false if it's unclicked
  */
 
-bool HandlePlacePushButton(Window *w, int widget, uint32 cursor, int mode, PlaceProc *placeproc)
+bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, int mode, PlaceProc *placeproc)
 {
 	uint32 mask = 1 << widget;
 
@@ -406,10 +406,10 @@
 
 static void SelectSignTool(void)
 {
-	if (_cursor.sprite == 0x2D2)
+	if (_cursor.sprite == SPR_CURSOR_SIGN)
 		ResetObjectToPlace();
 	else {
-		SetObjectToPlace(0x2D2, 1, 1, 0);
+		SetObjectToPlace(SPR_CURSOR_SIGN, 1, 1, 0);
 		_place_proc = PlaceProc_Sign;
 	}
 }
@@ -1713,7 +1713,7 @@
 		}
 
 		if ((button=e->click.widget) >= 4) {
-			if (HandlePlacePushButton(w, button, 0xFF1, 1, NULL))
+			if (HandlePlacePushButton(w, button, SPR_CURSOR_INDUSTRY, 1, NULL))
 				_industry_type_to_place = _industry_type_list[_opt.landscape][button - 4];
 		}
 		break;
--- a/misc.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/misc.c	Mon Jun 06 13:47:06 2005 +0000
@@ -3,6 +3,7 @@
 #include "string.h"
 #include "strings.h" // XXX GetParam*
 #include "table/strings.h"
+#include "table/sprites.h"
 #include "map.h"
 #include "vehicle.h"
 #include "gfx.h"
@@ -208,7 +209,7 @@
 
 	AddTypeToEngines(); // make sure all engines have a type
 
-	SetObjectToPlace(1, 0, 0, 0);
+	SetObjectToPlace(SPR_CURSOR_ZZZ, 0, 0, 0);
 
 	_pause = 0;
 	_fast_forward = 0;
@@ -270,7 +271,7 @@
 
 	_generating_world = true;
 	InitializeGame(log_x, log_y);
-	SetObjectToPlace(1, 0, 0, 0);
+	SetObjectToPlace(SPR_CURSOR_ZZZ, 0, 0, 0);
 
 	// Must start economy early because of the costs.
 	StartupEconomy();
--- a/misc_gui.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/misc_gui.c	Mon Jun 06 13:47:06 2005 +0000
@@ -161,11 +161,11 @@
 
 void PlaceLandBlockInfo(void)
 {
-	if (_cursor.sprite == 0x2CF) {
+	if (_cursor.sprite == SPR_CURSOR_QUERY) {
 		ResetObjectToPlace();
 	} else {
 		_place_proc = Place_LandInfo;
-		SetObjectToPlace(0x2CF, 1, 1, 0);
+		SetObjectToPlace(SPR_CURSOR_QUERY, 1, 1, 0);
 	}
 }
 
@@ -317,12 +317,12 @@
 			if ( (uint)(wid-3) >= (uint)WP(w,tree_d).count)
 				return;
 
-			if (HandlePlacePushButton(w, wid, 0x7DA, 1, NULL))
+			if (HandlePlacePushButton(w, wid, SPR_CURSOR_TREE, 1, NULL))
 				_tree_to_plant = WP(w,tree_d).base + wid - 3;
 			break;
 
 		case 15: // tree of random type.
-			if (HandlePlacePushButton(w, 15, 0x7DA, 1, NULL))
+			if (HandlePlacePushButton(w, 15, SPR_CURSOR_TREE, 1, NULL))
 				_tree_to_plant = -1;
 			break;
 
@@ -1389,7 +1389,7 @@
 {
 	Window *w;
 
-	SetObjectToPlace(1, 0, 0, 0);
+	SetObjectToPlace(SPR_CURSOR_ZZZ, 0, 0, 0);
 	DeleteWindowById(WC_QUERY_STRING, 0);
 	DeleteWindowById(WC_SAVELOAD, 0);
 
--- a/openttd.h	Mon Jun 06 13:11:35 2005 +0000
+++ b/openttd.h	Mon Jun 06 13:47:06 2005 +0000
@@ -71,6 +71,7 @@
 typedef uint16 StringID;
 typedef uint16 SpriteID;
 typedef uint32 PalSpriteID;
+typedef uint32 CursorID;
 
 typedef uint32 WindowNumber;
 typedef byte WindowClass;
--- a/player_gui.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/player_gui.c	Mon Jun 06 13:47:06 2005 +0000
@@ -593,7 +593,7 @@
 			if (tile == 0) {
 				if ((byte)w->window_number != _local_player)
 					return;
-				SetObjectToPlaceWnd(0x2D0, 1, w);
+				SetObjectToPlaceWnd(SPR_CURSOR_HQ, 1, w);
 				SetTileSelectSize(2, 2);
 			} else {
 				ScrollMainWindowToTile(tile);
@@ -601,7 +601,7 @@
 		} break;
 
 		case 8: /* relocate HQ */
-			SetObjectToPlaceWnd(0x2D0, 1, w);
+			SetObjectToPlaceWnd(SPR_CURSOR_HQ, 1, w);
 			SetTileSelectSize(2, 2);
 			break;
 		case 9: /* buy 25% */
--- a/rail_gui.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/rail_gui.c	Mon Jun 06 13:47:06 2005 +0000
@@ -214,27 +214,27 @@
 
 static void BuildRailClick_N(Window *w)
 {
-	HandlePlacePushButton(w, 4, _cur_railtype*4 + 0x4EF, 1, PlaceRail_N);
+	HandlePlacePushButton(w, 4, _cur_railtype*4 + SPR_CURSOR_NS_TRACK, 1, PlaceRail_N);
 }
 
 static void BuildRailClick_NE(Window *w)
 {
-	HandlePlacePushButton(w, 5, _cur_railtype*4 + 0x4F0, 1, PlaceRail_NE);
+	HandlePlacePushButton(w, 5, _cur_railtype*4 + SPR_CURSOR_SWNE_TRACK, 1, PlaceRail_NE);
 }
 
 static void BuildRailClick_E(Window *w)
 {
-	HandlePlacePushButton(w, 6, _cur_railtype*4 + 0x4F1, 1, PlaceRail_E);
+	HandlePlacePushButton(w, 6, _cur_railtype*4 + SPR_CURSOR_EW_TRACK, 1, PlaceRail_E);
 }
 
 static void BuildRailClick_NW(Window *w)
 {
-	HandlePlacePushButton(w, 7, _cur_railtype*4 + 0x4F2, 1, PlaceRail_NW);
+	HandlePlacePushButton(w, 7, _cur_railtype*4 + SPR_CURSOR_NWSE_TRACK, 1, PlaceRail_NW);
 }
 
 static void BuildRailClick_AutoRail(Window *w)
 {
-	HandlePlacePushButton(w, 8, _cur_railtype + SPR_CURSOR_AUTORAIL, VHM_RAIL, PlaceRail_AutoRail);
+	HandlePlacePushButton(w, 8, SPR_CURSOR_AUTORAIL + _cur_railtype, VHM_RAIL, PlaceRail_AutoRail);
 }
 
 static void BuildRailClick_Demolish(Window *w)
@@ -242,10 +242,10 @@
 	HandlePlacePushButton(w, 9, ANIMCURSOR_DEMOLISH, 1, PlaceProc_DemolishArea);
 }
 
-static const SpriteID _depot_cursors[] = {
-	0x510,
-	SPR_OPENTTD_BASE + 14,
-	SPR_OPENTTD_BASE + 15,
+static const CursorID _depot_cursors[] = {
+	SPR_CURSOR_RAIL_DEPOT,
+	SPR_CURSOR_MONO_DEPOT,
+	SPR_CURSOR_MAGLEV_DEPOT,
 };
 
 static void BuildRailClick_Depot(Window *w)
@@ -256,14 +256,14 @@
 static void BuildRailClick_Waypoint(Window *w)
 {
 	_waypoint_count = GetCustomStationsCount(STAT_CLASS_WAYP);
-	if (HandlePlacePushButton(w, 11, SPR_OPENTTD_BASE + 7, 1, PlaceRail_Waypoint)
+	if (HandlePlacePushButton(w, 11, SPR_CURSOR_WAYPOINT, 1, PlaceRail_Waypoint)
 	    && _waypoint_count > 0)
 		ShowBuildWaypointPicker();
 }
 
 static void BuildRailClick_Station(Window *w)
 {
-	if (HandlePlacePushButton(w, 12, 0x514, 1, PlaceRail_Station)) ShowStationBuilder();
+	if (HandlePlacePushButton(w, 12, SPR_CURSOR_RAIL_STATION, 1, PlaceRail_Station)) ShowStationBuilder();
 }
 
 static void BuildRailClick_AutoSignals(Window *w)
@@ -273,12 +273,12 @@
 
 static void BuildRailClick_Bridge(Window *w)
 {
-	HandlePlacePushButton(w, 14, 0xA21, 1, PlaceRail_Bridge);
+	HandlePlacePushButton(w, 14, SPR_CURSOR_BRIDGE, 1, PlaceRail_Bridge);
 }
 
 static void BuildRailClick_Tunnel(Window *w)
 {
-	HandlePlacePushButton(w, 15, 0x982 + _cur_railtype, 3, PlaceRail_Tunnel);
+	HandlePlacePushButton(w, 15, SPR_CURSOR_TUNNEL_RAIL + _cur_railtype, 3, PlaceRail_Tunnel);
 }
 
 static void BuildRailClick_Remove(Window *w)
@@ -304,7 +304,7 @@
 
 static void BuildRailClick_Convert(Window *w)
 {
-	HandlePlacePushButton(w, 17, (SPR_OPENTTD_BASE + 26) + _cur_railtype * 2, 1, PlaceRail_ConvertRail);
+	HandlePlacePushButton(w, 17, SPR_CURSOR_CONVERT_RAIL + _cur_railtype * 2, 1, PlaceRail_ConvertRail);
 }
 
 static void BuildRailClick_Landscaping(Window *w)
--- a/road_gui.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/road_gui.c	Mon Jun 06 13:47:06 2005 +0000
@@ -108,13 +108,13 @@
 static void BuildRoadClick_NE(Window *w)
 {
 	_build_road_flag = 0;
-	HandlePlacePushButton(w, 3, 0x51F, 1, PlaceRoad_NE);
+	HandlePlacePushButton(w, 3, SPR_CURSOR_ROAD_NESW, 1, PlaceRoad_NE);
 }
 
 static void BuildRoadClick_NW(Window *w)
 {
 	_build_road_flag = 0;
-	HandlePlacePushButton(w, 4, 0x520, 1, PlaceRoad_NW);
+	HandlePlacePushButton(w, 4, SPR_CURSOR_ROAD_NWSE, 1, PlaceRoad_NW);
 }
 
 
@@ -126,31 +126,31 @@
 static void BuildRoadClick_Depot(Window *w)
 {
 	if (_game_mode == GM_EDITOR) return;
-	if (HandlePlacePushButton(w, 6, 0x511, 1, PlaceRoad_Depot)) ShowRoadDepotPicker();
+	if (HandlePlacePushButton(w, 6, SPR_CURSOR_ROAD_DEPOT, 1, PlaceRoad_Depot)) ShowRoadDepotPicker();
 }
 
 static void BuildRoadClick_BusStation(Window *w)
 {
 	if (_game_mode == GM_EDITOR) return;
-	if (HandlePlacePushButton(w, 7, 0xAA5, 1, PlaceRoad_BusStation)) ShowBusStationPicker();
+	if (HandlePlacePushButton(w, 7, SPR_CURSOR_BUS_STATION, 1, PlaceRoad_BusStation)) ShowBusStationPicker();
 }
 
 static void BuildRoadClick_TruckStation(Window *w)
 {
 	if (_game_mode == GM_EDITOR) return;
-	if (HandlePlacePushButton(w, 8, 0xAA6, 1, PlaceRoad_TruckStation)) ShowTruckStationPicker();
+	if (HandlePlacePushButton(w, 8, SPR_CURSOR_TRUCK_STATION, 1, PlaceRoad_TruckStation)) ShowTruckStationPicker();
 }
 
 static void BuildRoadClick_Bridge(Window *w)
 {
 	_build_road_flag = 0;
-	HandlePlacePushButton(w, 9, 0xA21, 1, PlaceRoad_Bridge);
+	HandlePlacePushButton(w, 9, SPR_CURSOR_BRIDGE, 1, PlaceRoad_Bridge);
 }
 
 static void BuildRoadClick_Tunnel(Window *w)
 {
 	_build_road_flag = 0;
-	HandlePlacePushButton(w, 10, 0x981, 3, PlaceRoad_Tunnel);
+	HandlePlacePushButton(w, 10, SPR_CURSOR_ROAD_TUNNEL, 3, PlaceRoad_Tunnel);
 }
 
 static void BuildRoadClick_Remove(Window *w)
--- a/saveload.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/saveload.c	Mon Jun 06 13:47:06 2005 +0000
@@ -837,7 +837,7 @@
 	uint count;
 	bool ff_state;
 	bool saveinprogress;
-	uint32 cursor;
+	CursorID cursor;
 } ThreadedSave;
 
 /* A maximum size of of 128K * 500 = 64.000KB savegames */
--- a/table/animcursors.h	Mon Jun 06 13:11:35 2005 +0000
+++ b/table/animcursors.h	Mon Jun 06 13:47:06 2005 +0000
@@ -1,7 +1,7 @@
 #define ANIM_CURSOR_LINE(a,b) a,b,
 #define ANIM_CURSOR_END() 0xFFFF
 
-static const uint16 _demolish_animcursor[] = {
+static const CursorID _demolish_animcursor[] = {
 	ANIM_CURSOR_LINE(0x2C0, 29)
 	ANIM_CURSOR_LINE(0x2C1, 29)
 	ANIM_CURSOR_LINE(0x2C2, 29)
@@ -9,34 +9,34 @@
 	ANIM_CURSOR_END()
 };
 
-static const uint16 _lower_land_animcursor[] = {
+static const CursorID _lower_land_animcursor[] = {
 	ANIM_CURSOR_LINE(0x2BB, 29)
 	ANIM_CURSOR_LINE(0x2BC, 29)
 	ANIM_CURSOR_LINE(0x2BD, 98)
 	ANIM_CURSOR_END()
 };
 
-static const uint16 _raise_land_animcursor[] = {
+static const CursorID _raise_land_animcursor[] = {
 	ANIM_CURSOR_LINE(0x2B8, 29)
 	ANIM_CURSOR_LINE(0x2B9, 29)
 	ANIM_CURSOR_LINE(0x2BA, 98)
 	ANIM_CURSOR_END()
 };
 
-static const uint16 _pick_station_animcursor[] = {
+static const CursorID _pick_station_animcursor[] = {
 	ANIM_CURSOR_LINE(0x2CC, 29)
 	ANIM_CURSOR_LINE(0x2CD, 29)
 	ANIM_CURSOR_LINE(0x2CE, 98)
 	ANIM_CURSOR_END()
 };
 
-static const uint16 _build_signals_animcursor[] = {
+static const CursorID _build_signals_animcursor[] = {
 	ANIM_CURSOR_LINE(0x50C, 148)
 	ANIM_CURSOR_LINE(0x50D, 148)
 	ANIM_CURSOR_END()
 };
 
-static const uint16 * const _animcursors[] = {
+static const CursorID * const _animcursors[] = {
 	_demolish_animcursor,
 	_lower_land_animcursor,
 	_raise_land_animcursor,
--- a/terraform_gui.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/terraform_gui.c	Mon Jun 06 13:47:06 2005 +0000
@@ -135,27 +135,27 @@
 
 static void TerraformClick_Level(Window *w)
 {
-	HandlePlacePushButton(w, 6, SPR_OPENTTD_BASE+69, 2, PlaceProc_LevelLand);
+	HandlePlacePushButton(w, 6, ANIMCURSOR_LOWERLAND, 2, PlaceProc_LevelLand);
 }
 
 static void TerraformClick_Dynamite(Window *w)
 {
-	HandlePlacePushButton(w, 7, SPR_IMG_DYNAMITE+1 , 1, PlaceProc_DemolishArea);
+	HandlePlacePushButton(w, 7, ANIMCURSOR_DEMOLISH , 1, PlaceProc_DemolishArea);
 }
 
 static void TerraformClick_BuyLand(Window *w)
 {
-	HandlePlacePushButton(w, 8, 4792, 1, PlaceProc_BuyLand);
+	HandlePlacePushButton(w, 8, SPR_CURSOR_BUY_LAND, 1, PlaceProc_BuyLand);
 }
 
 static void TerraformClick_Trees(Window *w)
 {
-	if (HandlePlacePushButton(w, 9, 0, 1, PlaceProc_PlantTree)) ShowBuildTreesToolbar();
+	if (HandlePlacePushButton(w, 9, SPR_CURSOR_MOUSE, 1, PlaceProc_PlantTree)) ShowBuildTreesToolbar();
 }
 
 static void TerraformClick_PlaceSign(Window *w)
 {
-	HandlePlacePushButton(w, 10, 722, 1, PlaceProc_Sign);
+	HandlePlacePushButton(w, 10, SPR_CURSOR_SIGN, 1, PlaceProc_Sign);
 }
 
 static OnButtonClick * const _terraform_button_proc[] = {
--- a/viewport.c	Mon Jun 06 13:11:35 2005 +0000
+++ b/viewport.c	Mon Jun 06 13:47:06 2005 +0000
@@ -2176,14 +2176,14 @@
 	return false;
 }
 
-void SetObjectToPlaceWnd(int icon, byte mode, Window *w)
+void SetObjectToPlaceWnd(CursorID icon, byte mode, Window *w)
 {
-	SetObjectToPlace(icon,mode,w->window_class, w->window_number);
+	SetObjectToPlace(icon, mode, w->window_class, w->window_number);
 }
 
 #include "table/animcursors.h"
 
-void SetObjectToPlace(int icon, byte mode, WindowClass window_class, WindowNumber window_num)
+void SetObjectToPlace(CursorID icon, byte mode, WindowClass window_class, WindowNumber window_num)
 {
 	Window *w;
 
@@ -2221,5 +2221,5 @@
 
 void ResetObjectToPlace(void)
 {
-	SetObjectToPlace(0,0,0,0);
+	SetObjectToPlace(SPR_CURSOR_MOUSE, 0, 0, 0);
 }