TWINE: moved actionstates into keyboard struct

This commit is contained in:
Martin Gerhardy 2020-10-21 21:15:52 +02:00 committed by Eugene Sandulenko
parent 903e0cc18a
commit d8ad31f056
3 changed files with 4 additions and 4 deletions

View file

@ -96,6 +96,7 @@ static constexpr const struct ActionMapping {
static_assert(ARRAYSIZE(twineactions) == TwinEActionType::Max, "Unexpected action mapping array size");
struct Keyboard {
bool actionStates[TwinEActionType::Max] {false};
/** Skipped key - key1 */
int16 skippedKey = 0;
/** Pressed key - printTextVar12 */

View file

@ -915,7 +915,7 @@ void TwinEEngine::readKeys() {
uint8 localKey = 0;
switch (event.type) {
case Common::EVENT_CUSTOM_ENGINE_ACTION_END:
actionStates[event.customType] = false;
_keyboard.actionStates[event.customType] = false;
localKey = twineactions[event.customType].localKey;
break;
case Common::EVENT_CUSTOM_ENGINE_ACTION_START:
@ -929,12 +929,12 @@ void TwinEEngine::readKeys() {
break;
default:
localKey = twineactions[event.customType].localKey;
actionStates[event.customType] = true;
_keyboard.actionStates[event.customType] = true;
break;
}
} else {
localKey = twineactions[event.customType].localKey;
actionStates[event.customType] = true;
_keyboard.actionStates[event.customType] = true;
}
break;
case Common::EVENT_KEYUP:

View file

@ -153,7 +153,6 @@ private:
int32 isTimeFreezed = 0;
int32 saveFreezedTime = 0;
ActorMoveStruct loopMovePtr; // mainLoopVar1
bool actionStates[TwinEActionType::Max] {false};
public:
TwinEEngine(OSystem *system, Common::Language language, uint32 flags);