diff options
author | Travis Howell | 2009-05-05 13:40:16 +0000 |
---|---|---|
committer | Travis Howell | 2009-05-05 13:40:16 +0000 |
commit | bb4b2a506005dec449b854a2842550007ed46b1e (patch) | |
tree | 24e35ebb3683ead0977dab9b80d78484de72614a | |
parent | f4cb6a0b0a98c5b02ea2a846295e888f7dc6c8a0 (diff) | |
download | scummvm-rg350-bb4b2a506005dec449b854a2842550007ed46b1e.tar.gz scummvm-rg350-bb4b2a506005dec449b854a2842550007ed46b1e.tar.bz2 scummvm-rg350-bb4b2a506005dec449b854a2842550007ed46b1e.zip |
Fix input glitch regression again, by closer matching original PN code.
svn-id: r40329
-rw-r--r-- | engines/agos/agos.h | 1 | ||||
-rw-r--r-- | engines/agos/input.cpp | 21 | ||||
-rw-r--r-- | engines/agos/saveload.cpp | 6 |
3 files changed, 20 insertions, 8 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h index 5e27e7e2ac..31cfeba55c 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -1498,6 +1498,7 @@ public: virtual void timerProc(); void addChar(uint8 chr); + void clearCursor(WindowBlock *window); void clearInputLine(); void handleKeyboard(); virtual void handleMouseMoved(); diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp index 9adb3cc584..a8c1bf4bfa 100644 --- a/engines/agos/input.cpp +++ b/engines/agos/input.cpp @@ -689,8 +689,8 @@ void AGOSEngine_PN::interact(char *buffer, uint8 size) { _intputCounter = 0; _inputMax = size; _inputWindow = _windowArray[_curWindow]; - userGameBackSpace(_inputWindow, 8); windowPutChar(_inputWindow, 128); + windowPutChar(_inputWindow, 8); _inputting = true; _inputReady = true; } @@ -714,23 +714,34 @@ void AGOSEngine_PN::interact(char *buffer, uint8 size) { void AGOSEngine_PN::addChar(uint8 chr) { if (chr == 13) { _keyboardBuffer[_intputCounter++] = chr; - userGameBackSpace(_inputWindow, 8); windowPutChar(_inputWindow, 13); } else if (chr == 8 && _intputCounter) { - userGameBackSpace(_inputWindow, 8); - userGameBackSpace(_inputWindow, 8); + clearCursor(_inputWindow); + windowPutChar(_inputWindow, 8); windowPutChar(_inputWindow, 128); + windowPutChar(_inputWindow, 8); _keyboardBuffer[--_intputCounter] = 0; } else if (chr >= 32 && _intputCounter < _inputMax) { _keyboardBuffer[_intputCounter++] = chr; - userGameBackSpace(_inputWindow, 8); + clearCursor(_inputWindow); windowPutChar(_inputWindow, chr); windowPutChar(_inputWindow, 128); + windowPutChar(_inputWindow, 8); } } +void AGOSEngine_PN::clearCursor(WindowBlock *window) { + byte oldTextColor = window->textColor; + + window->textColor = window->fillColor; + windowPutChar(window, 128); + window->textColor = oldTextColor; + + windowPutChar(window, 8); +} + bool AGOSEngine_PN::processSpecialKeys() { if (shouldQuit()) _exitCutscene = true; diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index edaa1fab02..16bde0097b 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -882,10 +882,10 @@ void AGOSEngine::disableFileBoxes() { } void AGOSEngine::userGameBackSpace(WindowBlock *window, int x, byte b) { - byte old_text; + byte oldTextColor; windowPutChar(window, x, b); - old_text = window->textColor; + oldTextColor = window->textColor; window->textColor = window->fillColor; if (_language == Common::HB_ISR) { @@ -898,7 +898,7 @@ void AGOSEngine::userGameBackSpace(WindowBlock *window, int x, byte b) { windowPutChar(window, x); - window->textColor = old_text; + window->textColor = oldTextColor; windowPutChar(window, 8); } |