[Scummvm-git-logs] scummvm master -> 796f54ff895a308220b2b6162ab9d742274cf1c5
mgerhardy
noreply at scummvm.org
Thu Sep 29 06:34:37 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
796f54ff89 TWINE: fixed endless magic ball action when console was activated
Commit: 796f54ff895a308220b2b6162ab9d742274cf1c5
https://github.com/scummvm/scummvm/commit/796f54ff895a308220b2b6162ab9d742274cf1c5
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2022-09-29T04:55:37+02:00
Commit Message:
TWINE: fixed endless magic ball action when console was activated
related to https://bugs.scummvm.org/ticket/13675
Changed paths:
engines/twine/debugger/console.cpp
engines/twine/debugger/console.h
engines/twine/input.cpp
engines/twine/input.h
diff --git a/engines/twine/debugger/console.cpp b/engines/twine/debugger/console.cpp
index 2fbd0388d48..aa4cfe03593 100644
--- a/engines/twine/debugger/console.cpp
+++ b/engines/twine/debugger/console.cpp
@@ -78,6 +78,16 @@ TwinEConsole::TwinEConsole(TwinEEngine *engine) : _engine(engine), GUI::Debugger
TwinEConsole::~TwinEConsole() {
}
+void TwinEConsole::preEnter() {
+ _engine->_input->resetActionStates();
+ Super::preEnter();
+}
+
+void TwinEConsole::postEnter() {
+ _engine->_input->resetActionStates();
+ Super::postEnter();
+}
+
#define TOGGLE_DEBUG(var, description) \
if ((var)) { \
debugPrintf("Disabling " description); \
diff --git a/engines/twine/debugger/console.h b/engines/twine/debugger/console.h
index d8f010d525e..311480e5daa 100644
--- a/engines/twine/debugger/console.h
+++ b/engines/twine/debugger/console.h
@@ -31,6 +31,7 @@ class TwinEEngine;
class TwinEConsole : public GUI::Debugger {
private:
+ using Super = GUI::Debugger;
TwinEEngine *_engine;
bool doToggleSceneryView(int argc, const char **argv);
@@ -70,6 +71,10 @@ private:
bool doDumpFile(int argc, const char **argv);
bool doSetHolomapTrajectory(int argc, const char **argv);
+protected:
+ void preEnter() override;
+ void postEnter() override;
+
public:
TwinEConsole(TwinEEngine *engine);
~TwinEConsole() override;
diff --git a/engines/twine/input.cpp b/engines/twine/input.cpp
index ee35c9cda4e..f6d8cd82ee6 100644
--- a/engines/twine/input.cpp
+++ b/engines/twine/input.cpp
@@ -62,6 +62,12 @@ bool Input::toggleActionIfActive(TwinEActionType actionType) {
return false;
}
+void Input::resetActionStates() {
+ for (int i = 0; i < TwinEActionType::Max; ++i) {
+ _actionStates[i] = false;
+ }
+}
+
bool Input::toggleAbortAction() {
bool abortState = false;
abortState |= toggleActionIfActive(TwinEActionType::CutsceneAbort);
diff --git a/engines/twine/input.h b/engines/twine/input.h
index 2828f65ac17..285ef80affe 100644
--- a/engines/twine/input.h
+++ b/engines/twine/input.h
@@ -143,6 +143,7 @@ public:
* @c true anymore
*/
bool toggleActionIfActive(TwinEActionType actionType);
+ void resetActionStates();
bool toggleAbortAction();
More information about the Scummvm-git-logs
mailing list