summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskidd13 <skidd13@openttd.org>2007-11-17 01:10:06 +0000
committerskidd13 <skidd13@openttd.org>2007-11-17 01:10:06 +0000
commit9b4252bd62ccc223bd7a8bcb32a3cd2e36a85980 (patch)
tree4480571480db8b34e5b9c851086429874c85d98d /src
parentc8516f2af839d84348f23f90d6e34049e8c1d330 (diff)
downloadopenttd-9b4252bd62ccc223bd7a8bcb32a3cd2e36a85980.tar.xz
(svn r11446) -Codechange: change the naming of road related code parts to something more descriptive
-Change: invert the two single roads gui buttons, making it consistent with rails toolbar Based on a patch by Octopussy
Diffstat (limited to 'src')
-rw-r--r--src/gui.h4
-rw-r--r--src/road_gui.cpp60
-rw-r--r--src/table/sprites.h8
3 files changed, 36 insertions, 36 deletions
diff --git a/src/gui.h b/src/gui.h
index 2e098e666..4b189804b 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -86,8 +86,8 @@ enum {
DDSP_CONVERT_RAIL,
/* Road specific actions */
- DDSP_PLACE_ROAD_NE,
- DDSP_PLACE_ROAD_NW,
+ DDSP_PLACE_ROAD_X_DIR,
+ DDSP_PLACE_ROAD_Y_DIR,
DDSP_PLACE_AUTOROAD,
};
diff --git a/src/road_gui.cpp b/src/road_gui.cpp
index 9981dc99a..0be5a0355 100644
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -60,31 +60,31 @@ void CcPlaySound1D(bool success, TileIndex tile, uint32 p1, uint32 p2)
/**
* Set the initial flags for the road constuction.
* The flags are:
- * @li The direction is the Y-dir
+ * @li The direction is the X-dir
* @li The first tile has a partitial RoadBit (true or false)
*
* @param tile The start tile
*/
-static void PlaceRoad_NE(TileIndex tile)
+static void PlaceRoad_X_Dir(TileIndex tile)
{
- _place_road_flag = RF_DIR_Y;
- if (_tile_fract_coords.y >= 8) _place_road_flag |= RF_START_HALFROAD_Y;
- VpStartPlaceSizing(tile, VPM_FIX_X, DDSP_PLACE_ROAD_NE);
+ _place_road_flag = RF_DIR_X;
+ if (_tile_fract_coords.x >= 8) _place_road_flag |= RF_START_HALFROAD_X;
+ VpStartPlaceSizing(tile, VPM_FIX_Y, DDSP_PLACE_ROAD_X_DIR);
}
/**
* Set the initial flags for the road constuction.
* The flags are:
- * @li The direction is the X-dir
+ * @li The direction is the Y-dir
* @li The first tile has a partitial RoadBit (true or false)
*
* @param tile The start tile
*/
-static void PlaceRoad_NW(TileIndex tile)
+static void PlaceRoad_Y_Dir(TileIndex tile)
{
- _place_road_flag = RF_DIR_X;
- if (_tile_fract_coords.x >= 8) _place_road_flag |= RF_START_HALFROAD_X;
- VpStartPlaceSizing(tile, VPM_FIX_Y, DDSP_PLACE_ROAD_NW);
+ _place_road_flag = RF_DIR_Y;
+ if (_tile_fract_coords.y >= 8) _place_road_flag |= RF_START_HALFROAD_Y;
+ VpStartPlaceSizing(tile, VPM_FIX_X, DDSP_PLACE_ROAD_Y_DIR);
}
/**
@@ -257,9 +257,9 @@ typedef void OnButtonClick(Window *w);
*
* @param w The current window
*/
-static void BuildRoadClick_NE(Window *w)
+static void BuildRoadClick_X_Dir(Window *w)
{
- HandlePlacePushButton(w, RTW_ROAD_X, _road_type_infos[_cur_roadtype].cursor_nesw, VHM_RECT, PlaceRoad_NE);
+ HandlePlacePushButton(w, RTW_ROAD_X, _road_type_infos[_cur_roadtype].cursor_nwse, VHM_RECT, PlaceRoad_X_Dir);
}
/**
@@ -268,9 +268,9 @@ static void BuildRoadClick_NE(Window *w)
*
* @param w The current window
*/
-static void BuildRoadClick_NW(Window *w)
+static void BuildRoadClick_Y_Dir(Window *w)
{
- HandlePlacePushButton(w, RTW_ROAD_Y, _road_type_infos[_cur_roadtype].cursor_nwse, VHM_RECT, PlaceRoad_NW);
+ HandlePlacePushButton(w, RTW_ROAD_Y, _road_type_infos[_cur_roadtype].cursor_nesw, VHM_RECT, PlaceRoad_Y_Dir);
}
/**
@@ -328,8 +328,8 @@ static void BuildRoadClick_Remove(Window *w)
/** Array with the handlers of the button-clicks for the road-toolbar */
static OnButtonClick* const _build_road_button_proc[] = {
- BuildRoadClick_NE,
- BuildRoadClick_NW,
+ BuildRoadClick_X_Dir,
+ BuildRoadClick_Y_Dir,
BuildRoadClick_AutoRoad,
BuildRoadClick_Demolish,
BuildRoadClick_Depot,
@@ -446,16 +446,16 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e)
* At first we reset the end halfroad
* bits and if needed we set them again. */
switch (e->we.place.select_proc) {
- case DDSP_PLACE_ROAD_NE:
- _place_road_flag &= ~RF_END_HALFROAD_Y;
- if (e->we.place.pt.y & 8) _place_road_flag |= RF_END_HALFROAD_Y;
- break;
-
- case DDSP_PLACE_ROAD_NW:
+ case DDSP_PLACE_ROAD_X_DIR:
_place_road_flag &= ~RF_END_HALFROAD_X;
if (e->we.place.pt.x & 8) _place_road_flag |= RF_END_HALFROAD_X;
break;
+ case DDSP_PLACE_ROAD_Y_DIR:
+ _place_road_flag &= ~RF_END_HALFROAD_Y;
+ if (e->we.place.pt.y & 8) _place_road_flag |= RF_END_HALFROAD_Y;
+ break;
+
case DDSP_PLACE_AUTOROAD:
_place_road_flag &= ~(RF_END_HALFROAD_Y | RF_END_HALFROAD_X);
if (e->we.place.pt.y & 8) _place_road_flag |= RF_END_HALFROAD_Y;
@@ -494,8 +494,8 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e)
DoCommandP(end_tile, start_tile, 0, CcPlaySound10, CMD_CLEAR_AREA | CMD_MSG(STR_00B5_CAN_T_CLEAR_THIS_AREA));
break;
- case DDSP_PLACE_ROAD_NE:
- case DDSP_PLACE_ROAD_NW:
+ case DDSP_PLACE_ROAD_X_DIR:
+ case DDSP_PLACE_ROAD_Y_DIR:
case DDSP_PLACE_AUTOROAD:
/* Flag description:
* Use the first three bits (0x07) if dir == Y
@@ -532,8 +532,8 @@ static const Widget _build_road_widgets[] = {
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 227, 0, 13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // RTW_CAPTION
{ WWT_STICKYBOX, RESIZE_NONE, 7, 228, 239, 0, 13, 0x0, STR_STICKY_BUTTON}, // RTW_STICKY
-{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_ROAD_NW, STR_180B_BUILD_ROAD_SECTION}, // RTW_ROAD_X
-{ WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_ROAD_NE, STR_180B_BUILD_ROAD_SECTION}, // RTW_ROAD_Y
+{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_ROAD_X_DIR, STR_180B_BUILD_ROAD_SECTION}, // RTW_ROAD_X
+{ WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_ROAD_Y_DIR, STR_180B_BUILD_ROAD_SECTION}, // RTW_ROAD_Y
{ WWT_IMGBTN, RESIZE_NONE, 7, 44, 65, 14, 35, SPR_IMG_AUTOROAD, STR_BUILD_AUTOROAD_TIP}, // RTW_AUTOROAD
{ WWT_IMGBTN, RESIZE_NONE, 7, 66, 87, 14, 35, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC}, // RTW_DEMOLISH
{ WWT_IMGBTN, RESIZE_NONE, 7, 88, 109, 14, 35, SPR_IMG_ROAD_DEPOT, STR_180C_BUILD_ROAD_VEHICLE_DEPOT}, // RTW_DEPOT
@@ -560,8 +560,8 @@ static const Widget _build_tramway_widgets[] = {
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 227, 0, 13, STR_1802_TRAMWAY_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // RTW_CAPTION
{ WWT_STICKYBOX, RESIZE_NONE, 7, 228, 239, 0, 13, 0x0, STR_STICKY_BUTTON}, // RTW_STICKY
-{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_TRAMWAY_NW, STR_180B_BUILD_TRAMWAY_SECTION}, // RTW_ROAD_X
-{ WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_TRAMWAY_NE, STR_180B_BUILD_TRAMWAY_SECTION}, // RTW_ROAD_Y
+{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_TRAMWAY_X_DIR, STR_180B_BUILD_TRAMWAY_SECTION}, // RTW_ROAD_X
+{ WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_TRAMWAY_Y_DIR, STR_180B_BUILD_TRAMWAY_SECTION}, // RTW_ROAD_Y
{ WWT_IMGBTN, RESIZE_NONE, 7, 44, 65, 14, 35, SPR_IMG_AUTOTRAM, STR_BUILD_AUTOTRAM_TIP}, // RTW_AUTOROAD
{ WWT_IMGBTN, RESIZE_NONE, 7, 66, 87, 14, 35, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC}, // RTW_DEMOLISH
{ WWT_IMGBTN, RESIZE_NONE, 7, 88, 109, 14, 35, SPR_IMG_ROAD_DEPOT, STR_180C_BUILD_TRAM_VEHICLE_DEPOT}, // RTW_DEPOT
@@ -598,8 +598,8 @@ static const Widget _build_road_scen_widgets[] = {
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 161, 0, 13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // RTW_CAPTION
{ WWT_STICKYBOX, RESIZE_NONE, 7, 162, 173, 0, 13, 0x0, STR_STICKY_BUTTON}, // RTW_STICKY
-{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_ROAD_NW, STR_180B_BUILD_ROAD_SECTION}, // RTW_ROAD_X
-{ WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_ROAD_NE, STR_180B_BUILD_ROAD_SECTION}, // RTW_ROAD_Y
+{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_ROAD_X_DIR, STR_180B_BUILD_ROAD_SECTION}, // RTW_ROAD_X
+{ WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_ROAD_Y_DIR, STR_180B_BUILD_ROAD_SECTION}, // RTW_ROAD_Y
{ WWT_IMGBTN, RESIZE_NONE, 7, 44, 65, 14, 35, SPR_IMG_AUTOROAD, STR_BUILD_AUTOROAD_TIP}, // RTW_AUTOROAD
{ WWT_IMGBTN, RESIZE_NONE, 7, 66, 87, 14, 35, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC}, // RTW_DEMOLISH
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, // RTW_DEPOT
diff --git a/src/table/sprites.h b/src/table/sprites.h
index 53caede35..978e716b6 100644
--- a/src/table/sprites.h
+++ b/src/table/sprites.h
@@ -1229,8 +1229,8 @@ enum Sprites {
SPR_IMG_PLAY_MUSIC = 712,
/* road_gui.c */
- SPR_IMG_ROAD_NW = 1309,
- SPR_IMG_ROAD_NE = 1310,
+ SPR_IMG_ROAD_Y_DIR = 1309,
+ SPR_IMG_ROAD_X_DIR = 1310,
SPR_IMG_AUTOROAD = SPR_OPENTTD_BASE + 82,
SPR_IMG_ROAD_DEPOT = 1295,
SPR_IMG_BUS_STATION = 749,
@@ -1238,8 +1238,8 @@ enum Sprites {
SPR_IMG_BRIDGE = 2594,
SPR_IMG_ROAD_TUNNEL = 2429,
SPR_IMG_REMOVE = 714,
- SPR_IMG_TRAMWAY_NW = SPR_TRAMWAY_BASE + 0,
- SPR_IMG_TRAMWAY_NE = SPR_TRAMWAY_BASE + 1,
+ SPR_IMG_TRAMWAY_Y_DIR = SPR_TRAMWAY_BASE + 0,
+ SPR_IMG_TRAMWAY_X_DIR = SPR_TRAMWAY_BASE + 1,
SPR_IMG_AUTOTRAM = SPR_OPENTTD_BASE + 84,
/* rail_gui.c */