[Scummvm-cvs-logs] CVS: scummvm/sword1 control.cpp,1.60,1.61

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Mon Oct 17 00:17:02 CEST 2005


Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28985

Modified Files:
	control.cpp 
Log Message:
Decrease delay while editing savegame name. This way, there should be much
less risk of keypresses being lost.


Index: control.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/control.cpp,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- control.cpp	16 Oct 2005 15:06:51 -0000	1.60
+++ control.cpp	17 Oct 2005 07:15:18 -0000	1.61
@@ -281,16 +281,17 @@
 			if (_selectedSavegame < 255) {
 				_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
 				bool visible = _cursorVisible;
-				if (_cursorTick == 0)
+				_cursorTick++;
+				if (_cursorTick == 7)
 					_cursorVisible = true;
-				else if (_cursorTick == 3)
+				else if (_cursorTick == 14) {
 					_cursorVisible = false;
+					_cursorTick = 0;
+				}
 				if (_keyPressed)
 					handleSaveKey(_keyPressed);
 				else if (_cursorVisible != visible)
 					showSavegameNames();
-				if (++_cursorTick > 5)
-					_cursorTick = 0;
 			} else {
 				_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
 			}
@@ -311,7 +312,12 @@
 			_system->copyRectToScreen(_screenBuf, SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, 480);
 		}
 		_system->updateScreen();
-		delay(1000 / 12);
+		// Use shorter delay when editing savegames names to minimize
+		// the risk of keypresses being lost.
+		if (mode == BUTTON_SAVE_PANEL && _selectedSavegame < 255)
+			delay(20);
+		else
+			delay(1000 / 12);
 		newMode = getClicks(mode, &retVal);
 	} while ((newMode != BUTTON_DONE) && (retVal == 0) && (!SwordEngine::_systemVars.engineQuit));
 	destroyButtons();





More information about the Scummvm-git-logs mailing list