aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/base_keyboard_state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/base/base_keyboard_state.cpp')
-rw-r--r--engines/wintermute/base/base_keyboard_state.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/engines/wintermute/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp
index 03f9929eee..3bad8f6012 100644
--- a/engines/wintermute/base/base_keyboard_state.cpp
+++ b/engines/wintermute/base/base_keyboard_state.cpp
@@ -84,9 +84,13 @@ bool BaseKeyboardState::scCallMethod(ScScript *script, ScStack *stack, ScStack *
if (val->_type == VAL_STRING && strlen(val->getString()) > 0) {
const char *str = val->getString();
char temp = str[0];
- if (temp >= 'A' && temp <= 'Z') temp += ('a' - 'A');
+ if (temp >= 'A' && temp <= 'Z') {
+ temp += ('a' - 'A');
+ }
vKey = (int)temp;
- } else vKey = val->getInt();
+ } else {
+ vKey = val->getInt();
+ }
warning("BKeyboardState doesnt yet have state-support %d", vKey); //TODO;
// Uint8 *state = SDL_GetKeyboardState(NULL);
@@ -95,9 +99,9 @@ bool BaseKeyboardState::scCallMethod(ScScript *script, ScStack *stack, ScStack *
stack->pushBool(isDown);
return STATUS_OK;
+ } else {
+ return BaseScriptable::scCallMethod(script, stack, thisStack, name);
}
-
- else return BaseScriptable::scCallMethod(script, stack, thisStack, name);
}
@@ -122,7 +126,9 @@ ScValue *BaseKeyboardState::scGetProperty(const char *name) {
key[0] = (char)_currentCharCode;
key[1] = '\0';
_scValue->setString(key);
- } else _scValue->setString("");
+ } else {
+ _scValue->setString("");
+ }
return _scValue;
}
@@ -165,9 +171,9 @@ ScValue *BaseKeyboardState::scGetProperty(const char *name) {
else if (strcmp(name, "IsControl") == 0) {
_scValue->setBool(_currentControl);
return _scValue;
+ } else {
+ return BaseScriptable::scGetProperty(name);
}
-
- else return BaseScriptable::scGetProperty(name);
}
@@ -255,7 +261,9 @@ bool BaseKeyboardState::isAltDown() {
//////////////////////////////////////////////////////////////////////////
uint32 BaseKeyboardState::keyCodeToVKey(Common::Event *event) {
- if (event->type != Common::EVENT_KEYDOWN) return 0;
+ if (event->type != Common::EVENT_KEYDOWN) {
+ return 0;
+ }
switch (event->kbd.keycode) {
case Common::KEYCODE_KP_ENTER: