diff --git a/src/platform/shared.c b/src/platform/shared.c index 8ad874af9b..8fceffe51c 100644 --- a/src/platform/shared.c +++ b/src/platform/shared.c @@ -326,9 +326,6 @@ void platform_process_messages() } break; case SDL_MOUSEMOTION: - RCT2_GLOBAL(0x0142406C, int) = (int)(e.motion.x / gConfigGeneral.window_scale); - RCT2_GLOBAL(0x01424070, int) = (int)(e.motion.y / gConfigGeneral.window_scale); - gCursorState.x = (int)(e.motion.x / gConfigGeneral.window_scale); gCursorState.y = (int)(e.motion.y / gConfigGeneral.window_scale); break; @@ -384,9 +381,6 @@ void platform_process_messages() // Apple sends touchscreen events for trackpads, so ignore these events on macOS #ifndef __MACOSX__ case SDL_FINGERMOTION: - RCT2_GLOBAL(0x0142406C, int) = (int)(e.tfinger.x * gScreenWidth); - RCT2_GLOBAL(0x01424070, int) = (int)(e.tfinger.y * gScreenHeight); - gCursorState.x = (int)(e.tfinger.x * gScreenWidth); gCursorState.y = (int)(e.tfinger.y * gScreenHeight); break; diff --git a/src/windows/editor_object_selection.c b/src/windows/editor_object_selection.c index 1e0c228b56..21a0cdaa2d 100644 --- a/src/windows/editor_object_selection.c +++ b/src/windows/editor_object_selection.c @@ -989,7 +989,7 @@ static void window_editor_object_selection_scroll_mousedown(rct_window *w, int s window_invalidate(w); - audio_play_sound_panned(SOUND_CLICK_1, RCT2_GLOBAL(0x142406C,uint32), 0, 0, 0); + audio_play_sound_panned(SOUND_CLICK_1, gCursorState.x, 0, 0, 0); if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { diff --git a/src/windows/error.c b/src/windows/error.c index 8568f46fc7..2cf7df4377 100644 --- a/src/windows/error.c +++ b/src/windows/error.c @@ -119,10 +119,10 @@ void window_error_open(rct_string_id title, rct_string_id message) window_error_widgets[WIDX_BACKGROUND].right = width; window_error_widgets[WIDX_BACKGROUND].bottom = height; - x = RCT2_GLOBAL(0x0142406C, sint32) - (width / 2); + x = gCursorState.x - (width / 2); x = clamp(0, x, gScreenWidth); - y = RCT2_GLOBAL(0x01424070, sint32) + 26; + y = gCursorState.y + 26; y = max(22, y); maxY = gScreenHeight - height; if (y > maxY) { diff --git a/src/windows/map_tooltip.c b/src/windows/map_tooltip.c index de8ff9cbfd..161535877c 100644 --- a/src/windows/map_tooltip.c +++ b/src/windows/map_tooltip.c @@ -75,8 +75,8 @@ void window_map_tooltip_update_visibility() { int cursorX, cursorY, inputFlags; - cursorX = RCT2_GLOBAL(0x0142406C, sint32); - cursorY = RCT2_GLOBAL(0x01424070, sint32); + cursorX = gCursorState.x; + cursorY = gCursorState.y; inputFlags = gInputFlags; // Check for cursor movement @@ -113,8 +113,8 @@ static void window_map_tooltip_open() width = 200; height = 44; - x = RCT2_GLOBAL(0x0142406C, sint32) - (width / 2); - y = RCT2_GLOBAL(0x01424070, sint32) + 15; + x = gCursorState.x - (width / 2); + y = gCursorState.y + 15; w = window_find_by_class(WC_MAP_TOOLTIP); if (w == NULL) { diff --git a/src/windows/ride_construction.c b/src/windows/ride_construction.c index 978f15b9d6..05443e77c5 100644 --- a/src/windows/ride_construction.c +++ b/src/windows/ride_construction.c @@ -3859,7 +3859,7 @@ void ride_construction_tooldown_construct(int screenX, int screenY) zAttempts == 0 || z < 0 ) { - audio_play_sound_panned(SOUND_ERROR, RCT2_GLOBAL(0x0142406C, sint32), x, y, z); + audio_play_sound_panned(SOUND_ERROR, gCursorState.x, x, y, z); w = window_find_by_class(WC_RIDE_CONSTRUCTION); if (w != NULL){ tool_set(w, 23, 12); @@ -3931,7 +3931,7 @@ void ride_construction_tooldown_construct(int screenX, int screenY) _currentTrackCovered = saveCurrentTrackCovered; _currentTrackLiftHill = saveCurrentTrackLiftHill; - audio_play_sound_panned(SOUND_ERROR, RCT2_GLOBAL(0x0142406C, sint32), x, y, z); + audio_play_sound_panned(SOUND_ERROR, gCursorState.x, x, y, z); break; } else if (zAttempts >= 0) { z += 16; diff --git a/src/windows/scenery.c b/src/windows/scenery.c index df1130f694..92f328e662 100644 --- a/src/windows/scenery.c +++ b/src/windows/scenery.c @@ -729,13 +729,13 @@ static void window_scenery_event_07(rct_window *w) */ static void window_scenery_update(rct_window *w) { - rct_window *other = window_find_from_point(RCT2_GLOBAL(0x0142406C, int), RCT2_GLOBAL(0x01424070, int)); + rct_window *other = window_find_from_point(gCursorState.x, gCursorState.y); if (other == w) { - int window_x = RCT2_GLOBAL(0x0142406C, int) - w->x + 26; - int window_y = RCT2_GLOBAL(0x01424070, int) - w->y; + int window_x = gCursorState.x - w->x + 26; + int window_y = gCursorState.y - w->y; if (window_y < 44 || window_x <= w->width) { - int widgetIndex = window_find_widget_from_point(w, RCT2_GLOBAL(0x0142406C, int), RCT2_GLOBAL(0x01424070, int)); + int widgetIndex = window_find_widget_from_point(w, gCursorState.x, gCursorState.y); if (widgetIndex >= WIDX_SCENERY_TAB_CONTENT_PANEL) { w->scenery.hover_counter++; if (w->scenery.hover_counter < 8) {