mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-18 20:43:04 +01:00
Added in HACK comments for future reference
This commit is contained in:
@@ -234,6 +234,9 @@ void sub_689174(sint16* x, sint16* y, sint16 *z, uint8 curr_rotation){
|
||||
*y = start_y + start_x / 2 + height;
|
||||
|
||||
height = map_element_height((0xFFFF) & *x, (0xFFFF) & *y);
|
||||
|
||||
// HACK: This is to prevent the x and y values being set to values outside
|
||||
// of the map. This can happen when the height is larger than the map size.
|
||||
if (*x > RCT2_GLOBAL(RCT2_ADDRESS_MAP_MAXIMUM_X_Y, sint16) && *y > RCT2_GLOBAL(RCT2_ADDRESS_MAP_MAXIMUM_X_Y, sint16)){
|
||||
*x = start_y - start_x / 2;
|
||||
*y = start_y + start_x / 2;
|
||||
@@ -246,6 +249,9 @@ void sub_689174(sint16* x, sint16* y, sint16 *z, uint8 curr_rotation){
|
||||
*y = start_y - start_x / 2 + height;
|
||||
|
||||
height = map_element_height((0xFFFF) & *x, (0xFFFF) & *y);
|
||||
|
||||
// HACK: This is to prevent the x and y values being set to values outside
|
||||
// of the map. This can happen when the height is larger than the map size.
|
||||
if (*x > RCT2_GLOBAL(RCT2_ADDRESS_MAP_MAXIMUM_X_Y, sint16) && *y > RCT2_GLOBAL(RCT2_ADDRESS_MAP_MAXIMUM_X_Y, sint16)){
|
||||
*x = -start_y - start_x / 2;
|
||||
*y = start_y - start_x / 2;
|
||||
@@ -258,6 +264,9 @@ void sub_689174(sint16* x, sint16* y, sint16 *z, uint8 curr_rotation){
|
||||
*y = -start_y - start_x / 2 - height;
|
||||
|
||||
height = map_element_height((0xFFFF) & *x, (0xFFFF) & *y);
|
||||
|
||||
// HACK: This is to prevent the x and y values being set to values outside
|
||||
// of the map. This can happen when the height is larger than the map size.
|
||||
if (*x > RCT2_GLOBAL(RCT2_ADDRESS_MAP_MAXIMUM_X_Y, sint16) && *y > RCT2_GLOBAL(RCT2_ADDRESS_MAP_MAXIMUM_X_Y, sint16)){
|
||||
*x = -start_y + start_x / 2;
|
||||
*y = -start_y - start_x / 2;
|
||||
@@ -270,6 +279,9 @@ void sub_689174(sint16* x, sint16* y, sint16 *z, uint8 curr_rotation){
|
||||
*y = start_x / 2 - start_y - height;
|
||||
|
||||
height = map_element_height((0xFFFF) & *x, (0xFFFF) & *y);
|
||||
|
||||
// HACK: This is to prevent the x and y values being set to values outside
|
||||
// of the map. This can happen when the height is larger than the map size.
|
||||
if (*x > RCT2_GLOBAL(RCT2_ADDRESS_MAP_MAXIMUM_X_Y, sint16) && *y > RCT2_GLOBAL(RCT2_ADDRESS_MAP_MAXIMUM_X_Y, sint16)){
|
||||
*x = start_y + start_x / 2;
|
||||
*y = -start_y + start_x / 2;
|
||||
|
||||
@@ -1232,6 +1232,8 @@ void window_zoom_in(rct_window *w)
|
||||
w->saved_view_x += v->view_width >> 1;
|
||||
w->saved_view_y += v->view_height >> 1;
|
||||
|
||||
// HACK: Prevents the redraw from failing when there is
|
||||
// a window on top of the viewport.
|
||||
window_bring_to_front(w);
|
||||
window_invalidate(w);
|
||||
}
|
||||
@@ -1260,6 +1262,8 @@ void window_zoom_out(rct_window *w)
|
||||
w->saved_view_x -= width / 2;
|
||||
w->saved_view_y -= height >> 1;
|
||||
|
||||
// HACK: Prevents the redraw from failing when there is
|
||||
// a window on top of the viewport.
|
||||
window_bring_to_front(w);
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user