Enhance emscripten display settings (#24841)

* emscripten: Invoke HTML5 emscripten fullscreen API instead of using SDL

* emscripten: Disable OpenGL

* emscripten: Add fullscreen change to changelog
This commit is contained in:
Ethan O'Brien authored and GitHub committed 2025-07-27 23:44:08 +02:00
1 parent 19035ec2eb
commit b92a005459
3 files changed
+13

No files matched your search

+1
View File
@@ -19,6 +19,7 @@
- Fix: [#24829] The pattern of long grass across tiles is different to RCT1 and RCT2.
- Fix: [#24831] Park names are being overwritten for custom RCT1 scenarios that use competition id slots.
- Fix: [#24838] Not using localized word for conjunction when having multiple shortcuts for the same action.
- Fix: [#24841] Fullscreen options do not work correctly with Emscripten.
0.4.24 (2025-07-05)
------------------------------------------------------------------------
+1
View File
@@ -12,6 +12,7 @@ JSON_DIR=/usr/include/nlohmann/
emcmake cmake ../ \
-G Ninja \
-DDISABLE_NETWORK=ON \
-DDISABLE_OPENGL=ON \
-DDISABLE_HTTP=ON \
-DDISABLE_TTF=ON \
-DDISABLE_FLAC=ON \
+11
View File
@@ -182,6 +182,7 @@ public:
void SetFullscreenMode(FullscreenMode mode) override
{
#ifndef __EMSCRIPTEN__
static constexpr int32_t kSDLFullscreenFlags[] = {
0,
SDL_WINDOW_FULLSCREEN,
@@ -212,6 +213,16 @@ public:
// TODO try another display mode rather than just exiting the game
}
#else
if (mode == FullscreenMode::fullscreen)
{
emscripten_request_fullscreen("!canvas", false);
}
else if (mode == FullscreenMode::windowed)
{
emscripten_exit_fullscreen();
}
#endif // __EMSCRIPTEN__
}
const std::vector<Resolution>& GetFullscreenResolutions() override