Fix Switch runtime setup

This commit is contained in:
2021-07-03 19:13:41 +02:00
parent 98d29ff5dc
commit 93838b4f25
4 changed files with 23 additions and 5 deletions
+3 -1
View File
@@ -13,6 +13,8 @@
#include "Engine/Debug/Exceptions/Exceptions.h"
#include <iostream>
#define LOG_ENABLE_FILE (!PLATFORM_SWITCH)
namespace
{
bool LogAfterInit = false, IsDuringLog = false;
@@ -169,7 +171,7 @@ void Log::Logger::Dispose()
bool Log::Logger::IsLogEnabled()
{
#if LOG_ENABLE
#if LOG_ENABLE && LOG_ENABLE_FILE
return !CommandLine::Options.NoLog.HasValue();
#else
return false;
+8 -2
View File
@@ -29,10 +29,9 @@ public:
ObjectsRemovalServiceService()
: EngineService(TEXT("Objects Removal Service"), -1000)
{
LastUpdate = DateTime::NowUTC();
LastUpdateGameTime = 0;
}
bool Init() override;
void LateUpdate() override;
void Dispose() override;
};
@@ -174,6 +173,13 @@ void ObjectsRemovalService::Flush(float dt, float gameDelta)
}
}
bool ObjectsRemovalServiceService::Init()
{
LastUpdate = DateTime::NowUTC();
LastUpdateGameTime = 0;
return false;
}
void ObjectsRemovalServiceService::LateUpdate()
{
PROFILE_CPU();
+2
View File
@@ -549,6 +549,7 @@ void EngineImpl::InitPaths()
if (!Globals::StartupFolder.IsANSI())
Platform::Fatal(TEXT("Cannot start application in directory which name contains non-ANSI characters."));
#if !PLATFORM_SWITCH
// Setup directories
if (FileSystem::DirectoryExists(Globals::TemporaryFolder))
FileSystem::DeleteDirectory(Globals::TemporaryFolder);
@@ -559,6 +560,7 @@ void EngineImpl::InitPaths()
if (FileSystem::CreateDirectory(Globals::TemporaryFolder))
Platform::Fatal(TEXT("Cannot create temporary directory."));
}
#endif
#if USE_EDITOR
if (!FileSystem::DirectoryExists(Globals::ProjectContentFolder))
FileSystem::CreateDirectory(Globals::ProjectContentFolder);
@@ -409,7 +409,7 @@ bool MCore::LoadEngine()
mono_trace_set_level_string("warning");
}
#if MONO_DEBUG_ENABLE
#if MONO_DEBUG_ENABLE && !PLATFORM_SWITCH
StringAnsi debuggerIp = "127.0.0.1";
uint16 debuggerPort = 41000 + Platform::GetCurrentProcessId() % 1000;
if (CommandLine::Options.DebuggerAddress.HasValue())
@@ -484,7 +484,15 @@ bool MCore::LoadEngine()
mono_dl_fallback_register(OnMonoLinuxDlOpen, OnMonoLinuxDlSym, nullptr, nullptr);
#endif
#endif
mono_config_parse(nullptr);
const char* configPath = nullptr;
#if PLATFORM_SWITCH
MString configPathBuf = (Globals::MonoPath / TEXT("/etc/mono/config")).ToStringAnsi();
configPath = *configPathBuf;
const MString assembliesPath = (Globals::MonoPath / TEXT("/lib/mono/4.5")).ToStringAnsi();
//mono_set_assemblies_path(*assembliesPath);
//setenv("MONO_PATH", *assembliesPath, 1);
#endif
mono_config_parse(configPath);
#if USE_MONO_PROFILER
// Init profiler