1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

allow new quit game or load code to run

This commit is contained in:
IntelOrca
2014-05-03 02:33:01 +01:00
parent 51fa837caf
commit 634ae0dbeb
2 changed files with 61 additions and 5 deletions

View File

@@ -1141,9 +1141,20 @@ static void load_landscape()
if (open_landscape_file_dialog() == 0) {
gfx_invalidate_screen();
} else {
// string stuff
// Set default filename
char *esi = 0x0141EF67;
while (1) {
esi++;
if (*esi == '.')
break;
if (*esi != 0)
continue;
strcpy(esi, ".SC6");
break;
}
strcpy(0x009ABB37, 0x0141EF68);
RCT2_CALLPROC_EBPSAFE(0x006758C0);
RCT2_CALLPROC_EBPSAFE(0x006758C0); // landscape_load
if (1) {
gfx_invalidate_screen();
// game_loop_iteration
@@ -1163,9 +1174,20 @@ static void load_game()
if (open_load_game_dialog() == 0) {
gfx_invalidate_screen();
} else {
// string stuff
// Set default filename
char *esi = 0x0141EF67;
while (1) {
esi++;
if (*esi == '.')
break;
if (*esi != 0)
continue;
strcpy(esi, ".SV6");
break;
}
strcpy(0x009ABB37, 0x0141EF68);
RCT2_CALLPROC_EBPSAFE(0x00675E1B);
RCT2_CALLPROC_EBPSAFE(0x00675E1B); // game_load
if (1) {
gfx_invalidate_screen();
// game_loop_iteration
@@ -1219,7 +1241,7 @@ static uint32 game_do_command_table[58] = {
0x00667C15,
0x006C511D,
0x006C5B69,
0x0066DB5F, // game_load_or_quit,
game_load_or_quit,
0x006B3F0F,
0x006B49D9,
0x006B4EA6,

View File

@@ -34,6 +34,7 @@ static void widget_text_button(rct_drawpixelinfo *dpi, rct_window *w, int widget
static void widget_text_unknown(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex);
static void widget_text(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex);
static void widget_text_inset(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex);
static void widget_text_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex);
static void widget_groupbox_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex);
static void widget_caption_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex);
static void widget_closebox_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex);
@@ -507,6 +508,39 @@ static void widget_text_inset(rct_drawpixelinfo *dpi, rct_window *w, int widgetI
widget_text(dpi, w, widgetIndex);
}
/**
*
* rct2: 0x006EC1A6
*/
static void widget_text_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex)
{
rct_widget* widget;
int l, t, r, b, press;
uint8 colour;
// Get the widget
widget = &w->widgets[widgetIndex];
// Resolve the absolute ltrb
l = w->x + widget->left + 5;
t = w->y + widget->top;
r = w->x + widget->right;
b = w->y + widget->bottom;
// Get the colour
colour = w->colours[widget->colour];
press = 0;
if (widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex))
press |= 0x20;
gfx_fill_rect_inset(dpi, l, t, r, b, colour, press);
// TODO
gfx_fill_rect(dpi, l, t, r, b, colour);
}
/**
*
* rct2: 0x006EB535