diff options
author | Martin Kiewitz | 2016-02-02 11:33:07 +0100 |
---|---|---|
committer | Martin Kiewitz | 2016-02-02 11:33:40 +0100 |
commit | 7aeadba863ed1893fa6095008d35b32ce5117749 (patch) | |
tree | 905d5e433331eb5ee2c99d7ac47a2f857c6e02d7 /engines/sci/graphics | |
parent | a9511e78d1a6594129aec973d8240cea4b93d2a1 (diff) | |
download | scummvm-rg350-7aeadba863ed1893fa6095008d35b32ce5117749.tar.gz scummvm-rg350-7aeadba863ed1893fa6095008d35b32ce5117749.tar.bz2 scummvm-rg350-7aeadba863ed1893fa6095008d35b32ce5117749.zip |
SCI: Removed ".data" from SciEvent
Was the ScummVM-system-Keycode, sometimes modified.
Changed Menu/Portrait/Controls32-code to use .character instead.
Cleaned up a bit of code in getScummVMEvent()
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/controls32.cpp | 10 | ||||
-rw-r--r-- | engines/sci/graphics/menu.cpp | 6 | ||||
-rw-r--r-- | engines/sci/graphics/portrait.cpp | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp index 90b5cd558c..1bd497ce98 100644 --- a/engines/sci/graphics/controls32.cpp +++ b/engines/sci/graphics/controls32.cpp @@ -79,7 +79,7 @@ void GfxControls32::kernelTexteditChange(reg_t controlObject) { // TODO: Implement mouse support for cursor change break; case SCI_EVENT_KEYBOARD: - switch (curEvent.data) { + switch (curEvent.character) { case SCI_KEY_BACKSPACE: if (cursorPos > 0) { cursorPos--; text.deleteChar(cursorPos); @@ -131,12 +131,12 @@ void GfxControls32::kernelTexteditChange(reg_t controlObject) { captureEvents = false; break; default: - if ((curEvent.modifiers & SCI_KEYMOD_CTRL) && curEvent.data == 99) { + if ((curEvent.modifiers & SCI_KEYMOD_CTRL) && curEvent.character == 'c') { // Control-C in earlier SCI games (SCI0 - SCI1 middle) // Control-C erases the whole line cursorPos = 0; text.clear(); textChanged = true; - } else if (curEvent.data > 31 && curEvent.data < 256 && textSize < maxChars) { + } else if (curEvent.character > 31 && curEvent.character < 256 && textSize < maxChars) { // insert pressed character textAddChar = true; textChanged = true; @@ -158,14 +158,14 @@ void GfxControls32::kernelTexteditChange(reg_t controlObject) { uint16 textWidth = 0; while (*textPtr) textWidth += font->getCharWidth((byte)*textPtr++); - textWidth += font->getCharWidth(curEvent.data); + textWidth += font->getCharWidth(curEvent.character); // Does it fit? if (textWidth >= rect.width()) { return; } - text.insertChar(curEvent.data, cursorPos++); + text.insertChar(curEvent.character, cursorPos++); // Note: the following checkAltInput call might make the text // too wide to fit, but SSCI fails to check that too. diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 9d92039111..eb3f5888c7 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -747,7 +747,7 @@ GuiMenuItemEntry *GfxMenu::interactiveWithKeyboard() { // - sierra didn't wrap around when changing item id // - sierra allowed item id to be 0, which didn't make any sense do { - switch (curEvent.data) { + switch (curEvent.character) { case SCI_KEY_ESC: _curMenuId = curItemEntry->menuId; _curItemId = curItemEntry->id; return NULL; @@ -776,10 +776,10 @@ GuiMenuItemEntry *GfxMenu::interactiveWithKeyboard() { newMenuId = newItemEntry->menuId; newItemId = newItemEntry->id; // if we do this step again because of a separator line -> don't repeat left/right, but go down - switch (curEvent.data) { + switch (curEvent.character) { case SCI_KEY_LEFT: case SCI_KEY_RIGHT: - curEvent.data = SCI_KEY_DOWN; + curEvent.character = SCI_KEY_DOWN; } } } while (newItemEntry->separatorLine); diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index cb425f3be9..045a923569 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -316,7 +316,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint g_sci->getEngineState()->wait(1); curEvent = _event->getSciEvent(SCI_EVENT_ANY); if (curEvent.type == SCI_EVENT_MOUSE_PRESS || - (curEvent.type == SCI_EVENT_KEYBOARD && curEvent.data == SCI_KEY_ESC) || + (curEvent.type == SCI_EVENT_KEYBOARD && curEvent.character == SCI_KEY_ESC) || g_sci->getEngineState()->abortScriptProcessing == kAbortQuitGame || g_sci->getEngineState()->_delayedRestoreGame) userAbort = true; @@ -339,7 +339,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint g_sci->getEngineState()->wait(1); curEvent = _event->getSciEvent(SCI_EVENT_ANY); if (curEvent.type == SCI_EVENT_MOUSE_PRESS || - (curEvent.type == SCI_EVENT_KEYBOARD && curEvent.data == SCI_KEY_ESC) || + (curEvent.type == SCI_EVENT_KEYBOARD && curEvent.character == SCI_KEY_ESC) || g_sci->getEngineState()->abortScriptProcessing == kAbortQuitGame) userAbort = true; curPosition = _audio->getAudioPosition(); |