mirror of https://github.com/OpenTTD/OpenTTD
(svn r11471) -Codechange: one more variable retyped to enum ViewportHighlightMode
parent
6097c07e4b
commit
2686901d84
|
@ -414,7 +414,7 @@ static void DepotClick(Window *w, int x, int y)
|
||||||
int mode = GetVehicleFromDepotWndPt(w, x, y, &v, &gdvp);
|
int mode = GetVehicleFromDepotWndPt(w, x, y, &v, &gdvp);
|
||||||
|
|
||||||
/* share / copy orders */
|
/* share / copy orders */
|
||||||
if (_thd.place_mode && mode <= 0) {
|
if (_thd.place_mode != VHM_NONE && mode <= 0) {
|
||||||
_place_clicked_vehicle = (WP(w, depot_d).type == VEH_TRAIN ? gdvp.head : v);
|
_place_clicked_vehicle = (WP(w, depot_d).type == VEH_TRAIN ? gdvp.head : v);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2270,6 +2270,10 @@ void UpdateTileSelection()
|
||||||
break;
|
break;
|
||||||
case VHM_RAIL:
|
case VHM_RAIL:
|
||||||
_thd.new_drawstyle = GetAutorailHT(pt.x, pt.y); // draw one highlighted tile
|
_thd.new_drawstyle = GetAutorailHT(pt.x, pt.y); // draw one highlighted tile
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
NOT_REACHED();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
_thd.new_pos.x = x1 & ~0xF;
|
_thd.new_pos.x = x1 & ~0xF;
|
||||||
_thd.new_pos.y = y1 & ~0xF;
|
_thd.new_pos.y = y1 & ~0xF;
|
||||||
|
@ -2826,8 +2830,8 @@ void SetObjectToPlace(CursorID icon, SpriteID pal, ViewportHighlightMode mode, W
|
||||||
Window *w;
|
Window *w;
|
||||||
|
|
||||||
/* undo clicking on button */
|
/* undo clicking on button */
|
||||||
if (_thd.place_mode != 0) {
|
if (_thd.place_mode != VHM_NONE) {
|
||||||
_thd.place_mode = 0;
|
_thd.place_mode = VHM_NONE;
|
||||||
w = FindWindowById(_thd.window_class, _thd.window_number);
|
w = FindWindowById(_thd.window_class, _thd.window_number);
|
||||||
if (w != NULL) CallWindowEventNP(w, WE_ABORT_PLACE_OBJ);
|
if (w != NULL) CallWindowEventNP(w, WE_ABORT_PLACE_OBJ);
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ enum ViewportPlaceMethod {
|
||||||
VPM_SIGNALDIRS = 6, ///< similiar to VMP_RAILDIRS, but with different cursor
|
VPM_SIGNALDIRS = 6, ///< similiar to VMP_RAILDIRS, but with different cursor
|
||||||
};
|
};
|
||||||
|
|
||||||
/* viewport highlight mode (for highlighting tiles below cursor) */
|
/** Viewport highlight mode (for highlighting tiles below cursor) */
|
||||||
enum ViewportHighlightMode {
|
enum ViewportHighlightMode {
|
||||||
VHM_NONE = 0, ///< default
|
VHM_NONE = 0, ///< default
|
||||||
VHM_RECT = 1, ///< rectangle (stations, depots, ...)
|
VHM_RECT = 1, ///< rectangle (stations, depots, ...)
|
||||||
|
@ -143,7 +143,7 @@ struct TileHighlightData {
|
||||||
byte new_drawstyle; // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new
|
byte new_drawstyle; // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new
|
||||||
byte next_drawstyle; // queued, but not yet drawn style
|
byte next_drawstyle; // queued, but not yet drawn style
|
||||||
|
|
||||||
byte place_mode;
|
ViewportHighlightMode place_mode;
|
||||||
bool make_square_red;
|
bool make_square_red;
|
||||||
WindowClass window_class;
|
WindowClass window_class;
|
||||||
WindowNumber window_number;
|
WindowNumber window_number;
|
||||||
|
|
|
@ -1772,7 +1772,7 @@ void MouseLoop(MouseClick click, int mousewheel)
|
||||||
case MC_DOUBLE_LEFT:
|
case MC_DOUBLE_LEFT:
|
||||||
case MC_LEFT:
|
case MC_LEFT:
|
||||||
DEBUG(misc, 2, "Cursor: 0x%X (%d)", _cursor.sprite, _cursor.sprite);
|
DEBUG(misc, 2, "Cursor: 0x%X (%d)", _cursor.sprite, _cursor.sprite);
|
||||||
if (_thd.place_mode != 0 &&
|
if (_thd.place_mode != VHM_NONE &&
|
||||||
/* query button and place sign button work in pause mode */
|
/* query button and place sign button work in pause mode */
|
||||||
_cursor.sprite != SPR_CURSOR_QUERY &&
|
_cursor.sprite != SPR_CURSOR_QUERY &&
|
||||||
_cursor.sprite != SPR_CURSOR_SIGN &&
|
_cursor.sprite != SPR_CURSOR_SIGN &&
|
||||||
|
@ -1781,7 +1781,7 @@ void MouseLoop(MouseClick click, int mousewheel)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_thd.place_mode == 0) {
|
if (_thd.place_mode == VHM_NONE) {
|
||||||
HandleViewportClicked(vp, x, y);
|
HandleViewportClicked(vp, x, y);
|
||||||
} else {
|
} else {
|
||||||
PlaceObject();
|
PlaceObject();
|
||||||
|
|
Loading…
Reference in New Issue