Replace context_load_park_from_file() with object equivalent

This commit is contained in:
Gymnasiast 2022-10-08 19:23:26 +02:00
parent fd84cc111f
commit d5f6a5b285
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
7 changed files with 5 additions and 11 deletions

View File

@ -289,7 +289,7 @@ namespace OpenRCT2::Title
{
gLoadKeepWindowsOpen = true;
CloseParkSpecificWindows();
context_load_park_from_file(path);
GetContext()->LoadParkFromFile(path);
}
else
{

View File

@ -293,7 +293,7 @@ private:
if (result == MODAL_RESULT_OK)
{
game_notify_map_change();
context_load_park_from_file(path);
GetContext()->LoadParkFromFile(path);
network_begin_server(gConfigNetwork.default_port, gConfigNetwork.listen_address);
}
}

View File

@ -1360,11 +1360,6 @@ void context_init()
GetContext()->GetUiContext()->GetWindowManager()->Init();
}
bool context_load_park_from_file(const utf8* path)
{
return GetContext()->LoadParkFromFile(path);
}
bool context_load_park_from_stream(void* stream)
{
return GetContext()->LoadParkFromStream(static_cast<IStream*>(stream), "");

View File

@ -221,7 +221,6 @@ void context_update_map_tooltip();
void context_handle_input();
void context_input_handle_keyboard(bool isTitle);
void context_quit();
bool context_load_park_from_file(const utf8* path);
bool context_load_park_from_stream(void* stream);
bool ContextOpenCommonFileDialog(utf8* outFilename, OpenRCT2::Ui::FileDialogDesc& desc, size_t outSize);
u8string ContextOpenCommonFileDialog(OpenRCT2::Ui::FileDialogDesc& desc);

View File

@ -140,7 +140,7 @@ namespace Editor
return;
}
if (!context_load_park_from_file(path))
if (!GetContext()->LoadParkFromFile(path))
{
return;
}

View File

@ -726,7 +726,7 @@ static void game_load_or_quit_no_save_prompt_callback(int32_t result, const utf8
game_notify_map_change();
game_unload_scripts();
window_close_by_class(WindowClass::EditorObjectSelection);
context_load_park_from_file(path);
GetContext()->LoadParkFromFile(path);
game_load_scripts();
game_notify_map_changed();
gIsAutosaveLoaded = gIsAutosave;

View File

@ -1517,7 +1517,7 @@ static int32_t cc_load_park([[maybe_unused]] InteractiveConsole& console, [[mayb
{
savePath += ".park";
}
if (context_load_park_from_file(savePath.c_str()))
if (OpenRCT2::GetContext()->LoadParkFromFile(savePath))
{
console.WriteFormatLine("Park %s was loaded successfully", savePath.c_str());
}