Fix small issues with scrolling.

I've found the cause of the cursors not correctly changing. It would appear ebx is popped to its previous value as the call function returns. This causes the cursor value to never change. This can be solved when all windows are complete. Fixes points i, ii, iii, iv of #1127 (Fixed by reseting scroll positions when the height is 0. And actually passing the scroll index to the calling function)
This commit is contained in:
Duncan Frost 2015-06-03 20:54:28 +01:00
parent 21b57e90a3
commit c9543005de
3 changed files with 17 additions and 4 deletions

View File

@ -861,7 +861,7 @@ void process_mouse_over(int x, int y)
RCT2_GLOBAL(0x9DE558, uint16) = x;
RCT2_GLOBAL(0x9DE55A, uint16) = y;
int output_x, output_y, output_scroll_area, scroll_id;
widget_scroll_get_part(window, window->widgets, x, y, &output_x, &output_y, &output_scroll_area, &scroll_id);
widget_scroll_get_part(window, window->widgets, x, y, &x, &y, &output_scroll_area, &scroll_id);
cursorId = scroll_id;
if (output_scroll_area != SCROLL_PART_VIEW)
{

View File

@ -845,6 +845,12 @@ void window_update_scroll_widgets(rct_window *w)
scroll = &w->scrolls[scrollIndex];
window_get_scroll_size(w, scrollIndex, &width, &height);
if (height == 0){
scroll->v_top = 0;
}
else if (width == 0){
scroll->h_left = 0;
}
width++;
height++;
@ -872,7 +878,7 @@ int window_get_scroll_size(rct_window *w, int scrollIndex, int *width, int *heig
rct_widget *widget = window_get_scroll_widget(w, scrollIndex);
int widgetIndex = window_get_widget_index(w, widget);
int eax = 0, ebx = scrollIndex * sizeof(rct_scroll), ecx = 0, edx = 0, esi = (int)w, edi = widgetIndex * sizeof(rct_widget), ebp = 0;
int eax = scrollIndex, ebx = scrollIndex * sizeof(rct_scroll), ecx = 0, edx = 0, esi = (int)w, edi = widgetIndex * sizeof(rct_widget), ebp = 0;
RCT2_CALLFUNC_X(w->event_handlers[WE_SCROLL_GETSIZE], & eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
*width = ecx;
*height = edx;

View File

@ -119,7 +119,7 @@ static void* window_editor_inventions_list_events[] = {
window_editor_inventions_list_scrollpaint
};
// 0x0098177C
// 0x009817EC
static void* window_editor_inventions_list_drag_events[] = {
window_editor_inventions_list_emptysub,
window_editor_inventions_list_emptysub,
@ -170,7 +170,14 @@ static int research_item_is_always_researched(rct_research_item *researchItem)
*/
static void sub_685901()
{
RCT2_CALLPROC_EBPSAFE(0x00685901);
for (rct_research_item* research = gResearchItems;
research->entryIndex != -3;
research++){
if (research->entryIndex < -3){
research->entryIndex &= 0x00FFFFFF;
}
}
}
/**