Fixes cursor error when main window is at increased size.

This commit is contained in:
Duncan Frost 2014-07-29 18:05:52 +01:00
parent 5d255fae42
commit 3acb1a72ba
2 changed files with 9 additions and 2 deletions

View File

@ -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){

View File

@ -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();
}