From 34bddc7db1c16e32db0fdb94af329954554d0f1f Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 17 Feb 2026 13:43:54 +0100 Subject: [PATCH] Minor fix --- Source/Engine/Engine/CommandLine.cpp | 8 ++++++++ Source/Engine/Engine/Engine.cpp | 24 +++++++----------------- Source/Engine/Main/Web/main.cpp | 2 -- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/Source/Engine/Engine/CommandLine.cpp b/Source/Engine/Engine/CommandLine.cpp index f8823d961..7ee868243 100644 --- a/Source/Engine/Engine/CommandLine.cpp +++ b/Source/Engine/Engine/CommandLine.cpp @@ -170,6 +170,14 @@ bool CommandLine::Parse(const Char* cmdLine) PARSE_BOOL_SWITCH("-shaderprofile ", ShaderProfile); #endif +#if FLAX_TESTS + // Configure engine for test running environment + Options.Headless = true; + Options.Null = true; + Options.Mute = true; + Options.Std = true; +#endif + return false; } diff --git a/Source/Engine/Engine/Engine.cpp b/Source/Engine/Engine/Engine.cpp index 1458fb52e..7a9ae0969 100644 --- a/Source/Engine/Engine/Engine.cpp +++ b/Source/Engine/Engine/Engine.cpp @@ -93,16 +93,8 @@ int32 Engine::OnInit(const Char* cmdLine) return -1; } -#if FLAX_TESTS - // Configure engine for test running environment - CommandLine::Options.Headless = true; - CommandLine::Options.Null = true; - CommandLine::Options.Mute = true; - CommandLine::Options.Std = true; -#endif - + // Init platform Platform::SetHighDpiAwarenessEnabled(!CommandLine::Options.LowDPI.IsTrue()); - if (Platform::Init()) { Platform::Fatal(TEXT("Cannot init platform.")); @@ -111,8 +103,9 @@ int32 Engine::OnInit(const Char* cmdLine) #if COMPILE_WITH_PROFILER InitProfilerMemory(cmdLine, 1); #endif - Time::StartupTime = DateTime::Now(); + + // Setup paths and folders Globals::StartupFolder = Globals::BinariesFolder = Platform::GetMainDirectory(); #if USE_EDITOR Globals::StartupFolder /= TEXT("../../../.."); @@ -127,26 +120,23 @@ int32 Engine::OnInit(const Char* cmdLine) #endif StringUtils::PathRemoveRelativeParts(Globals::StartupFolder); FileSystem::NormalizePath(Globals::BinariesFolder); - FileSystem::GetSpecialFolderPath(SpecialFolder::Temporary, Globals::TemporaryFolder); if (Globals::TemporaryFolder.IsEmpty()) Platform::Fatal(TEXT("Failed to gather temporary folder directory.")); Globals::TemporaryFolder /= Guid::New().ToString(Guid::FormatType::D); // Load game info or project info - { - const int32 result = Application::LoadProduct(); - if (result != 0) - return result; - } + const int32 result = Application::LoadProduct(); + if (result != 0) + return result; + // Init logging EngineImpl::InitPaths(); EngineImpl::InitLog(); #if USE_EDITOR if (Editor::CheckProjectUpgrade()) { - // End LOG(Warning, "Loading project cancelled. Closing..."); #if LOG_ENABLE Log::Logger::Dispose(); diff --git a/Source/Engine/Main/Web/main.cpp b/Source/Engine/Main/Web/main.cpp index c70be4a99..64a09fdda 100644 --- a/Source/Engine/Main/Web/main.cpp +++ b/Source/Engine/Main/Web/main.cpp @@ -7,8 +7,6 @@ class PlatformMain { - int32 State = 0; - static void Loop() { // Tick engine