From d8009291c472751f154ac46267849686a8704bb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com>
Date: Tue, 27 Jun 2023 21:48:21 +0300
Subject: [PATCH 1/7] Rename Shared.cpp to Platform.Common.cpp
---
src/openrct2/libopenrct2.vcxproj | 9 +++++----
.../platform/{Shared.cpp => Platform.Common.cpp} | 8 ++++++++
2 files changed, 13 insertions(+), 4 deletions(-)
rename src/openrct2/platform/{Shared.cpp => Platform.Common.cpp} (96%)
diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj
index f502c74a9b..950019c42e 100644
--- a/src/openrct2/libopenrct2.vcxproj
+++ b/src/openrct2/libopenrct2.vcxproj
@@ -351,7 +351,7 @@
-
+
@@ -875,10 +875,10 @@
+
-
@@ -1054,9 +1054,10 @@
NotUsing
-
+
+
TurnOffAllWarnings
-
+
\ No newline at end of file
diff --git a/src/openrct2/platform/Shared.cpp b/src/openrct2/platform/Platform.Common.cpp
similarity index 96%
rename from src/openrct2/platform/Shared.cpp
rename to src/openrct2/platform/Platform.Common.cpp
index 661f9aebf3..e8744380f8 100644
--- a/src/openrct2/platform/Shared.cpp
+++ b/src/openrct2/platform/Platform.Common.cpp
@@ -24,7 +24,9 @@
#include
#include
+#include
#include
+#include
#include
#ifdef _WIN32
@@ -136,4 +138,10 @@ namespace Platform
return 1;
}
#endif
+
+ void Sleep(uint32_t ms)
+ {
+ std::this_thread::sleep_for(std::chrono::milliseconds(ms));
+ }
+
} // namespace Platform
From e19738b5d3f88af8754d2679a690ccff939d4216 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com>
Date: Tue, 27 Jun 2023 22:11:52 +0300
Subject: [PATCH 2/7] Remove Sleep functions and use Common version
---
src/openrct2/platform/Platform.Posix.cpp | 5 -----
src/openrct2/platform/Platform.Win32.cpp | 5 -----
2 files changed, 10 deletions(-)
diff --git a/src/openrct2/platform/Platform.Posix.cpp b/src/openrct2/platform/Platform.Posix.cpp
index 76606501d3..18ae7f50c0 100644
--- a/src/openrct2/platform/Platform.Posix.cpp
+++ b/src/openrct2/platform/Platform.Posix.cpp
@@ -379,11 +379,6 @@ namespace Platform
return u8"app_285330" PATH_SEPARATOR u8"depot_285331";
}
- void Sleep(uint32_t ms)
- {
- usleep(ms * 1000);
- }
-
void InitTicks()
{
}
diff --git a/src/openrct2/platform/Platform.Win32.cpp b/src/openrct2/platform/Platform.Win32.cpp
index 85178dc975..9706056eff 100644
--- a/src/openrct2/platform/Platform.Win32.cpp
+++ b/src/openrct2/platform/Platform.Win32.cpp
@@ -912,11 +912,6 @@ namespace Platform
return static_cast(runningDelta.QuadPart / _frequency);
}
- void Sleep(uint32_t ms)
- {
- ::Sleep(ms);
- }
-
void InitTicks()
{
LARGE_INTEGER freq;
From a83337b2da30648bb7f49318c3e839d5ec8f8827 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com>
Date: Tue, 27 Jun 2023 22:21:42 +0300
Subject: [PATCH 3/7] Use chrono for GetTicks and move into Platform.Common.cpp
---
src/openrct2/platform/Platform.Common.cpp | 9 ++++++++-
src/openrct2/platform/Platform.Posix.cpp | 14 --------------
src/openrct2/platform/Platform.Win32.cpp | 22 ----------------------
src/openrct2/platform/Platform.h | 1 -
4 files changed, 8 insertions(+), 38 deletions(-)
diff --git a/src/openrct2/platform/Platform.Common.cpp b/src/openrct2/platform/Platform.Common.cpp
index e8744380f8..5f094ac6d8 100644
--- a/src/openrct2/platform/Platform.Common.cpp
+++ b/src/openrct2/platform/Platform.Common.cpp
@@ -48,7 +48,6 @@ namespace Platform
Platform::AndroidInitClassLoader();
#endif // __ANDROID__
- InitTicks();
BitCountInit();
MaskInit();
}
@@ -144,4 +143,12 @@ namespace Platform
std::this_thread::sleep_for(std::chrono::milliseconds(ms));
}
+ static const auto _processStartTime = std::chrono::high_resolution_clock::now();
+
+ uint32_t GetTicks()
+ {
+ const auto processTime = std::chrono::high_resolution_clock::now() - _processStartTime;
+ return static_cast(std::chrono::duration_cast(processTime).count());
+ }
+
} // namespace Platform
diff --git a/src/openrct2/platform/Platform.Posix.cpp b/src/openrct2/platform/Platform.Posix.cpp
index 18ae7f50c0..381d96100f 100644
--- a/src/openrct2/platform/Platform.Posix.cpp
+++ b/src/openrct2/platform/Platform.Posix.cpp
@@ -379,20 +379,6 @@ namespace Platform
return u8"app_285330" PATH_SEPARATOR u8"depot_285331";
}
- void InitTicks()
- {
- }
-
- uint32_t GetTicks()
- {
- struct timespec ts;
- if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0)
- {
- LOG_FATAL("clock_gettime failed");
- exit(-1);
- }
- return static_cast(ts.tv_sec * 1000 + ts.tv_nsec / 1000000);
- }
} // namespace Platform
#endif
diff --git a/src/openrct2/platform/Platform.Win32.cpp b/src/openrct2/platform/Platform.Win32.cpp
index 9706056eff..402848f9e9 100644
--- a/src/openrct2/platform/Platform.Win32.cpp
+++ b/src/openrct2/platform/Platform.Win32.cpp
@@ -41,10 +41,6 @@
# pragma comment( \
linker, \
"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
-
-static uint32_t _frequency = 0;
-static LARGE_INTEGER _entryTimestamp;
-
// The name of the mutex used to prevent multiple instances of the game from running
static constexpr wchar_t SINGLE_INSTANCE_MUTEX_NAME[] = L"RollerCoaster Tycoon 2_GSKMUTEX";
@@ -901,24 +897,6 @@ namespace Platform
return false;
}
- uint32_t GetTicks()
- {
- LARGE_INTEGER pfc;
- QueryPerformanceCounter(&pfc);
-
- LARGE_INTEGER runningDelta;
- runningDelta.QuadPart = pfc.QuadPart - _entryTimestamp.QuadPart;
-
- return static_cast(runningDelta.QuadPart / _frequency);
- }
-
- void InitTicks()
- {
- LARGE_INTEGER freq;
- QueryPerformanceFrequency(&freq);
- _frequency = static_cast(freq.QuadPart / 1000);
- QueryPerformanceCounter(&_entryTimestamp);
- }
} // namespace Platform
#endif
diff --git a/src/openrct2/platform/Platform.h b/src/openrct2/platform/Platform.h
index 1384fa3661..11f59e4f0f 100644
--- a/src/openrct2/platform/Platform.h
+++ b/src/openrct2/platform/Platform.h
@@ -125,7 +125,6 @@ namespace Platform
uint32_t GetTicks();
void Sleep(uint32_t ms);
- void InitTicks();
} // namespace Platform
#ifdef __ANDROID__
From 873fff25136953f2da9a0427b2f168510ede49e7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com>
Date: Tue, 27 Jun 2023 22:45:19 +0300
Subject: [PATCH 4/7] Remove BitCountInit and handle that with static
initialization
---
src/openrct2/platform/Platform.Common.cpp | 1 -
src/openrct2/util/Util.cpp | 7 +------
src/openrct2/util/Util.h | 1 -
3 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/src/openrct2/platform/Platform.Common.cpp b/src/openrct2/platform/Platform.Common.cpp
index 5f094ac6d8..83b4e13fa9 100644
--- a/src/openrct2/platform/Platform.Common.cpp
+++ b/src/openrct2/platform/Platform.Common.cpp
@@ -48,7 +48,6 @@ namespace Platform
Platform::AndroidInitClassLoader();
#endif // __ANDROID__
- BitCountInit();
MaskInit();
}
}
diff --git a/src/openrct2/util/Util.cpp b/src/openrct2/util/Util.cpp
index b8a0806d15..7979d9a75f 100644
--- a/src/openrct2/util/Util.cpp
+++ b/src/openrct2/util/Util.cpp
@@ -204,12 +204,7 @@ static int32_t BitCountLut(uint32_t source)
+ BitsSetTable256[source >> 24];
}
-static int32_t (*BitCountFn)(uint32_t);
-
-void BitCountInit()
-{
- BitCountFn = BitCountPopcntAvailable() ? BitCountPopcnt : BitCountLut;
-}
+static const auto BitCountFn = BitCountPopcntAvailable() ? BitCountPopcnt : BitCountLut;
int32_t BitCount(uint32_t source)
{
diff --git a/src/openrct2/util/Util.h b/src/openrct2/util/Util.h
index 5ec8b7e6fb..ef3809a0b2 100644
--- a/src/openrct2/util/Util.h
+++ b/src/openrct2/util/Util.h
@@ -28,7 +28,6 @@ bool AVX2Available();
int32_t UtilBitScanForward(int32_t source);
int32_t UtilBitScanForward(int64_t source);
-void BitCountInit();
int32_t BitCount(uint32_t source);
int32_t StrLogicalCmp(char const* a, char const* b);
char* SafeStrCpy(char* destination, const char* source, size_t num);
From 60a2d5c1f6fe094fe5aaf49513b8c6a8a7ae4775 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com>
Date: Tue, 27 Jun 2023 23:02:31 +0300
Subject: [PATCH 5/7] Use static initialization to get the correct masking
function
---
src/openrct2/drawing/Drawing.cpp | 22 +++++++++++++---------
src/openrct2/drawing/Drawing.h | 3 +--
src/openrct2/platform/Platform.Common.cpp | 2 --
3 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/src/openrct2/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp
index dbdbe752a8..5b46494e2c 100644
--- a/src/openrct2/drawing/Drawing.cpp
+++ b/src/openrct2/drawing/Drawing.cpp
@@ -709,30 +709,34 @@ ImageCatalogue ImageId::GetCatalogue() const
return ImageCatalogue::UNKNOWN;
}
-void (*MaskFn)(
- int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
- int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
- = nullptr;
-
-void MaskInit()
+static auto GetMaskFunction()
{
if (AVX2Available())
{
LOG_VERBOSE("registering AVX2 mask function");
- MaskFn = MaskAvx2;
+ return MaskAvx2;
}
else if (SSE41Available())
{
LOG_VERBOSE("registering SSE4.1 mask function");
- MaskFn = MaskSse4_1;
+ return MaskSse4_1;
}
else
{
LOG_VERBOSE("registering scalar mask function");
- MaskFn = MaskScalar;
+ return MaskScalar;
}
}
+static const auto MaskFunc = GetMaskFunction();
+
+void MaskFn(
+ int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
+ int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
+{
+ MaskFunc(width, height, maskSrc, colourSrc, dst, maskWrap, colourWrap, dstWrap);
+}
+
void GfxFilterPixel(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, FilterPaletteID palette)
{
GfxFilterRect(dpi, { coords, coords }, palette);
diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h
index 690b6c3e30..35da0cfd23 100644
--- a/src/openrct2/drawing/Drawing.h
+++ b/src/openrct2/drawing/Drawing.h
@@ -597,9 +597,8 @@ void MaskSse4_1(
void MaskAvx2(
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
-void MaskInit();
-extern void (*MaskFn)(
+void MaskFn(
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
diff --git a/src/openrct2/platform/Platform.Common.cpp b/src/openrct2/platform/Platform.Common.cpp
index 83b4e13fa9..fbbfd2afb0 100644
--- a/src/openrct2/platform/Platform.Common.cpp
+++ b/src/openrct2/platform/Platform.Common.cpp
@@ -47,8 +47,6 @@ namespace Platform
#ifdef __ANDROID__
Platform::AndroidInitClassLoader();
#endif // __ANDROID__
-
- MaskInit();
}
}
From 484523f82f053479b0fd6f9fb98fca7e6bc5b221 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com>
Date: Tue, 27 Jun 2023 23:09:53 +0300
Subject: [PATCH 6/7] Use static initialization for Android class loader
---
src/openrct2/platform/Platform.Android.cpp | 7 +------
src/openrct2/platform/Platform.Common.cpp | 9 ---------
src/openrct2/platform/Platform.h | 1 -
3 files changed, 1 insertion(+), 16 deletions(-)
diff --git a/src/openrct2/platform/Platform.Android.cpp b/src/openrct2/platform/Platform.Android.cpp
index 8ca55ac3c4..068432d18d 100644
--- a/src/openrct2/platform/Platform.Android.cpp
+++ b/src/openrct2/platform/Platform.Android.cpp
@@ -27,7 +27,7 @@ AndroidClassLoader::~AndroidClassLoader()
jobject AndroidClassLoader::_classLoader;
jmethodID AndroidClassLoader::_findClassMethod;
-static std::shared_ptr acl;
+static std::shared_ptr acl = std::make_shared();
namespace Platform
{
@@ -173,11 +173,6 @@ namespace Platform
return displayScale;
}
- void AndroidInitClassLoader()
- {
- acl = std::make_shared();
- }
-
jclass AndroidFindClass(JNIEnv* env, std::string_view name)
{
return static_cast(env->CallObjectMethod(
diff --git a/src/openrct2/platform/Platform.Common.cpp b/src/openrct2/platform/Platform.Common.cpp
index fbbfd2afb0..051925b9f8 100644
--- a/src/openrct2/platform/Platform.Common.cpp
+++ b/src/openrct2/platform/Platform.Common.cpp
@@ -39,15 +39,6 @@ namespace Platform
{
void CoreInit()
{
- static bool initialised = false;
- if (!initialised)
- {
- initialised = true;
-
-#ifdef __ANDROID__
- Platform::AndroidInitClassLoader();
-#endif // __ANDROID__
- }
}
CurrencyType GetCurrencyValue(const char* currCode)
diff --git a/src/openrct2/platform/Platform.h b/src/openrct2/platform/Platform.h
index 11f59e4f0f..607387ec9a 100644
--- a/src/openrct2/platform/Platform.h
+++ b/src/openrct2/platform/Platform.h
@@ -103,7 +103,6 @@ namespace Platform
bool SetupUriProtocol();
#endif
#ifdef __ANDROID__
- void AndroidInitClassLoader();
jclass AndroidFindClass(JNIEnv* env, std::string_view name);
#endif
From ac583569dab8396cee88d4ef4d8b9d317086015e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com>
Date: Tue, 27 Jun 2023 23:14:30 +0300
Subject: [PATCH 7/7] Remove Platform::CoreInit
---
src/openrct2-cli/Cli.cpp | 1 -
src/openrct2-ui/Ui.cpp | 1 -
src/openrct2/command_line/BenchSpriteSort.cpp | 1 -
src/openrct2/command_line/BenchUpdate.cpp | 1 -
src/openrct2/command_line/SimulateCommands.cpp | 2 --
src/openrct2/interface/Screenshot.cpp | 2 --
src/openrct2/platform/Platform.Common.cpp | 4 ----
src/openrct2/platform/Platform.h | 2 --
test/tests/MultiLaunch.cpp | 1 -
test/tests/Pathfinding.cpp | 2 --
test/tests/PlayTests.cpp | 1 -
test/tests/ReplayTests.cpp | 1 -
test/tests/RideRatings.cpp | 1 -
test/tests/S6ImportExportTests.cpp | 4 ----
14 files changed, 24 deletions(-)
diff --git a/src/openrct2-cli/Cli.cpp b/src/openrct2-cli/Cli.cpp
index c9deea36e2..5e2a37ff0b 100644
--- a/src/openrct2-cli/Cli.cpp
+++ b/src/openrct2-cli/Cli.cpp
@@ -21,7 +21,6 @@ int main(int argc, const char** argv)
{
int32_t rc = EXIT_SUCCESS;
int runGame = CommandLineRun(argv, argc);
- Platform::CoreInit();
if (runGame == EXITCODE_CONTINUE)
{
gOpenRCT2Headless = true;
diff --git a/src/openrct2-ui/Ui.cpp b/src/openrct2-ui/Ui.cpp
index eeda41160d..3364bb29e8 100644
--- a/src/openrct2-ui/Ui.cpp
+++ b/src/openrct2-ui/Ui.cpp
@@ -44,7 +44,6 @@ int main(int argc, const char** argv)
std::unique_ptr context;
int32_t rc = EXIT_SUCCESS;
int runGame = CommandLineRun(argv, argc);
- Platform::CoreInit();
RegisterBitmapReader();
if (runGame == EXITCODE_CONTINUE)
{
diff --git a/src/openrct2/command_line/BenchSpriteSort.cpp b/src/openrct2/command_line/BenchSpriteSort.cpp
index 3b360a6c5d..e24c76c812 100644
--- a/src/openrct2/command_line/BenchSpriteSort.cpp
+++ b/src/openrct2/command_line/BenchSpriteSort.cpp
@@ -70,7 +70,6 @@ static void fixup_pointers(std::vector& s)
static std::vector extract_paint_session(std::string_view parkFileName)
{
- Platform::CoreInit();
gOpenRCT2Headless = true;
auto context = OpenRCT2::CreateContext();
std::vector sessions;
diff --git a/src/openrct2/command_line/BenchUpdate.cpp b/src/openrct2/command_line/BenchUpdate.cpp
index ec1b628197..d87777a8da 100644
--- a/src/openrct2/command_line/BenchUpdate.cpp
+++ b/src/openrct2/command_line/BenchUpdate.cpp
@@ -118,7 +118,6 @@ static int CommandLineForBenchSpriteSort(int argc, const char* const* argv)
if (::benchmark::ReportUnrecognizedArguments(argc, &argv_for_benchmark[0]))
return -1;
- Platform::CoreInit();
gOpenRCT2Headless = true;
::benchmark::RunSpecifiedBenchmarks();
diff --git a/src/openrct2/command_line/SimulateCommands.cpp b/src/openrct2/command_line/SimulateCommands.cpp
index 1dfc7526dc..22fdca0712 100644
--- a/src/openrct2/command_line/SimulateCommands.cpp
+++ b/src/openrct2/command_line/SimulateCommands.cpp
@@ -39,8 +39,6 @@ static exitcode_t HandleSimulate(CommandLineArgEnumerator* argEnumerator)
return EXITCODE_FAIL;
}
- Platform::CoreInit();
-
const char* inputPath = argv[0];
uint32_t ticks = atol(argv[1]);
diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp
index 5533aad5f6..24ec108206 100644
--- a/src/openrct2/interface/Screenshot.cpp
+++ b/src/openrct2/interface/Screenshot.cpp
@@ -490,7 +490,6 @@ int32_t CommandLineForGfxbench(const char** argv, int32_t argc)
return -1;
}
- Platform::CoreInit();
int32_t iterationCount = 5;
if (argc == 2)
{
@@ -587,7 +586,6 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti
DrawPixelInfo dpi;
try
{
- Platform::CoreInit();
bool customLocation = false;
bool centreMapX = false;
bool centreMapY = false;
diff --git a/src/openrct2/platform/Platform.Common.cpp b/src/openrct2/platform/Platform.Common.cpp
index 051925b9f8..bbb492db7d 100644
--- a/src/openrct2/platform/Platform.Common.cpp
+++ b/src/openrct2/platform/Platform.Common.cpp
@@ -37,10 +37,6 @@ static constexpr std::array _prohibitedCharacters = { '/' };
namespace Platform
{
- void CoreInit()
- {
- }
-
CurrencyType GetCurrencyValue(const char* currCode)
{
if (currCode == nullptr || strlen(currCode) < 3)
diff --git a/src/openrct2/platform/Platform.h b/src/openrct2/platform/Platform.h
index 607387ec9a..ce97861555 100644
--- a/src/openrct2/platform/Platform.h
+++ b/src/openrct2/platform/Platform.h
@@ -45,8 +45,6 @@ struct RealWorldTime;
namespace Platform
{
- // Called very early in the program before parsing commandline arguments.
- void CoreInit();
std::string GetEnvironmentVariable(std::string_view name);
std::string GetFolderPath(SPECIAL_FOLDER folder);
std::string GetInstallPath();
diff --git a/test/tests/MultiLaunch.cpp b/test/tests/MultiLaunch.cpp
index fc1146bca3..ed0af996eb 100644
--- a/test/tests/MultiLaunch.cpp
+++ b/test/tests/MultiLaunch.cpp
@@ -34,7 +34,6 @@ TEST(MultiLaunchTest, all)
gOpenRCT2Headless = true;
gOpenRCT2NoGraphics = true;
- Platform::CoreInit();
for (int i = 0; i < 3; i++)
{
auto context = CreateContext();
diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp
index 32aa2c93f5..71fbe3038e 100644
--- a/test/tests/Pathfinding.cpp
+++ b/test/tests/Pathfinding.cpp
@@ -29,8 +29,6 @@ class PathfindingTestBase : public testing::Test
public:
static void SetUpTestCase()
{
- Platform::CoreInit();
-
gOpenRCT2Headless = true;
gOpenRCT2NoGraphics = true;
_context = CreateContext();
diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp
index 43c147d540..238e89b839 100644
--- a/test/tests/PlayTests.cpp
+++ b/test/tests/PlayTests.cpp
@@ -41,7 +41,6 @@ static std::unique_ptr localStartGame(const std::string& parkPath)
{
gOpenRCT2Headless = true;
gOpenRCT2NoGraphics = true;
- Platform::CoreInit();
auto context = CreateContext();
if (!context->Initialise())
diff --git a/test/tests/ReplayTests.cpp b/test/tests/ReplayTests.cpp
index 7aee8464de..4d450480b4 100644
--- a/test/tests/ReplayTests.cpp
+++ b/test/tests/ReplayTests.cpp
@@ -73,7 +73,6 @@ TEST_P(ReplayTests, RunReplay)
{
gOpenRCT2Headless = true;
gOpenRCT2NoGraphics = true;
- Platform::CoreInit();
auto testData = GetParam();
auto replayFile = testData.filePath;
diff --git a/test/tests/RideRatings.cpp b/test/tests/RideRatings.cpp
index ba75d89d20..9ec03030a2 100644
--- a/test/tests/RideRatings.cpp
+++ b/test/tests/RideRatings.cpp
@@ -65,7 +65,6 @@ protected:
gOpenRCT2Headless = true;
gOpenRCT2NoGraphics = true;
- Platform::CoreInit();
auto context = CreateContext();
bool initialised = context->Initialise();
ASSERT_TRUE(initialised);
diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp
index 58436b15fd..5cd4541094 100644
--- a/test/tests/S6ImportExportTests.cpp
+++ b/test/tests/S6ImportExportTests.cpp
@@ -187,8 +187,6 @@ TEST(S6ImportExportBasic, all)
gOpenRCT2Headless = true;
gOpenRCT2NoGraphics = true;
- Platform::CoreInit();
-
MemoryStream importBuffer;
MemoryStream exportBuffer;
MemoryStream snapshotStream;
@@ -233,8 +231,6 @@ TEST(S6ImportExportAdvanceTicks, all)
gOpenRCT2Headless = true;
gOpenRCT2NoGraphics = true;
- Platform::CoreInit();
-
MemoryStream importBuffer;
MemoryStream exportBuffer;
MemoryStream snapshotStream;