Merge remote-tracking branch 'origin/1.1' into linux-editor
# Conflicts: # Source/FlaxEngine.Gen.cs # Source/Tools/Flax.Build/Utilities/Utilities.cs
This commit is contained in:
@@ -51,6 +51,9 @@
|
||||
namespace EngineImpl
|
||||
{
|
||||
bool IsReady = false;
|
||||
#if !USE_EDITOR
|
||||
bool RunInBackground = false;
|
||||
#endif
|
||||
String CommandLine = nullptr;
|
||||
int32 Fps = 0, FpsAccumulatedFrames = 0;
|
||||
double FpsAccumulated = 0.0;
|
||||
@@ -133,6 +136,9 @@ int32 Engine::Main(const Char* cmdLine)
|
||||
Platform::BeforeRun();
|
||||
EngineImpl::InitMainWindow();
|
||||
Application::BeforeRun();
|
||||
#if !USE_EDITOR && (PLATFORM_WINDOWS || PLATFORM_LINUX)
|
||||
EngineImpl::RunInBackground = PlatformSettings::Get()->RunInBackground;
|
||||
#endif
|
||||
Log::Logger::WriteFloor();
|
||||
LOG_FLUSH();
|
||||
Time::OnBeforeRun();
|
||||
@@ -279,11 +285,7 @@ void Engine::OnUpdate()
|
||||
bool isGameRunning = true;
|
||||
if (mainWindow && !mainWindow->IsFocused())
|
||||
{
|
||||
#if PLATFORM_WINDOWS || PLATFORM_LINUX
|
||||
isGameRunning = PlatformSettings::Instance()->RunInBackground;
|
||||
#else
|
||||
isGameRunning = false;
|
||||
#endif
|
||||
isGameRunning = EngineImpl::RunInBackground;
|
||||
}
|
||||
Time::SetGamePaused(!isGameRunning);
|
||||
#endif
|
||||
@@ -393,8 +395,11 @@ const String& Engine::GetCommandLine()
|
||||
|
||||
JsonAsset* Engine::GetCustomSettings(const StringView& key)
|
||||
{
|
||||
const auto settings = GameSettings::Get();
|
||||
if (!settings)
|
||||
return nullptr;
|
||||
Guid assetId = Guid::Empty;
|
||||
GameSettings::CustomSettings.TryGet(key, assetId);
|
||||
settings->CustomSettings.TryGet(key, assetId);
|
||||
return Content::LoadAsync<JsonAsset>(assetId);
|
||||
}
|
||||
|
||||
@@ -463,7 +468,7 @@ void Engine::OnExit()
|
||||
|
||||
LOG_FLUSH();
|
||||
|
||||
// Kill all reaming threads
|
||||
// Kill all remaining threads
|
||||
ThreadRegistry::KillEmAll();
|
||||
|
||||
// Cleanup
|
||||
|
||||
Reference in New Issue
Block a user