1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-17 13:02:27 +01:00

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
2025-07-27 16:44:08 -05:00
committed by GitHub
parent 19035ec2eb
commit b92a005459
3 changed files with 13 additions and 0 deletions

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)
------------------------------------------------------------------------

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 \

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