aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2016-05-31 23:03:43 +0200
committerStrangerke2016-05-31 23:03:43 +0200
commit56569c84a1b03b80f309e1eb0f4675ddb788a453 (patch)
tree87809ac084d7a567771663b815e47636c3cad98b
parent6c1e59cf44960f4849b4f6d8aaff0e379bde860a (diff)
downloadscummvm-rg350-56569c84a1b03b80f309e1eb0f4675ddb788a453.tar.gz
scummvm-rg350-56569c84a1b03b80f309e1eb0f4675ddb788a453.tar.bz2
scummvm-rg350-56569c84a1b03b80f309e1eb0f4675ddb788a453.zip
GNAP: Change two variables to bool, remove two useless variables
-rw-r--r--engines/gnap/gnap.cpp16
-rw-r--r--engines/gnap/gnap.h6
2 files changed, 9 insertions, 13 deletions
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp
index c9ea940933..76818181a5 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 29665728d5..dbefa31795 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;