Skip to content

Commit

Permalink
TOON: Do not use KeyState::hasFlags when only presence of any flag sh…
Browse files Browse the repository at this point in the history
…ould be checked.

hasFlags has the semantics to check whether *all* of the supplied flags are
active. Toon looks like it rather wants to know whether any modifier is
active and thus not use hasFlags.
  • Loading branch information
Johannes Schickel committed Feb 14, 2014
1 parent 616d995 commit f5a77e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engines/toon/toon.cpp
Expand Up @@ -184,7 +184,7 @@ void ToonEngine::parseInput() {
Common::Event event;
while (_event->pollEvent(event)) {

bool hasModifier = event.kbd.hasFlags(Common::KBD_ALT|Common::KBD_CTRL|Common::KBD_SHIFT);
const bool hasModifier = (event.kbd.flags & (Common::KBD_ALT|Common::KBD_CTRL|Common::KBD_SHIFT)) != 0;
switch (event.type) {
case Common::EVENT_KEYDOWN:
if ((event.kbd.ascii == 27 || event.kbd.ascii == 32) && !hasModifier) {
Expand Down

0 comments on commit f5a77e1

Please sign in to comment.