JANITORIAL: Rename shouldRTL, resetRTL and FORCE_RTL

This commit is contained in:
mataniko 2020-05-11 08:47:44 -04:00 committed by Eugene Sandulenko
parent 581a6ec7d6
commit 321a02aff2
10 changed files with 23 additions and 23 deletions

View file

@ -41,7 +41,7 @@ DefaultEventManager::DefaultEventManager(Common::EventSource *boss) :
_buttonState(0), _buttonState(0),
_modifierState(0), _modifierState(0),
_shouldQuit(false), _shouldQuit(false),
_shouldRTL(false), _shouldReturnToLauncher(false),
_confirmExitDialogActive(false) { _confirmExitDialogActive(false) {
assert(boss); assert(boss);
@ -149,7 +149,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
if (_shouldQuit) if (_shouldQuit)
event.type = Common::EVENT_QUIT; event.type = Common::EVENT_QUIT;
else if (_shouldRTL) else if (_shouldReturnToLauncher)
event.type = Common::EVENT_RETURN_TO_LAUNCHER; event.type = Common::EVENT_RETURN_TO_LAUNCHER;
break; break;
#ifdef ENABLE_VKEYBD #ifdef ENABLE_VKEYBD
@ -174,9 +174,9 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
if (g_engine) if (g_engine)
pt = g_engine->pauseEngine(); pt = g_engine->pauseEngine();
GUI::MessageDialog alert(_("Do you really want to return to the Launcher?"), _("Launcher"), _("Cancel")); GUI::MessageDialog alert(_("Do you really want to return to the Launcher?"), _("Launcher"), _("Cancel"));
forwardEvent = _shouldRTL = (alert.runModal() == GUI::kMessageOK); forwardEvent = _shouldReturnToLauncher = (alert.runModal() == GUI::kMessageOK);
} else } else
_shouldRTL = true; _shouldReturnToLauncher = true;
break; break;
case Common::EVENT_MUTE: case Common::EVENT_MUTE:

View file

