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

Changed function and occurences

It doesnt have to rotate three times to get an anti-clockwise return.
This commit is contained in:
Runelaenen
2015-07-09 13:05:21 +02:00
parent 624a402fa9
commit bec1a52bba
4 changed files with 8 additions and 9 deletions

View File

@@ -1354,7 +1354,7 @@ void sub_688956()
*
* rct2: 0x0068881A
*/
void window_rotate_camera(rct_window *w)
void window_rotate_camera(rct_window *w, int wise)
{
rct_viewport *viewport = w->viewport;
if (viewport == NULL)
@@ -1375,11 +1375,12 @@ void window_rotate_camera(rct_window *w)
y = (viewport->view_height >> 1) + viewport->view_y;
sub_689174(&x, &y, &z);
} else {
}
else {
z = map_element_height(x, y);
}
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32) = (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32) + 1) % 4;
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32) = (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32) + wise) % 4;
int new_x, new_y;
center_2d_coordinates(x, y, z, &new_x, &new_y, viewport);

View File

@@ -496,7 +496,7 @@ rct_window *window_get_main();
void window_scroll_to_viewport(rct_window *w);
void window_scroll_to_location(rct_window *w, int x, int y, int z);
void window_rotate_camera(rct_window *w);
void window_rotate_camera(rct_window *w, int wise);
void window_zoom_set(rct_window *w, int zoomLevel);
void window_zoom_in(rct_window *w);
void window_zoom_out(rct_window *w);

View File

@@ -300,7 +300,7 @@ static void title_do_next_script_opcode()
w = window_get_main();
if (w != NULL)
for (i = 0; i < script_operand; i++)
window_rotate_camera(w);
window_rotate_camera(w, 1);
break;
case TITLE_SCRIPT_ZOOM:
script_operand = (*_currentScript++);

View File

@@ -2853,13 +2853,11 @@ void top_toolbar_rotate_menu_dropdown(short dropdownIndex) {
rct_window* w = window_get_main();
if (w) {
if (dropdownIndex == 0) {
window_rotate_camera(w);
window_rotate_camera(w, 1);
window_invalidate(w);
}
else if (dropdownIndex == 1){
window_rotate_camera(w);
window_rotate_camera(w);
window_rotate_camera(w);
window_rotate_camera(w, -1);
window_invalidate(w);
}
}