Fix miliseconds in date on Emscripten and skip SDL create process (unsupported)

This commit is contained in:
2026-02-17 15:07:42 +01:00
parent 9772227146
commit 69cefb6822
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -319,7 +319,7 @@ Window* SDLPlatform::CreateWindow(const CreateWindowSettings& settings)
return New<SDLWindow>(settings);
}
#if !PLATFORM_WINDOWS
#if !PLATFORM_WINDOWS && !PLATFORM_WEB
bool ReadStream(SDL_IOStream*& stream, char* buffer, int64 bufferLength, int64& bufferPosition, LogType logType, CreateProcessSettings& settings)
{
+1 -1
View File
@@ -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
};
+3 -2
View File
@@ -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