mirror of https://github.com/OpenRCT2/OpenRCT2.git
fixed bug due to incorrect function calls
This commit is contained in:
parent
c4f49bb7cd
commit
6727c216e4
29
src/game.c
29
src/game.c
|
@ -544,14 +544,16 @@ static void game_handle_input_mouse(int x, int y, int state)
|
||||||
int temp_x = x;
|
int temp_x = x;
|
||||||
x -= RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_CURSOR_X, uint16);
|
x -= RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_CURSOR_X, uint16);
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_CURSOR_X, uint16) = temp_x;
|
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_CURSOR_X, uint16) = temp_x;
|
||||||
RCT2_CALLPROC_X(0x006E8676, x, temp_x, state, w->number, (int)w, (int)widget, x);
|
RCT2_CALLPROC_X(0x006E98F2, x, temp_x, state, w->number, (int)w, (int)widget, x);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SCROLL_AREA, uint16) == SCROLL_PART_VSCROLLBAR_THUMB){
|
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SCROLL_AREA, uint16) == SCROLL_PART_VSCROLLBAR_THUMB){
|
||||||
int temp_y = y;
|
int temp_y = y;
|
||||||
y -= RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_CURSOR_Y, uint16);
|
y -= RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_CURSOR_Y, uint16);
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_CURSOR_Y, uint16) = temp_y;
|
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_CURSOR_Y, uint16) = temp_y;
|
||||||
RCT2_CALLPROC_X(0x006E99A9, temp_y, y, state, w->number, (int)w, (int)widget, x);
|
RCT2_CALLPROC_X(0x006E99A9, temp_y, y, state, w->number, (int)w, (int)widget, y);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
int scroll_part;
|
int scroll_part;
|
||||||
widget_scroll_get_part(w, widget, x, y, &x, &y, &scroll_part, &state);
|
widget_scroll_get_part(w, widget, x, y, &x, &y, &scroll_part, &state);
|
||||||
|
@ -593,23 +595,16 @@ static void game_handle_input_mouse(int x, int y, int state)
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_STATE, uint8) = 0;
|
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_STATE, uint8) = 0;
|
||||||
state2:
|
state2:
|
||||||
widgetIndex = widgetIndex;//Purely to make the goto work
|
widgetIndex = widgetIndex;//Purely to make the goto work
|
||||||
|
int window_no = RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWNUMBER, uint16);
|
||||||
|
int window_cls = RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWCLASS, uint8);
|
||||||
|
|
||||||
int eax = x, ebx = y, ecx, edx, esi, edi, ebp;
|
rct_window* wind = window_find_by_id( window_cls,window_no);
|
||||||
edx = RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWNUMBER, uint16);
|
if (wind == NULL) return;
|
||||||
ecx = RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWCLASS, uint8);
|
int scroll_id = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SCROLL_ID, uint32);
|
||||||
esi = (int)w;
|
|
||||||
edi = (int)widget;
|
|
||||||
|
|
||||||
RCT2_CALLFUNC_X(0x006EA8A0, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
wind->scrolls[scroll_id/sizeof(rct_scroll)].flags &= 0xFF11;
|
||||||
if (esi == 0) return;
|
|
||||||
ebx = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SCROLL_ID, uint32);
|
window_invalidate_by_id(RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWCLASS, uint8), RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWNUMBER, uint16));
|
||||||
edi = RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WIDGETINDEX, uint32);
|
|
||||||
rct_widget* widg = &w->widgets[edi];
|
|
||||||
w->scrolls[ebx/sizeof(rct_scroll)].flags &= 0xFF11;
|
|
||||||
eax = RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WIDGETINDEX, uint8) << 8;
|
|
||||||
eax |= RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWCLASS, uint8) | 0x80;
|
|
||||||
ebx = RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWNUMBER, uint16);
|
|
||||||
RCT2_CALLPROC_X(0x006EA8A0, eax, ebx, ecx, edx, esi, (int)widg, ebp);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//RCT2_CALLPROC_X(0x006E8676, x, y, state, widgetIndex, (int)w, (int)widget, 0);
|
//RCT2_CALLPROC_X(0x006E8676, x, y, state, widgetIndex, (int)w, (int)widget, 0);
|
||||||
|
|
Loading…
Reference in New Issue