1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-02 19:56:13 +01:00

Close #11437: Migrate old platform methods

This commit is contained in:
Michael Steenbeek
2022-02-18 21:57:00 +01:00
committed by GitHub
parent b424682934
commit 5edc561715
81 changed files with 613 additions and 793 deletions

View File

@@ -57,8 +57,7 @@
#include "object/ObjectRepository.h"
#include "paint/Painter.h"
#include "platform/Crash.h"
#include "platform/Platform2.h"
#include "platform/platform.h"
#include "platform/Platform.h"
#include "profiling/Profiling.h"
#include "ride/TrackData.h"
#include "ride/TrackDesignRepository.h"
@@ -402,7 +401,7 @@ namespace OpenRCT2
}
// TODO add configuration option to allow multiple instances
// if (!gOpenRCT2Headless && !platform_lock_single_instance()) {
// if (!gOpenRCT2Headless && !Platform::LockSingleInstance()) {
// log_fatal("OpenRCT2 is already running.");
// return false;
// } //This comment was relocated so it would stay where it was in relation to the following lines of code.
@@ -1052,7 +1051,7 @@ namespace OpenRCT2
if (_ticksAccumulator < GAME_UPDATE_TIME_MS)
{
const auto sleepTimeSec = (GAME_UPDATE_TIME_MS - _ticksAccumulator);
platform_sleep(static_cast<uint32_t>(sleepTimeSec * 1000.f));
Platform::Sleep(static_cast<uint32_t>(sleepTimeSec * 1000.f));
return;
}
@@ -1188,7 +1187,7 @@ namespace OpenRCT2
for (const auto& dirId : dirIds)
{
auto path = _env->GetDirectoryPath(dirBase, dirId);
if (!platform_ensure_directory_exists(path.c_str()))
if (!Platform::EnsureDirectoryExists(path.c_str()))
log_error("Unable to create directory '%s'.", path.c_str());
}
}
@@ -1225,7 +1224,7 @@ namespace OpenRCT2
if (!Path::DirectoryExists(dstDirectory.c_str()))
{
Console::WriteLine("Creating directory '%s'", dstDirectory.c_str());
if (!platform_ensure_directory_exists(dstDirectory.c_str()))
if (!Platform::EnsureDirectoryExists(dstDirectory.c_str()))
{
Console::Error::WriteLine("Could not create directory %s.", dstDirectory.c_str());
break;
@@ -1515,7 +1514,7 @@ const utf8* context_get_path_legacy(int32_t pathId)
return result;
}
bool platform_open_common_file_dialog(utf8* outFilename, OpenRCT2::Ui::FileDialogDesc& desc, size_t outSize)
bool ContextOpenCommonFileDialog(utf8* outFilename, OpenRCT2::Ui::FileDialogDesc& desc, size_t outSize)
{
try
{