Clean up game init a bit more

This commit is contained in:
Ted John 2017-01-23 12:55:59 +00:00
parent 288f4782b6
commit a0fc01d54e
4 changed files with 9 additions and 16 deletions

View File

@ -82,8 +82,6 @@ static void editor_clear_map_for_editing(bool fromSave);
*/
void editor_load()
{
rct_window *mainWindow;
audio_stop_all_music_and_sounds();
object_manager_unload_all_objects();
object_list_load();
@ -93,12 +91,10 @@ void editor_load()
gParkFlags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
gS6Info.category = SCENARIO_CATEGORY_OTHER;
viewport_init_all();
window_editor_main_open();
mainWindow = window_get_main();
rct_window *mainWindow = window_editor_main_open();
window_set_location(mainWindow, 2400, 2400, 112);
load_palette();
gfx_invalidate_screen();
window_tile_inspector_clear_clipboard();
gScreenAge = 0;
safe_strcpy(gScenarioName, language_get_string(STR_MY_NEW_SCENARIO), 64);
@ -165,12 +161,10 @@ void trackdesigner_load()
set_all_land_owned();
gS6Info.editor_step = EDITOR_STEP_OBJECT_SELECTION;
viewport_init_all();
window_editor_main_open();
rct_window * mainWindow = window_get_main();
rct_window * mainWindow = window_editor_main_open();
window_set_location(mainWindow, 2400, 2400, 112);
load_palette();
gfx_invalidate_screen();
window_tile_inspector_clear_clipboard();
}
/**
@ -189,12 +183,10 @@ void trackmanager_load()
set_all_land_owned();
gS6Info.editor_step = EDITOR_STEP_OBJECT_SELECTION;
viewport_init_all();
window_editor_main_open();
rct_window * mainWindow = window_get_main();
rct_window *mainWindow = window_editor_main_open();
window_set_location(mainWindow, 2400, 2400, 112);
load_palette();
gfx_invalidate_screen();
window_tile_inspector_clear_clipboard();
}
/**

View File

@ -1184,6 +1184,7 @@ void game_init_all(sint32 mapSize)
window_guest_list_init_vars_b();
window_staff_list_init_vars();
scenery_set_default_placement_configuration();
window_tile_inspector_clear_clipboard();
}
GAME_COMMAND_POINTER* new_game_command_table[GAME_COMMAND_COUNT] = {

View File

@ -721,7 +721,7 @@ rct_window *window_loadsave_open(sint32 type, char *defaultName);
rct_window *window_changelog_open();
void window_debug_paint_open();
void window_editor_main_open();
rct_window * window_editor_main_open();
void window_editor_bottom_toolbar_open();
void window_editor_object_selection_open();
void window_editor_inventions_list_open();

View File

@ -63,13 +63,11 @@ static rct_widget window_editor_main_widgets[] = {
* Creates the main editor window that holds the main viewport.
* rct2: 0x0066EF38
*/
void window_editor_main_open()
rct_window * window_editor_main_open()
{
rct_window* window;
window_editor_main_widgets[0].right = gScreenWidth;
window_editor_main_widgets[0].bottom = gScreenHeight;
window = window_create(0, 0, window_editor_main_widgets[0].right, window_editor_main_widgets[0].bottom,
rct_window *window = window_create(0, 0, window_editor_main_widgets[0].right, window_editor_main_widgets[0].bottom,
&window_editor_main_events, WC_MAIN_WINDOW, WF_STICK_TO_BACK);
window->widgets = window_editor_main_widgets;
@ -84,6 +82,8 @@ void window_editor_main_open()
window_top_toolbar_open();
window_editor_bottom_toolbar_open();
return window_get_main();
}
/**