diff --git a/Source/Engine/Platform/SDL/SDLPlatform.cpp b/Source/Engine/Platform/SDL/SDLPlatform.cpp index 3a15e116f..a70a91e99 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.cpp +++ b/Source/Engine/Platform/SDL/SDLPlatform.cpp @@ -319,7 +319,7 @@ Window* SDLPlatform::CreateWindow(const CreateWindowSettings& settings) return New(settings); } -#if !PLATFORM_WINDOWS +#if !PLATFORM_WINDOWS && !PLATFORM_WEB bool ReadStream(SDL_IOStream*& stream, char* buffer, int64 bufferLength, int64& bufferPosition, LogType logType, CreateProcessSettings& settings) { diff --git a/Source/Engine/Platform/SDL/SDLPlatform.h b/Source/Engine/Platform/SDL/SDLPlatform.h index 526a58875..9cc87a6e6 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.h +++ b/Source/Engine/Platform/SDL/SDLPlatform.h @@ -91,7 +91,7 @@ public: static Rectangle GetMonitorBounds(const Float2& screenPos); static Rectangle GetVirtualDesktopBounds(); static Window* CreateWindow(const CreateWindowSettings& settings); -#if !PLATFORM_WINDOWS +#if !PLATFORM_WINDOWS && !PLATFORM_WEB static int32 CreateProcess(CreateProcessSettings& settings); #endif }; diff --git a/Source/Engine/Platform/Web/WebPlatform.cpp b/Source/Engine/Platform/Web/WebPlatform.cpp index f9c703a22..8110efe57 100644 --- a/Source/Engine/Platform/Web/WebPlatform.cpp +++ b/Source/Engine/Platform/Web/WebPlatform.cpp @@ -27,6 +27,7 @@ namespace { CPUInfo Cpu; + double DateStart = emscripten_get_now(); }; void WebFileSystem::GetSpecialFolderPath(const SpecialFolder type, String& result) @@ -117,7 +118,7 @@ void WebPlatform::GetSystemTime(int32& year, int32& month, int32& dayOfWeek, int hour = time.tm_hour; minute = time.tm_min; second = time.tm_sec; - millisecond = abs((int64)emscripten_get_now()) % 1000; // Fake it based on other timer + millisecond = (int64)(emscripten_get_now() - DateStart) % 1000; // Fake it based on other timer } void WebPlatform::GetUTCTime(int32& year, int32& month, int32& dayOfWeek, int32& day, int32& hour, int32& minute, int32& second, int32& millisecond) @@ -136,7 +137,7 @@ void WebPlatform::GetUTCTime(int32& year, int32& month, int32& dayOfWeek, int32& hour = time.tm_hour; minute = time.tm_min; second = time.tm_sec; - millisecond = abs((int64)emscripten_get_now()) % 1000; // Fake it based on other timer + millisecond = (int64)(emscripten_get_now() - DateStart) % 1000; // Fake it based on other timer } #if !BUILD_RELEASE