Skip to content

Commit

Permalink
WiiU: Further fixes
Browse files Browse the repository at this point in the history
- Fix OGG playback (Wii uses tremor, playback is fine)
- Prevent Fullscreen toggling via command when the setting is disabled

Allowing fullscreen toggling messes up the rendering on WiiU
  • Loading branch information
Ghabry committed Jan 16, 2025
1 parent cdac650 commit fa09f89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/decoder_oggvorbis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,14 @@ int OggVorbisDecoder::FillBuffer(uint8_t* buffer, int length) {
#ifdef HAVE_TREMOR
read = ov_read(ovf, reinterpret_cast<char*>(buffer + length - to_read), to_read, &section);
#else
read = ov_read(ovf, reinterpret_cast<char*>(buffer + length - to_read), to_read, 0/*LE*/, 2/*16bit*/, 1/*signed*/, &section);
# if defined(__WIIU__)
// FIXME: This is the endianess of the audio and not of the host but the byteswapping in ov_read does
// not sound like it works
int byte_order = 1; // BE
# else
int byte_order = 0; // LE
#endif
read = ov_read(ovf, reinterpret_cast<char*>(buffer + length - to_read), to_read, byte_order, 2/*16bit*/, 1/*signed*/, &section);
#endif
// stop decoding when error or end of file
if (read <= 0)
Expand Down
6 changes: 6 additions & 0 deletions src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4041,6 +4041,12 @@ bool Game_Interpreter::CommandToggleFullscreen(lcf::rpg::EventCommand const& /*
return true;
}

auto cfg = DisplayUi->GetConfig();
if (!cfg.fullscreen.IsOptionVisible() || cfg.fullscreen.IsLocked()) {
Output::Debug("ToggleFullscreen: Not supported on this platform");
return true;
}

DisplayUi->ToggleFullscreen();
return true;
}
Expand Down

0 comments on commit fa09f89

Please sign in to comment.