Add various fixes for Web
This commit is contained in:
@@ -428,7 +428,9 @@ void LevelService::LateFixedUpdate()
|
||||
|
||||
void LevelService::Dispose()
|
||||
{
|
||||
// End scene actions
|
||||
ScopeLock lock(_sceneActionsLocker);
|
||||
_sceneActions.ClearDelete();
|
||||
|
||||
// Unload scenes
|
||||
unloadScenes();
|
||||
|
||||
@@ -357,6 +357,8 @@ StringView StringUtils::GetPathWithoutExtension(const StringView& path)
|
||||
void StringUtils::PathRemoveRelativeParts(String& path)
|
||||
{
|
||||
FileSystem::NormalizePath(path);
|
||||
if (path.Length() == 1 && path[0] == TEXT('/'))
|
||||
return;
|
||||
|
||||
Array<String> components;
|
||||
path.Split(TEXT('/'), components);
|
||||
|
||||
@@ -45,6 +45,11 @@ void ThreadBase::Kill(bool waitForJoin)
|
||||
if (!_isRunning)
|
||||
{
|
||||
ClearHandleInternal();
|
||||
if (_callAfterWork)
|
||||
{
|
||||
_callAfterWork = false;
|
||||
_runnable->AfterWork(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
ASSERT(GetID());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
#if PLATFORM_UNIX
|
||||
#if PLATFORM_UNIX && !PLATFORM_WEB
|
||||
|
||||
#include "UnixThread.h"
|
||||
#include "Engine/Core/Log.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#if PLATFORM_UNIX
|
||||
#if PLATFORM_UNIX && !PLATFORM_WEB
|
||||
|
||||
#include "Engine/Platform/Base/ThreadBase.h"
|
||||
#include <pthread.h>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "Engine/Core/Log.h"
|
||||
#include "Engine/Core/Types/String.h"
|
||||
#include "Engine/Core/Types/Version.h"
|
||||
#include "Engine/Core/Types/TimeSpan.h"
|
||||
#include "Engine/Core/Types/Guid.h"
|
||||
#include "Engine/Platform/CPUInfo.h"
|
||||
#include "Engine/Platform/MemoryStats.h"
|
||||
@@ -52,7 +51,7 @@ MemoryStats WebPlatform::GetMemoryStats()
|
||||
MemoryStats result;
|
||||
result.TotalPhysicalMemory = emscripten_get_heap_max();
|
||||
result.UsedPhysicalMemory = emscripten_get_heap_size();
|
||||
result.TotalVirtualMemory = result.TotalPhysicalMemory;
|
||||
result.TotalVirtualMemory = 2ull * 1024 * 1024 * 1024; // Max 2GB
|
||||
result.UsedVirtualMemory = result.UsedPhysicalMemory;
|
||||
result.ProgramSizeMemory = 0;
|
||||
return result;
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
#ifdef __EMSCRIPTEN_PTHREADS__
|
||||
return (uint64)pthread_self();
|
||||
#else
|
||||
return 0;
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
static String GetSystemName();
|
||||
|
||||
Reference in New Issue
Block a user