1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix yellow arrow when closing construction window.

Small refactor of map selection globals.
Fixes #1062
This commit is contained in:
Duncan Frost
2015-05-17 08:49:39 +01:00
parent 328abd1d45
commit 0701bacc71
2 changed files with 17 additions and 8 deletions

View File

@@ -1913,8 +1913,8 @@ int sub_6D01B3(uint8 bl, uint8 rideIndex, int x, int y, int z)
//0x6D0FE6
if (RCT2_GLOBAL(0x00F440D4, uint8) == 0){
RCT2_GLOBAL(0x009DE58A, uint16) |= 0x6;
RCT2_GLOBAL(0x009DE58A, uint16) &= ~(1 << 3);
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) |= 0x6;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~(1 << 3);
map_invalidate_map_selection_tiles();
}
@@ -2587,8 +2587,8 @@ int maze_ride_to_td6(uint8 rideIndex, rct_track_td6* track_design, uint8* track_
// no need since global vars not used
sub_6D01B3(0, 0, 4096, 4096, 0);
RCT2_GLOBAL(0x009DE58A, sint16) &= 0xFFF9;
RCT2_GLOBAL(0x009DE58A, sint16) &= 0xFFF7;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, sint16) &= 0xFFF9;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, sint16) &= 0xFFF7;
x = RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_X_MAX, sint16) -
RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_X_MIN, sint16);
@@ -2846,8 +2846,8 @@ int tracked_ride_to_td6(uint8 rideIndex, rct_track_td6* track_design, uint8* tra
RCT2_GLOBAL(0x00F44144, sint16) = start_y;
RCT2_GLOBAL(0x00F44146, sint16) = start_z;
RCT2_GLOBAL(0x009DE58A, sint16) &= 0xFFF9;
RCT2_GLOBAL(0x009DE58A, sint16) &= 0xFFF7;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, sint16) &= 0xFFF9;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, sint16) &= 0xFFF7;
x = RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_X_MAX, sint16) -
RCT2_GLOBAL(RCT2_ADDRESS_TRACK_PREVIEW_X_MIN, sint16);

View File

@@ -203,6 +203,7 @@ rct_window *window_construction_open()
return w;
}
/* rct2: 0x006C845D */
void window_construction_close()
{
rct_window *w;
@@ -214,7 +215,11 @@ void window_construction_close()
viewport_set_visibility(0);
map_invalidate_map_selection_tiles();
RCT2_GLOBAL(0x9DE58A, uint16) &= 0xFFFD;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~(1 << 1);
// In order to cancel the yellow arrow correctly the
// selection tool should be cancelled.
tool_cancel();
hide_gridlines();
@@ -242,7 +247,11 @@ void window_construction_maze_close(){
viewport_set_visibility(0);
map_invalidate_map_selection_tiles();
RCT2_GLOBAL(0x9DE58A, uint16) &= 0xFFFD;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~(1 << 1);
// In order to cancel the yellow arrow correctly the
// selection tool should be cancelled.
tool_cancel();
hide_gridlines();