@ -56,7 +56,7 @@ class DefaultEventManager : public Common::EventManager, Common::EventObserver {
int _buttonState; int _buttonState;
int _modifierState; int _modifierState;
bool _shouldQuit; bool _shouldQuit;
bool _shouldRTL; bool _shouldReturnToLauncher;
bool _confirmExitDialogActive; bool _confirmExitDialogActive;
public: public:
@ -72,9 +72,9 @@ public:
virtual int getButtonState() const override { return _buttonState; } virtual int getButtonState() const override { return _buttonState; }
virtual int getModifierState() const override { return _modifierState; } virtual int getModifierState() const override { return _modifierState; }
virtual int shouldQuit() const override { return _shouldQuit; } virtual int shouldQuit() const override { return _shouldQuit; }
virtual int shouldRTL() const override { return _shouldRTL; } virtual int shouldReturnToLauncher() const override { return _shouldReturnToLauncher; }
virtual void resetRTL() override { _shouldRTL = false; } virtual void resetReturnToLauncher() override { _shouldReturnToLauncher = false; }
#ifdef FORCE_RTL #ifdef FORCE_RETURN_TO_LAUNCHER
virtual void resetQuit() override { _shouldQuit = false; } virtual void resetQuit() override { _shouldQuit = false; }
#endif #endif

View file

@ -341,7 +341,7 @@ bool OSystem_3DS::pollEvent(Common::Event &event) {
aptMainLoop(); // Call apt hook when necessary aptMainLoop(); // Call apt hook when necessary
// If magnify mode is on when returning to Launcher, turn it off // If magnify mode is on when returning to Launcher, turn it off
if (_eventManager->shouldRTL()) { if (_eventManager->shouldReturnToLauncher()) {
if (_magnifyMode == MODE_MAGON) { if (_magnifyMode == MODE_MAGON) {
_magnifyMode = MODE_MAGOFF; _magnifyMode = MODE_MAGOFF;
updateSize(); updateSize();

View file

@ -98,7 +98,7 @@ FLAGS += -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-unused-paramete
CFLAGS = $(FLAGS) -std=c99 CFLAGS = $(FLAGS) -std=c99
CXXFLAGS = $(FLAGS) -Wnon-virtual-dtor -Wno-reorder -fno-exceptions -fno-rtti CXXFLAGS = $(FLAGS) -Wnon-virtual-dtor -Wno-reorder -fno-exceptions -fno-rtti
DEFINES = -D_EE -D__PLAYSTATION2__ -D__NEW_PS2SDK__ -DUSE_ZLIB -DFORCE_RTL -DDATA_PATH=\"host:data\" DEFINES = -D_EE -D__PLAYSTATION2__ -D__NEW_PS2SDK__ -DUSE_ZLIB -DFORCE_RETURN_TO_LAUNCHER -DDATA_PATH=\"host:data\"
DEFINES += -DDISABLE_SAVEGAME_SORTING -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL -DDISABLE_SID -DDISABLE_NES_APU DEFINES += -DDISABLE_SAVEGAME_SORTING -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL -DDISABLE_SID -DDISABLE_NES_APU
# DEFINES += -DLOGORRHEIC # DEFINES += -DLOGORRHEIC

View file

@ -51,7 +51,7 @@ FLAGS += -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-unused-paramete
CFLAGS = $(FLAGS) -std=c99 CFLAGS = $(FLAGS) -std=c99
CXXFLAGS = $(FLAGS) -Wnon-virtual-dtor -Wno-reorder -fno-exceptions -fno-rtti CXXFLAGS = $(FLAGS) -Wnon-virtual-dtor -Wno-reorder -fno-exceptions -fno-rtti
DEFINES = -D_EE -D__PLAYSTATION2__ -D__NEW_PS2SDK__ -DUSE_ZLIB -DFORCE_RTL -DDATA_PATH=\"host:data\" DEFINES = -D_EE -D__PLAYSTATION2__ -D__NEW_PS2SDK__ -DUSE_ZLIB -DFORCE_RETURN_TO_LAUNCHER -DDATA_PATH=\"host:data\"
DEFINES += -DDISABLE_SAVEGAME_SORTING -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL -DDISABLE_SID -DDISABLE_NES_APU DEFINES += -DDISABLE_SAVEGAME_SORTING -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL -DDISABLE_SID -DDISABLE_NES_APU
# DEFINES += -DLOGORRHEIC # DEFINES += -DLOGORRHEIC

View file

@ -584,13 +584,13 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
} }
// Quit unless an error occurred, or Return to launcher was requested // Quit unless an error occurred, or Return to launcher was requested
#ifndef FORCE_RTL #ifndef FORCE_RETURN_TO_LAUNCHER
if (result.getCode() == Common::kNoError && !g_system->getEventManager()->shouldRTL()) if (result.getCode() == Common::kNoError && !g_system->getEventManager()->shouldReturnToLauncher())
break; break;
#endif #endif
// Reset RTL flag in case we want to load another engine // Reset RTL flag in case we want to load another engine
g_system->getEventManager()->resetRTL(); g_system->getEventManager()->resetReturnToLauncher();
#ifdef FORCE_RTL #ifdef FORCE_RETURN_TO_LAUNCHER
g_system->getEventManager()->resetQuit(); g_system->getEventManager()->resetQuit();
#endif #endif
#ifdef ENABLE_EVENTRECORDER #ifdef ENABLE_EVENTRECORDER

View file

@ -492,14 +492,14 @@ public:
/** /**
* Should we return to the launcher? * Should we return to the launcher?
*/ */
virtual int shouldRTL() const = 0; virtual int shouldReturnToLauncher() const = 0;
/** /**
* Reset the "return to launcher" flag (as returned shouldRTL()) to false. * Reset the "return to launcher" flag (as returned shouldReturnToLauncher()) to false.
* Used when we have returned to the launcher. * Used when we have returned to the launcher.
*/ */
virtual void resetRTL() = 0; virtual void resetReturnToLauncher() = 0;
#ifdef FORCE_RTL #ifdef FORCE_RETURN_TO_LAUNCHER
virtual void resetQuit() = 0; virtual void resetQuit() = 0;
#endif #endif
// Optional: check whether a given key is currently pressed ???? // Optional: check whether a given key is currently pressed ????

2
configure vendored
View file

@ -3707,7 +3707,7 @@ case $_backend in
;; ;;
ps2) ps2)
append_var DEFINES "-D_EE" append_var DEFINES "-D_EE"
append_var DEFINES "-DFORCE_RTL" append_var DEFINES "-DFORCE_RETURN_TO_LAUNCHER"
append_var INCLUDES "-I$PS2SDK/ee/include" append_var INCLUDES "-I$PS2SDK/ee/include"
append_var INCLUDES "-I$PS2SDK/common/include" append_var INCLUDES "-I$PS2SDK/common/include"
append_var INCLUDES "-I$PS2SDK/ports/include" append_var INCLUDES "-I$PS2SDK/ports/include"

View file

@ -806,7 +806,7 @@ void Engine::quitGame() {
bool Engine::shouldQuit() { bool Engine::shouldQuit() {
Common::EventManager *eventMan = g_system->getEventManager(); Common::EventManager *eventMan = g_system->getEventManager();
return (eventMan->shouldQuit() || eventMan->shouldRTL()); return (eventMan->shouldQuit() || eventMan->shouldReturnToLauncher());
} }
GUI::Debugger *Engine::getOrCreateDebugger() { GUI::Debugger *Engine::getOrCreateDebugger() {

View file

@ -425,7 +425,7 @@ void EventManager::updateScreen() {
s->_screenUpdateTime = g_system->getMillis(); s->_screenUpdateTime = g_system->getMillis();
// Throttle the checking of shouldQuit() to 60fps as well, since // Throttle the checking of shouldQuit() to 60fps as well, since
// Engine::shouldQuit() invokes 2 virtual functions // Engine::shouldQuit() invokes 2 virtual functions
// (EventManager::shouldQuit() and EventManager::shouldRTL()), // (EventManager::shouldQuit() and EventManager::shouldReturnToLauncher()),
// which is very expensive to invoke constantly without any // which is very expensive to invoke constantly without any
// throttling at all. // throttling at all.
if (g_engine->shouldQuit()) if (g_engine->shouldQuit())