diff --git a/src/game.c b/src/game.c index 26b20a0b4e..9110504e86 100644 --- a/src/game.c +++ b/src/game.c @@ -107,9 +107,8 @@ void process_mouse_over(int x, int y) if (window != NULL) { widgetId = window_find_widget_from_point(window, x, y); - RCT2_GLOBAL(0x1420046, sint16) = (widgetId & 0xFFFF); - if (widgetId != 0xFFFF) + if (widgetId != -1) { switch (window->widgets[widgetId].type){ diff --git a/src/osinterface.c b/src/osinterface.c index 541fe2c07d..e9936d221f 100644 --- a/src/osinterface.c +++ b/src/osinterface.c @@ -28,6 +28,7 @@ #include "addresses.h" #include "gfx.h" #include "osinterface.h" +#include "window.h" #include "rct2.h" #include "cursors.h" @@ -250,6 +251,13 @@ static void osinterface_resize(int width, int height) RCT2_GLOBAL(RCT2_ADDRESS_DIRTY_BLOCK_ROWS, sint32) = (height >> 3) + 1; RCT2_CALLPROC_EBPSAFE(0x0066B905); // resize_gui() + //This part is to be moved inside resize_gui when it is decompiled. + rct_window* w = window_get_main(); + if (w != NULL && w->widgets != NULL){ + //Adjust the viewport widget + w->widgets[0].right = width; + w->widgets[0].bottom = height; + } gfx_invalidate_screen(); }