Skip to content

Commit

Permalink
KYRA: (EOB) - fix shift key input
Browse files Browse the repository at this point in the history
  • Loading branch information
athrxx authored and Johannes Schickel committed Dec 26, 2011
1 parent 514c776 commit 6853452
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
6 changes: 3 additions & 3 deletions engines/kyra/eobcommon.cpp
Expand Up @@ -40,7 +40,7 @@ EobCoreEngine::EobCoreEngine(OSystem *system, const GameFlags &flags) : LolEobBa
_teleporterWallId(flags.gameID == GI_EOB1 ? 52 : 44) {
_screen = 0;
_gui = 0;
TTTTT=false;
//_processingButtons=false;
//_runLoopUnk2 = 0;
//_runLoopTimerUnk = 0;
_playFinale = false;
Expand Down Expand Up @@ -411,7 +411,7 @@ void EobCoreEngine::runLoop() {
while (!shouldQuit() && _runFlag) {
//_runLoopUnk2 = _currentBlock;
updateCharacterEvents(true);
checkInput(_activeButtons, true);
checkInput(_activeButtons, true, 0);
removeInputTop();

if (_updateHandItemCursor) {
Expand Down Expand Up @@ -1269,7 +1269,7 @@ void EobCoreEngine::displayParchment(int id) {
removeInputTop();
while (!shouldQuit()) {
delay(_tickLength);
if (checkInput(0) & 0xff)
if (checkInput(0, false, 0) & 0xff)
break;
removeInputTop();
}
Expand Down
12 changes: 7 additions & 5 deletions engines/kyra/gui_eob.cpp
Expand Up @@ -1570,7 +1570,7 @@ int GUI_Eob::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
uint16 in = inputFlags & 0xff;
uint16 buttonReleaseFlag = 0;
bool clickEvt = false;
_vm->TTTTT = true;
//_vm->_processingButtons = true;
_flagsMouseLeft = (_vm->_mouseClick == 1) ? 2 : 4;
_flagsMouseRight = (_vm->_mouseClick == 2) ? 2 : 4;
_vm->_mouseClick = 0;
Expand All @@ -1589,7 +1589,7 @@ int GUI_Eob::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8

inputFlags = 0;
clickEvt = true;
} else {
} else if (inputFlags & 0x8000) {
inputFlags &= 0xff;
}

Expand Down Expand Up @@ -1668,13 +1668,13 @@ int GUI_Eob::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
uint16 vR = 0;

if (inputFlags) {
if (buttonList->keyCode == in) {
if (buttonList->keyCode == inputFlags) {
_progress = 1;
_flagsMouseLeft = 1;
flgs2 ^= 1;
result = iFlag;
v6 = 1;
} else if (buttonList->keyCode2 == in) {
} else if (buttonList->keyCode2 == inputFlags) {
_progress = 2;
_flagsMouseRight = 1;
result = iFlag;
Expand Down Expand Up @@ -1941,7 +1941,9 @@ int GUI_Eob::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8

if (!result)
result = inputFlags;
_vm-> TTTTT=false;

//_vm->_processingButtons=false;

return result;
}

Expand Down
7 changes: 5 additions & 2 deletions engines/kyra/kyra_v1.cpp
Expand Up @@ -285,10 +285,13 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag)
}
} else {
KeyMap::const_iterator keycode = _keyMap.find(event.kbd.keycode);
if (keycode != _keyMap.end())
if (keycode != _keyMap.end()) {
keys = keycode->_value;
else
if (event.kbd.flags & Common::KBD_SHIFT)
keys |= 0x100;
} else {
keys = 0;
}

// When we got an keypress, which we might need to handle,
// break the event loop and pass it to GUI code.
Expand Down
2 changes: 1 addition & 1 deletion engines/kyra/loleobbase.cpp
Expand Up @@ -255,7 +255,7 @@ uint16 LolEobBaseEngine::processDialogue() {
}
}
} else {
int e = checkInput(0, false) & 0xFF;
int e = checkInput(0, false, 0) & 0xFF;
removeInputTop();
if (e)
gui_notifyButtonListChanged();
Expand Down
2 changes: 1 addition & 1 deletion engines/kyra/loleobbase.h
Expand Up @@ -253,7 +253,7 @@ friend class TextDisplayer_Eob;

Button *_activeButtons;
Button _activeButtonData[70];
bool TTTTT;
//bool _processingButtons;

uint8 _mouseClick;
bool _preserveEvents;
Expand Down

0 comments on commit 6853452

Please sign in to comment.