[Scummvm-cvs-logs] scummvm master -> 56569c84a1b03b80f309e1eb0f4675ddb788a453
Strangerke
Strangerke at scummvm.org
Tue May 31 23:12:17 CEST 2016
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:
56569c84a1 GNAP: Change two variables to bool, remove two useless variables
Commit: 56569c84a1b03b80f309e1eb0f4675ddb788a453
https://github.com/scummvm/scummvm/commit/56569c84a1b03b80f309e1eb0f4675ddb788a453
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-05-31T23:03:43+02:00
Commit Message:
GNAP: Change two variables to bool, remove two useless variables
Changed paths:
engines/gnap/gnap.cpp
engines/gnap/gnap.h
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp
index c9ea940..7681818 100644
--- a/engines/gnap/gnap.cpp
+++ b/engines/gnap/gnap.cpp
@@ -264,11 +264,11 @@ void GnapEngine::updateEvents() {
_debugger->onFrame();
}
- _keyPressState[event.kbd.keycode] = 1;
- _keyDownState[event.kbd.keycode] = 1;
+ _keyPressState[event.kbd.keycode] = true;
+ _keyDownState[event.kbd.keycode] = true;
break;
case Common::EVENT_KEYUP:
- _keyDownState[event.kbd.keycode] = 0;
+ _keyDownState[event.kbd.keycode] = false;
break;
case Common::EVENT_MOUSEMOVE:
_mousePos = event.mouse;
@@ -988,21 +988,19 @@ void GnapEngine::screenEffect(int dir, byte r, byte g, byte b) {
}
bool GnapEngine::isKeyStatus1(int key) {
- return _keyPressState[key] != 0;
+ return _keyPressState[key];
}
bool GnapEngine::isKeyStatus2(int key) {
- return _keyDownState[key] != 0;
+ return _keyDownState[key];
}
void GnapEngine::clearKeyStatus1(int key) {
- _keyPressState[key] = 0;
- _keyDownState[key] = 0;
+ _keyPressState[key] = false;
+ _keyDownState[key] = false;
}
void GnapEngine::clearAllKeyStatus1() {
- _keyStatus1[0] = 0;
- _keyStatus1[1] = 0;
memset(_keyPressState, 0, sizeof(_keyPressState));
memset(_keyDownState, 0, sizeof(_keyDownState));
}
diff --git a/engines/gnap/gnap.h b/engines/gnap/gnap.h
index 2966572..dbefa31 100644
--- a/engines/gnap/gnap.h
+++ b/engines/gnap/gnap.h
@@ -253,8 +253,8 @@ public:
int _lastUpdateClock;
bool _gameDone;
- byte _keyPressState[512];
- byte _keyDownState[512];
+ bool _keyPressState[512];
+ bool _keyDownState[512];
bool _isPaused;
Graphics::Surface *_pauseSprite;
@@ -263,8 +263,6 @@ public:
MouseButtonState _mouseButtonState;
MouseButtonState _mouseClickState;
- uint32 _keyStatus1[2];
-
bool _sceneSavegameLoaded, _wasSavegameLoaded;
Graphics::Surface *_backgroundSurface;
More information about the Scummvm-git-logs
mailing list