summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-06-06 13:47:06 +0000
committerDarkvater <darkvater@openttd.org>2005-06-06 13:47:06 +0000
commit5fed47964e28c49f7af879700d013f2897341f4e (patch)
treeac935893726bc7005c7c5ad7d411354e5b8cc0f9
parent71c2a573e193b0e4530cee49e02148320c84c612 (diff)
downloadopenttd-5fed47964e28c49f7af879700d013f2897341f4e.tar.xz
(svn r2420) - Codechange: magic number elminitation of cursorsprites.
-rw-r--r--airport_gui.c2
-rw-r--r--dock_gui.c10
-rw-r--r--functions.h4
-rw-r--r--gfx.c16
-rw-r--r--gfx.h6
-rw-r--r--industry_gui.c3
-rw-r--r--main_gui.c8
-rw-r--r--misc.c5
-rw-r--r--misc_gui.c10
-rw-r--r--openttd.h1
-rw-r--r--player_gui.c4
-rw-r--r--rail_gui.c28
-rw-r--r--road_gui.c14
-rw-r--r--saveload.c2
-rw-r--r--table/animcursors.h12
-rw-r--r--terraform_gui.c10
-rw-r--r--viewport.c8
17 files changed, 73 insertions, 70 deletions
diff --git a/airport_gui.c b/airport_gui.c
index b2c696a4b..b77669f2d 100644
--- a/airport_gui.c
+++ b/airport_gui.c
@@ -40,7 +40,7 @@ static void PlaceAir_DemolishArea(uint tile)
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)
diff --git a/dock_gui.c b/dock_gui.c
index c705b1a82..a150a70e9 100644
--- a/dock_gui.c
+++ b/dock_gui.c
@@ -63,12 +63,12 @@ static void PlaceDocks_BuildLock(uint tile)
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_Demolish(Window *w)
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)
diff --git a/functions.h b/functions.h
index 40604e295..ab4fcec75 100644
--- a/functions.h
+++ b/functions.h
@@ -177,8 +177,8 @@ void InvalidateWindowClasses(byte cls);
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);
diff --git a/gfx.c b/gfx.c
index 346f4c71d..33e816c6e 100644
--- a/gfx.c
+++ b/gfx.c
@@ -1913,7 +1913,7 @@ bool FillDrawPixelInfo(DrawPixelInfo *n, DrawPixelInfo *o, int left, int top, in
return true;
}
-static void SetCursorSprite(uint cursor)
+static void SetCursorSprite(CursorID cursor)
{
CursorVars *cv = &_cursor;
const Sprite *p;
@@ -1934,12 +1934,12 @@ static void SetCursorSprite(uint cursor)
static void SwitchAnimatedCursor(void)
{
CursorVars *cv = &_cursor;
- const uint16 *cur;
- uint sprite;
+ const CursorID *cur = cv->animate_cur;
+ CursorID sprite;
+
+ // ANIM_CURSOR_END is 0xFFFF in table/animcursors.h
+ if (cur == NULL || *cur == 0xFFFF) cur = cv->animate_list;
- cur = cv->animate_cur;
- 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 @@ void CursorTick(void)
SwitchAnimatedCursor();
}
-void SetMouseCursor(uint cursor)
+void SetMouseCursor(CursorID cursor)
{
// Turn off animation
_cursor.animate_timeout = 0;
@@ -1962,7 +1962,7 @@ void SetMouseCursor(uint cursor)
SetCursorSprite(cursor);
}
-void SetAnimatedMouseCursor(const uint16 *table)
+void SetAnimatedMouseCursor(const CursorID *table)
{
_cursor.animate_list = table;
_cursor.animate_cur = NULL;
diff --git a/gfx.h b/gfx.h
index 2572ddea0..b56b28ef2 100644
--- a/gfx.h
+++ b/gfx.h
@@ -20,10 +20,10 @@ struct DrawPixelInfo {
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 @@ bool FillDrawPixelInfo(DrawPixelInfo *n, DrawPixelInfo *o, int left, int top, in
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);
diff --git a/industry_gui.c b/industry_gui.c
index 4776ea97f..4aa833188 100644
--- a/industry_gui.c
+++ b/industry_gui.c
@@ -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 @@ static void BuildIndustryWndProc(Window *w, WindowEvent *e)
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;
diff --git a/main_gui.c b/main_gui.c
index 08c790e39..fa8495f64 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -122,7 +122,7 @@ void HandleOnEditText(WindowEvent *e)
* @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 @@ void ShowRenameWaypointWindow(Waypoint *wp)
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 @@ static void ScenEditIndustryWndProc(Window *w, WindowEvent *e)
}
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;
diff --git a/misc.c b/misc.c
index 4c88c8805..6ea0ce98a 100644
--- a/misc.c
+++ b/misc.c
@@ -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 @@ void InitializeGame(uint log_x, uint log_y)
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 @@ void GenerateWorld(int mode, uint log_x, uint log_y)
_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();
diff --git a/misc_gui.c b/misc_gui.c
index b737ee3c4..61ffc8377 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -161,11 +161,11 @@ static void Place_LandInfo(uint tile)
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 @@ static void BuildTreesWndProc(Window *w, WindowEvent *e)
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 @@ void ShowSaveLoadDialog(int mode)
{
Window *w;
- SetObjectToPlace(1, 0, 0, 0);
+ SetObjectToPlace(SPR_CURSOR_ZZZ, 0, 0, 0);
DeleteWindowById(WC_QUERY_STRING, 0);
DeleteWindowById(WC_SAVELOAD, 0);
diff --git a/openttd.h b/openttd.h
index 2764d0141..c77225b37 100644
--- a/openttd.h
+++ b/openttd.h
@@ -71,6 +71,7 @@ typedef byte CargoID;
typedef uint16 StringID;
typedef uint16 SpriteID;
typedef uint32 PalSpriteID;
+typedef uint32 CursorID;
typedef uint32 WindowNumber;
typedef byte WindowClass;
diff --git a/player_gui.c b/player_gui.c
index ceb21a605..b14e85ebf 100644
--- a/player_gui.c
+++ b/player_gui.c
@@ -593,7 +593,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e)
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 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e)
} break;
case 8: /* relocate HQ */
- SetObjectToPlaceWnd(0x2D0, 1, w);
+ SetObjectToPlaceWnd(SPR_CURSOR_HQ, 1, w);
SetTileSelectSize(2, 2);
break;
case 9: /* buy 25% */
diff --git a/rail_gui.c b/rail_gui.c
index 0d88dc50e..c3774ee77 100644
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -214,27 +214,27 @@ static void PlaceRail_AutoSignals(uint tile)
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 @@ static void BuildRailClick_Demolish(Window *w)
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_Depot(Window *w)
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_AutoSignals(Window *w)
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_Remove(Window *w)
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)
diff --git a/road_gui.c b/road_gui.c
index d2ab49ba2..b1c0bf3ef 100644
--- a/road_gui.c
+++ b/road_gui.c
@@ -108,13 +108,13 @@ typedef void OnButtonClick(Window *w);
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_Demolish(Window *w)
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)
diff --git a/saveload.c b/saveload.c
index c8ae632a6..a263dfee8 100644
--- a/saveload.c
+++ b/saveload.c
@@ -837,7 +837,7 @@ typedef struct ThreadedSave {
uint count;
bool ff_state;
bool saveinprogress;
- uint32 cursor;
+ CursorID cursor;
} ThreadedSave;
/* A maximum size of of 128K * 500 = 64.000KB savegames */
diff --git a/table/animcursors.h b/table/animcursors.h
index e43dfc1c8..ca9de3e1b 100644
--- a/table/animcursors.h
+++ b/table/animcursors.h
@@ -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 @@ static const uint16 _demolish_animcursor[] = {
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,
diff --git a/terraform_gui.c b/terraform_gui.c
index 738c3eb55..a0eed2314 100644
--- a/terraform_gui.c
+++ b/terraform_gui.c
@@ -135,27 +135,27 @@ static void TerraformClick_Raise(Window *w)
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[] = {
diff --git a/viewport.c b/viewport.c
index f1e7b5cca..1cd6a4f5c 100644
--- a/viewport.c
+++ b/viewport.c
@@ -2176,14 +2176,14 @@ bool VpHandlePlaceSizingDrag(void)
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 SetObjectToPlace(int icon, byte mode, WindowClass window_class, WindowNumbe
void ResetObjectToPlace(void)
{
- SetObjectToPlace(0,0,0,0);
+ SetObjectToPlace(SPR_CURSOR_MOUSE, 0, 0, 0);
}