Added window_resize_gui_scenario_editor (0x0066F0DD).

This commit is contained in:
hexdec 2014-08-11 22:57:45 +02:00
parent 02d3c5ddbd
commit ce812fe403
2 changed files with 41 additions and 2 deletions

View File

@ -1310,8 +1310,7 @@ void window_bubble_list_item(rct_window* w, int item_position){
void window_resize_gui(int width, int height)
{
if (RCT2_GLOBAL(0x9DEA68, uint8) & 0xE){
//Scenario editor version
RCT2_CALLPROC_EBPSAFE(0x66F0DD);
return window_resize_gui_scenario_editor(width, height);
}
rct_window* mainWind = window_get_main();
if (mainWind){
@ -1363,3 +1362,42 @@ void window_resize_gui(int width, int height)
exitWind->y = height - 64;
}
}
/**
* rct2: 0x0066F0DD
*/
void window_resize_gui_scenario_editor(int width, int height)
{
rct_window* mainWind = window_get_main();
if (mainWind) {
rct_viewport* viewport = mainWind->viewport;
mainWind->width = width;
mainWind->height = height;
RCT2_GLOBAL(0x9A9834, uint16) = width - 1;
RCT2_GLOBAL(0x9A9838, uint16) = height - 1;
viewport->width = width;
viewport->height = height;
viewport->view_width = width << viewport->zoom;
viewport->view_height = height << viewport->zoom;
if (mainWind->widgets != NULL && mainWind->widgets[0].type == WWT_VIEWPORT){
mainWind->widgets[0].right = width;
mainWind->widgets[0].bottom = height;
}
}
rct_window* topWind = window_find_by_id(WC_TOP_TOOLBAR, 0);
if (topWind){
topWind->width = max(640, width);
}
rct_window* bottomWind = window_find_by_id(WC_BOTTOM_TOOLBAR, 0);
if (bottomWind){
bottomWind->y = height - 32;
bottomWind->width = max(640, width);
RCT2_GLOBAL(0x9A997C, uint16) = bottomWind->width - 1;
RCT2_GLOBAL(0x9A997A, uint16) = bottomWind->width - 200;
RCT2_GLOBAL(0x9A998A, uint16) = bottomWind->width - 198;
RCT2_GLOBAL(0x9A998C, uint16) = bottomWind->width - 3;
}
}

View File

@ -346,6 +346,7 @@ void tool_cancel();
// Open window functions
void window_main_open();
void window_resize_gui(int width, int height);
void window_resize_gui_scenario_editor(int width, int height);
void window_game_top_toolbar_open();
void window_game_bottom_toolbar_open();
void window_about_open();