Skip to content

Commit

Permalink
fix ifdefs and prevent music from failing to change with openal
Browse files Browse the repository at this point in the history
  • Loading branch information
Northfear committed Apr 7, 2021
1 parent cd54db0 commit 5b90f78
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion gemrb/core/Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1328,9 +1328,11 @@ int Interface::Init(InterfaceConfig* config)
CONFIG_INT("MouseFeedback", MouseFeedback = );
CONFIG_INT("GamepadPointerSpeed", GamepadPointerSpeed = );
CONFIG_INT("VitaKeepAspectRatio", VitaKeepAspectRatio = );
#ifdef VITA
CONFIG_INT("VitaBilinear", VitaBilinear = );
#endif
#ifdef VITA_CACHE
CONFIG_INT("VitaFileCache", VitaFileCache = );
CONFIG_INT("VitaBilinear", VitaBilinear = );
#endif

#undef CONFIG_INT
Expand Down
4 changes: 3 additions & 1 deletion gemrb/core/Interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -836,9 +836,11 @@ class GEM_EXPORT Interface
bool MultipleQuickSaves;
bool UseCorruptedHack;
int FeedbackLevel;
#ifdef VITA
bool VitaBilinear = true;
#endif
#ifdef VITA_CACHE
bool VitaFileCache = false;
bool VitaBilinear = true;
#endif

Variables *plugin_flags;
Expand Down
7 changes: 7 additions & 0 deletions gemrb/plugins/OpenALAudio/OpenALAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ static bool checkALError(const char* msg, log_level level) {
int error = alGetError();
if (error != AL_NO_ERROR) {
Log(level, "OpenAL", "%s: 0x%x - %s", msg, error, alGetString(error));
#ifdef VITA
// something fails on Vita BEFORE alGetSourcei on line ~905 with "0xa003 - Invalid Value" (so music change is failing)
// there's also a warning after alSourceStop in ResetMusic/Stop. Or was it triggered before too?
// lets ignore this error for now and pretend that everything is fine
if (error == 40963)
return false;
#endif
return true;
}
return false;
Expand Down

0 comments on commit 5b90f78

Please # to comment.