Skip to content

Commit 9e6813a

Browse files
authored
HTML5: Maintenance (#852)
1 parent ad84ed7 commit 9e6813a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

platform/emscripten/Rtt_EmscriptenContext.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,16 @@ namespace Rtt
530530
//flags |= (fMode == "fullscreen") ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_RESIZABLE;
531531
flags |= SDL_WINDOW_RESIZABLE;
532532
fWindow = SDL_CreateWindow(title.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, (int)scaledWidth, (int)scaledHeight, flags);
533+
534+
int checkWidth, checkHeight;
535+
536+
SDL_GetWindowSize(fWindow, &checkWidth, &checkHeight);
537+
538+
if (checkWidth == 0 || checkHeight == 0)
539+
{
540+
SDL_SetWindowSize(fWindow, fWidth, fHeight);
541+
}
542+
533543
SDL_GL_CreateContext(fWindow);
534544
SDL_GL_SetSwapInterval(1); // Enable vsync
535545
fPlatform->setWindow(fWindow, fOrientation);

platform/emscripten/Rtt_EmscriptenPlatform.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,11 @@ var platformLibrary =
637637
},
638638

639639
jsContextSyncFS: function() {
640+
if (Module.idbfsSynced == 0)
641+
{
642+
return;
643+
}
644+
640645
Module.idbfsSynced = 0;
641646
try {
642647
FS.syncfs(function (err) {

0 commit comments

Comments
 (0)