[Scummvm-cvs-logs] SF.net SVN: scummvm:[40329] scummvm/trunk/engines/agos

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Tue May 5 15:40:32 CEST 2009


Revision: 40329
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40329&view=rev
Author:   Kirben
Date:     2009-05-05 13:40:16 +0000 (Tue, 05 May 2009)

Log Message:
-----------
Fix input glitch regression again, by closer matching original PN code.

Modified Paths:
--------------
    scummvm/trunk/engines/agos/agos.h
    scummvm/trunk/engines/agos/input.cpp
    scummvm/trunk/engines/agos/saveload.cpp

Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h	2009-05-05 12:47:37 UTC (rev 40328)
+++ scummvm/trunk/engines/agos/agos.h	2009-05-05 13:40:16 UTC (rev 40329)
@@ -1498,6 +1498,7 @@
 	virtual void timerProc();
 
 	void addChar(uint8 chr);
+	void clearCursor(WindowBlock *window);
 	void clearInputLine();
 	void handleKeyboard();
 	virtual void handleMouseMoved();

Modified: scummvm/trunk/engines/agos/input.cpp
===================================================================
--- scummvm/trunk/engines/agos/input.cpp	2009-05-05 12:47:37 UTC (rev 40328)
+++ scummvm/trunk/engines/agos/input.cpp	2009-05-05 13:40:16 UTC (rev 40329)
@@ -689,8 +689,8 @@
 		_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::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;		

Modified: scummvm/trunk/engines/agos/saveload.cpp
===================================================================
--- scummvm/trunk/engines/agos/saveload.cpp	2009-05-05 12:47:37 UTC (rev 40328)
+++ scummvm/trunk/engines/agos/saveload.cpp	2009-05-05 13:40:16 UTC (rev 40329)
@@ -882,10 +882,10 @@
 }
 
 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 @@
 
 	windowPutChar(window, x);
 
-	window->textColor = old_text;
+	window->textColor = oldTextColor;
 	windowPutChar(window, 8);
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list