[Scummvm-cvs-logs] SF.net SVN: scummvm:[34157] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Aug 25 17:14:31 CEST 2008


Revision: 34157
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34157&view=rev
Author:   lordhoto
Date:     2008-08-25 15:14:29 +0000 (Mon, 25 Aug 2008)

Log Message:
-----------
Implemented continous screen updating while waiting for text input in v2 GUI. (based on LoK implementation)

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/gui_v2.cpp
    scummvm/trunk/engines/kyra/gui_v2.h

Modified: scummvm/trunk/engines/kyra/gui_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_v2.cpp	2008-08-25 15:14:20 UTC (rev 34156)
+++ scummvm/trunk/engines/kyra/gui_v2.cpp	2008-08-25 15:14:29 UTC (rev 34157)
@@ -35,6 +35,7 @@
 GUI_v2::GUI_v2(KyraEngine_v2 *vm) : GUI(vm), _vm(vm), _screen(vm->screen_v2()) {
 	_backUpButtonList = _unknownButtonList = 0;
 	_buttonListChanged = false;
+	_lastScreenUpdate = 0;
 
 	_currentMenu = 0;
 	_isDeathMenu = false;
@@ -767,6 +768,7 @@
 			x2 -= getCharWidth(buffer[curPos]);
 			drawTextfieldBlock(x2, y2, c3);
 			_screen->updateScreen();
+			_lastScreenUpdate = _vm->_system->getMillis();
 		} else if (_keyPressed.ascii > 31 && _keyPressed.ascii < 127 && curPos < bufferSize) {
 			if (x2 + getCharWidth(_keyPressed.ascii) + 7 < 0x11F) {
 				buffer[curPos] = _keyPressed.ascii;
@@ -776,11 +778,11 @@
 				drawTextfieldBlock(x2, y2, c3);
 				++curPos;
 				_screen->updateScreen();
+				_lastScreenUpdate = _vm->_system->getMillis();
 			}
 		}
 
 		_keyPressed.reset();
-		_vm->delay(10);
 	}
 
 	return buffer;
@@ -824,6 +826,8 @@
 void GUI_v2::checkTextfieldInput() {
 	Common::Event event;
 
+	uint32 now = _vm->_system->getMillis();
+
 	bool running = true;
 	int keys = 0;
 	while (_vm->_eventMan->pollEvent(event) && running) {
@@ -854,6 +858,7 @@
 			_vm->_mouseX = pos.x;
 			_vm->_mouseY = pos.y;
 			_screen->updateScreen();
+			_lastScreenUpdate = now;
 			} break;
 
 		default:
@@ -861,7 +866,13 @@
 		}
 	}
 
+	if (now - _lastScreenUpdate > 50) {
+		_vm->_system->updateScreen();
+		_lastScreenUpdate = now;
+	}
+
 	processButtonList(_menuButtonList, keys | 0x8000, 0);
+	_vm->_system->delayMillis(3);
 }
 
 void GUI_v2::drawTextfieldBlock(int x, int y, uint8 c) {

Modified: scummvm/trunk/engines/kyra/gui_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/gui_v2.h	2008-08-25 15:14:20 UTC (rev 34156)
+++ scummvm/trunk/engines/kyra/gui_v2.h	2008-08-25 15:14:29 UTC (rev 34157)
@@ -213,6 +213,7 @@
 	// savename menu
 	bool _finishNameInput, _cancelNameInput;
 	Common::KeyState _keyPressed;
+	uint32 _lastScreenUpdate;
 
 	const char *nameInputProcess(char *buffer, int x, int y, uint8 c1, uint8 c2, uint8 c3, int bufferSize);
 	int finishSavename(Button *caller);


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