Skip to content

Commit

Permalink
Merge pull request #3265 from Ghabry/fix-3ds-build
Browse files Browse the repository at this point in the history
Fix 3ds build
  • Loading branch information
fdelapena authored Sep 2, 2024
2 parents 5d20c6d + 425da58 commit a6521c4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
14 changes: 11 additions & 3 deletions src/decoder_oggvorbis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,29 @@ bool OggVorbisDecoder::Open(Filesystem_Stream::InputStream stream) {
vorbis_comment* vc = ov_comment(ovf, -1);
if (vc) {
// RPG VX loop support
const char* str = vorbis_comment_query(vc, "LOOPSTART", 0);
// Workaround conversion of string constant to char warning because
// of tremor using a different signature.
#if defined(HAVE_TREMOR)
using char_type = char*;
#else
using char_type = const char*;
#endif

const char* str = vorbis_comment_query(vc, (char_type)"LOOPSTART", 0);
if (str) {
auto total = ov_pcm_total(ovf, -1) ;
loop.start = std::min<int64_t>(atoi(str), total);
if (loop.start >= 0) {
loop.looping = true;
loop.end = total;
str = vorbis_comment_query(vc, "LOOPLENGTH", 0);
str = vorbis_comment_query(vc, (char_type)"LOOPLENGTH", 0);
if (str) {
int len = atoi(str);
if (len >= 0) {
loop.end = std::min<int64_t>(loop.start + len, total);
}
} else {
str = vorbis_comment_query(vc, "LOOPEND", 0);
str = vorbis_comment_query(vc, (char_type)"LOOPEND", 0);
if (str) {
int end = atoi(str);
if (end >= 0) {
Expand Down
6 changes: 3 additions & 3 deletions src/game_interpreter_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,9 @@ bool Game_Interpreter_Map::CommandEasyRpgWaitForSingleMovement(lcf::rpg::EventCo

_state.easyrpg_parameters.resize(3);

int& event_id = _state.easyrpg_parameters[0];
int& failure_limit = _state.easyrpg_parameters[1];
int& output_var = _state.easyrpg_parameters[2];
auto& event_id = _state.easyrpg_parameters[0];
auto& failure_limit = _state.easyrpg_parameters[1];
auto& output_var = _state.easyrpg_parameters[2];

if (!_state.easyrpg_active) {
event_id = ValueOrVariable(com.parameters[0], com.parameters[1]);
Expand Down

0 comments on commit a6521c4

Please sign in to comment.