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

vinterstum at users.sourceforge.net vinterstum at users.sourceforge.net
Thu Feb 9 04:23:02 CET 2006


Revision: 20438
Author:   vinterstum
Date:     2006-02-09 04:19:53 -0800 (Thu, 09 Feb 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=20438&view=rev

Log Message:
-----------
1. Replaced the $Header$ tags in the Kyra files
2. Added code to let the player skip past dialogue by leftclicking or hitting '.'
3. Removed the waitTicks() function and replaced all usage with delay()
4. Corrected various speed issues, the intro should run at the correct pace now
5. Talkie versions will no longer display the story screen during the intro, as in the original.
6. Moved the delay() function adjacent to other delay functions.

Modified Paths:
--------------
    scummvm/trunk/kyra/animator.cpp
    scummvm/trunk/kyra/animator.h
    scummvm/trunk/kyra/debugger.cpp
    scummvm/trunk/kyra/debugger.h
    scummvm/trunk/kyra/gui.cpp
    scummvm/trunk/kyra/items.cpp
    scummvm/trunk/kyra/kyra.cpp
    scummvm/trunk/kyra/kyra.h
    scummvm/trunk/kyra/resource.cpp
    scummvm/trunk/kyra/resource.h
    scummvm/trunk/kyra/saveload.cpp
    scummvm/trunk/kyra/scene.cpp
    scummvm/trunk/kyra/screen.cpp
    scummvm/trunk/kyra/screen.h
    scummvm/trunk/kyra/script.cpp
    scummvm/trunk/kyra/script.h
    scummvm/trunk/kyra/script_v1.cpp
    scummvm/trunk/kyra/seqplayer.cpp
    scummvm/trunk/kyra/seqplayer.h
    scummvm/trunk/kyra/sequences.cpp
    scummvm/trunk/kyra/sound.cpp
    scummvm/trunk/kyra/sound.h
    scummvm/trunk/kyra/sprites.cpp
    scummvm/trunk/kyra/sprites.h
    scummvm/trunk/kyra/staticres.cpp
    scummvm/trunk/kyra/text.cpp
    scummvm/trunk/kyra/text.h
    scummvm/trunk/kyra/timer.cpp
    scummvm/trunk/kyra/wsamovie.cpp
    scummvm/trunk/kyra/wsamovie.h
Modified: scummvm/trunk/kyra/animator.cpp
===================================================================
--- scummvm/trunk/kyra/animator.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/animator.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/animator.h
===================================================================
--- scummvm/trunk/kyra/animator.h	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/animator.h	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/debugger.cpp
===================================================================
--- scummvm/trunk/kyra/debugger.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/debugger.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/debugger.h
===================================================================
--- scummvm/trunk/kyra/debugger.h	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/debugger.h	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/gui.cpp
===================================================================
--- scummvm/trunk/kyra/gui.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/gui.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/items.cpp
===================================================================
--- scummvm/trunk/kyra/items.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/items.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/kyra/kyra.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/kyra.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 
@@ -347,7 +348,6 @@
 
 	memset(_flagsTable, 0, sizeof(_flagsTable));
 
-	_fastMode = false;
 	_abortWalkFlag = false;
 	_abortWalkFlag2 = false;
 	_talkingCharNum = -1;
@@ -416,6 +416,9 @@
 	 
 	 _lastMusicCommand = 0;
 
+	_gameSpeed = 60;
+	_tickLength = (uint8)(1000.0 / _gameSpeed);
+
 	return 0;
 }
 
@@ -553,9 +556,6 @@
 	_animator->initAnimStateList();
 	setCharactersInDefaultScene();
 
-	_gameSpeed = 50;
-	_tickLength = (uint8)(1000.0 / _gameSpeed);
-
 	if (!_scriptInterpreter->loadScript("_STARTUP.EMC", _npcScriptData, _opcodeTable, _opcodeTableSize, 0)) {
 		error("Could not load \"_STARTUP.EMC\" script");
 	}
@@ -576,7 +576,7 @@
 	snd_setSoundEffectFile(1);
 	enterNewScene(_currentCharacter->sceneId, _currentCharacter->facing, 0, 0, 1);
 	
-	if (_abortIntroFlag && _skipIntroFlag) {
+	if (_abortIntroFlag && _skipFlag) {
 		_menuDirectlyToLoad = true;
 		_screen->setMouseCursor(1, 1, _shapes[4]);
 		buttonMenuCallback(0);
@@ -585,6 +585,64 @@
 		saveGame(getSavegameFilename(0), "New game");
 }
 
+void KyraEngine::mainLoop() {
+	debug(9, "KyraEngine::mainLoop()");
+
+	while (!_quitFlag) {
+		int32 frameTime = (int32)_system->getMillis();
+		_skipFlag = false;
+
+		if (_currentCharacter->sceneId == 210) {
+			_animator->updateKyragemFading();
+			if (seq_playEnd()) {
+				if (_deathHandler != 8)
+					break;
+			}
+		}
+		
+		if (_deathHandler != 0xFF) {
+			// this is only used until the original gui is implemented
+			GUI::MessageDialog dialog("Brandon is dead! Game over!", "Quit");
+			dialog.runModal();
+			break;
+		}
+		
+		if (_brandonStatusBit & 2) {
+			if (_brandonStatusBit0x02Flag)
+				animRefreshNPC(0);
+		}
+		if (_brandonStatusBit & 0x20) {
+			if (_brandonStatusBit0x20Flag) {
+				animRefreshNPC(0);
+				_brandonStatusBit0x20Flag = 0;
+			}
+		}
+		
+		_screen->showMouse();
+
+		processButtonList(_buttonList);
+		updateMousePointer();
+		updateGameTimers();
+		updateTextFade();
+
+		_handleInput = true;
+		delay((frameTime + _gameSpeed) - _system->getMillis(), true, true);
+		_handleInput = false;
+	}
+}
+
+void KyraEngine::quitGame() {
+	res_unloadResources(RES_ALL);
+
+	for (int i = 0; i < ARRAYSIZE(_movieObjects); ++i) {
+		_movieObjects[i]->close();
+		delete _movieObjects[i];
+		_movieObjects[i] = 0;
+	}
+
+	_system->quit();
+}
+
 void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) {
 	OSystem::Event event;
 	char saveLoadSlot[20];
@@ -606,13 +664,17 @@
 						saveGame(saveLoadSlot, savegameName);
 					}
 				} else if (event.kbd.flags == OSystem::KBD_CTRL) {
-					if (event.kbd.keycode == 'f')
-						_fastMode = !_fastMode;
-					else if (event.kbd.keycode == 'd')
+					if (event.kbd.keycode == 'd')
 						_debugger->attach();
 					else if (event.kbd.keycode == 'q')
 						_quitFlag = true;
+				} else if (event.kbd.keycode == '.')
+						_skipFlag = true;
+				else if (event.kbd.keycode == 13 || event.kbd.keycode == 32 || event.kbd.keycode == 27) {
+					_abortIntroFlag = true;
+					_skipFlag = true;
 				}
+
 				break;
 			case OSystem::EVENT_MOUSEMOVE:
 				_mouseX = event.mouse.x;
@@ -635,28 +697,29 @@
 					_handleInput = false;
 					processInput(_mouseX, _mouseY);
 					_handleInput = true;
-				}
+				} else
+					_skipFlag = true;
 				break;
 			default:
 				break;
 			}
 		}
-
 		if (_debugger->isAttached())
 			_debugger->onFrame();
 
-		_sprites->updateSceneAnims();
 		if (update)
+			_sprites->updateSceneAnims();
 			_animator->updateAllObjectShapes();
 
-		if (_currentCharacter->sceneId == 210) {
+		if (_currentCharacter && _currentCharacter->sceneId == 210) {
 			_animator->updateKyragemFading();
 		}
 
-		if (amount > 0) {
+		if (amount > 0 && !_skipFlag) {
 			_system->delayMillis((amount > 10) ? 10 : amount);
 		}
-	} while (!_fastMode && _system->getMillis() < start + amount);
+	} while (!_skipFlag && _system->getMillis() < start + amount);
+	
 }
 
 void KyraEngine::waitForEvent() {
@@ -677,6 +740,7 @@
 				break;
 			case OSystem::EVENT_LBUTTONDOWN:
 				finished = true;
+				_skipFlag = true;
 				break;
 			default:
 				break;
@@ -690,93 +754,9 @@
 	}
 }
 
-void KyraEngine::mainLoop() {
-	debug(9, "KyraEngine::mainLoop()");
-
-	while (!_quitFlag) {
-		int32 frameTime = (int32)_system->getMillis();
-		if (_currentCharacter->sceneId == 210) {
-			_animator->updateKyragemFading();
-			if (seq_playEnd()) {
-				if (_deathHandler != 8)
-					break;
-			}
-		}
-		
-		if (_deathHandler != 0xFF) {
-			// this is only used until the original gui is implemented
-			GUI::MessageDialog dialog("Brandon is dead! Game over!", "Quit");
-			dialog.runModal();
-			break;
-		}
-		
-		if (_brandonStatusBit & 2) {
-			if (_brandonStatusBit0x02Flag)
-				animRefreshNPC(0);
-		}
-		if (_brandonStatusBit & 0x20) {
-			if (_brandonStatusBit0x20Flag) {
-				animRefreshNPC(0);
-				_brandonStatusBit0x20Flag = 0;
-			}
-		}
-		
-		_screen->showMouse();
-
-		processButtonList(_buttonList);
-		updateMousePointer();
-		updateGameTimers();
-		updateTextFade();
-
-		_handleInput = true;
-		delay((frameTime + _gameSpeed) - _system->getMillis(), true, true);
-		_handleInput = false;
-	}
-}
-
-void KyraEngine::quitGame() {
-	res_unloadResources(RES_ALL);
-
-	for (int i = 0; i < ARRAYSIZE(_movieObjects); ++i) {
-		_movieObjects[i]->close();
-		delete _movieObjects[i];
-		_movieObjects[i] = 0;
-	}
-
-	_system->quit();
-}
-
-void KyraEngine::waitTicks(int ticks) {
-	debug(9, "KyraEngine::waitTicks(%d)", ticks);
-	const uint32 end = _system->getMillis() + ticks * 1000 / 60;
-	do {
-		OSystem::Event event;
-		while (_system->pollEvent(event)) {
-			switch (event.type) {
-			case OSystem::EVENT_QUIT:
-				_quitFlag = true;
-				quitGame();
-				break;
-			case OSystem::EVENT_KEYDOWN:
-				if (event.kbd.flags == OSystem::KBD_CTRL) {
-					if (event.kbd.keycode == 'f') {
-						_fastMode = !_fastMode;
-					}
-				} else if (event.kbd.keycode == 13 || event.kbd.keycode == 32 || event.kbd.keycode == 27) {
-					_abortIntroFlag = true;
-				}
-				break;
-			default:
-				break;
-			}
-		}
-		_system->delayMillis(10);
-	} while (!_fastMode && _system->getMillis() < end);
-}
-
 void KyraEngine::delayWithTicks(int ticks) {
 	uint32 nextTime = _system->getMillis() + ticks * _tickLength;
-	while (_system->getMillis() < nextTime) {
+	while (_system->getMillis() < nextTime && !_skipFlag) {
 		_sprites->updateSceneAnims();
 		_animator->updateAllObjectShapes();
 		if (_currentCharacter->sceneId == 210) {
@@ -1247,7 +1227,7 @@
 				while (_system->getMillis() < timer2) {}
 			}
 			snd_playWanderScoreViaMap(51, 1);
-			waitTicks(60);
+			delay(60*_tickLength);
 			_malcolmFlag = 0;
 			return 1;
 			break;

Modified: scummvm/trunk/kyra/kyra.h
===================================================================
--- scummvm/trunk/kyra/kyra.h	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/kyra.h	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 
@@ -266,6 +267,7 @@
 	const uint8 **palTable2() { return const_cast<const uint8 **>(&_specialPalettes[29]); }
 
 	bool seq_skipSequence() const;
+	void delay(uint32 millis, bool update = false, bool mainLoop = false);
 	void quitGame();
 	void loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData);
 
@@ -600,7 +602,6 @@
 	void res_freeLangTable(char ***sting, int *size);
 	
 	void waitForEvent();
-	void delay(uint32 millis, bool update = false, bool mainLoop = false);
 	void loadPalette(const char *filename, uint8 *palData);
 	void loadMouseShapes();
 	void loadCharacterShapes();
@@ -676,8 +677,8 @@
 	void gui_restorePalette();
 
 	uint8 _game;
-	bool _fastMode;
 	bool _quitFlag;
+	bool _skipFlag;
 	bool _skipIntroFlag;
 	bool _abortIntroFlag;
 	bool _menuDirectlyToLoad;

Modified: scummvm/trunk/kyra/resource.cpp
===================================================================
--- scummvm/trunk/kyra/resource.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/resource.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/resource.h
===================================================================
--- scummvm/trunk/kyra/resource.h	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/resource.h	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/saveload.cpp
===================================================================
--- scummvm/trunk/kyra/saveload.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/saveload.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/scene.cpp
===================================================================
--- scummvm/trunk/kyra/scene.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/scene.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/screen.cpp
===================================================================
--- scummvm/trunk/kyra/screen.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/screen.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 
@@ -225,7 +226,8 @@
 		}
 		setScreenPalette(fadePal);
 		_system->updateScreen();
-		_system->delayMillis((delayAcc >> 8) * 1000 / 60);
+		//_system->delayMillis((delayAcc >> 8) * 1000 / 60);
+		_vm->delay((delayAcc >> 8) * 1000 / 60);
 		delayAcc &= 0xFF;
 	}
 }
@@ -415,8 +417,11 @@
 		int i = _vm->_rnd.getRandomNumber(h - 1);
 		SWAP(y_offs[y], y_offs[i]);
 	}
-	
+
+	int32 start, now;
+	int wait;
 	for (y = 0; y < h; ++y) {
+		start = (int32)_system->getMillis();
 		int y_cur = y;
 		for (x = 0; x < w; ++x) {
 			int i = sx + x_offs[x];
@@ -431,7 +436,11 @@
 			}
 		}
 		updateScreen();
-		_system->delayMillis(ticks * 1000 / 60);
+		now = (int32)_system->getMillis();
+		wait = ticks * _vm->tickLength() - (now - start);
+		if (wait > 0) {
+			_vm->delay(wait);
+		}
 	}
 }
 

Modified: scummvm/trunk/kyra/screen.h
===================================================================
--- scummvm/trunk/kyra/screen.h	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/screen.h	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/script.cpp
===================================================================
--- scummvm/trunk/kyra/script.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/script.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/script.h
===================================================================
--- scummvm/trunk/kyra/script.h	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/script.h	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/script_v1.cpp
===================================================================
--- scummvm/trunk/kyra/script_v1.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/script_v1.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 
@@ -40,14 +41,7 @@
 }
 
 int KyraEngine::cmd_characterSays(ScriptState *script) {
-	// Japanese version?
-	/*const char *str1 = "âuâëâôââôüAé?é¢ùêé¢é+é®üH";
-	const char *str2 = "âuâëâôâ\\âôüAé?é¢ùêé¢é+é®üH";
-
-	if (strcmp(stackPosString(0), str1) == 0)
-		characterSays((char *)str2, stackPos(1), stackPos(2));
-	else*/
-
+	_skipFlag = false;
 	if (_features & GF_TALKIE) {
 		debug(3, "cmd_characterSays(0x%X) (%d, '%s', %d, %d)", script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3));
 		snd_voiceWaitForFinish();
@@ -351,8 +345,9 @@
 
 int KyraEngine::cmd_pauseSeconds(ScriptState *script) {
 	debug(3, "cmd_pauseSeconds(0x%X) (%d)", script, stackPos(0));
-	if (stackPos(0) > 0)
+	if (stackPos(0) > 0 && !_skipFlag)
 		delay(stackPos(0)*1000, true);
+	_skipFlag = false;
 	return 0;
 }
 
@@ -489,7 +484,7 @@
 	_movieObjects[wsaIndex]->displayFrame(frame);
 	_animator->_updateScreen = true;
 	uint32 continueTime = waitTime * _tickLength + _system->getMillis();
-	while (_system->getMillis() < continueTime) {
+	while (_system->getMillis() < continueTime && !_skipFlag) {
 		_sprites->updateSceneAnims();
 		_animator->updateAllObjectShapes();
 		if (continueTime - _system->getMillis() >= 10)
@@ -617,12 +612,14 @@
 		debug(3, "cmd_customPrintTalkString(0x%X) (%d, '%s', %d, %d, %d)", script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF);
 		snd_voiceWaitForFinish();
 		snd_playVoiceFile(stackPos(0));
+		_skipFlag = false;
 		_text->printTalkTextMessage(stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF, 0, 2);
 	} else {
 		debug(3, "cmd_customPrintTalkString(0x%X) ('%s', %d, %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF);
+		_skipFlag = false;
 		_text->printTalkTextMessage(stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF, 0, 2);
 	}
-	_animator->_updateScreen = true;
+	_screen->updateScreen();
 	return 0;
 }
 
@@ -755,7 +752,7 @@
 				_movieObjects[wsaIndex]->displayFrame(frame);
 				_animator->_updateScreen = true;
 				uint32 continueTime = waitTime * _tickLength + _system->getMillis();
-				while (_system->getMillis() < continueTime) {
+				while (_system->getMillis() < continueTime && !_skipFlag) {
 					_sprites->updateSceneAnims();
 					_animator->updateAllObjectShapes();
 					if (continueTime - _system->getMillis() >= 10)
@@ -769,7 +766,7 @@
 				_movieObjects[wsaIndex]->displayFrame(frame);
 				_animator->_updateScreen = true;
 				uint32 continueTime = waitTime * _tickLength + _system->getMillis();
-				while (_system->getMillis() < continueTime) {
+				while (_system->getMillis() < continueTime && !_skipFlag) {
 					_sprites->updateSceneAnims();
 					_animator->updateAllObjectShapes();
 					if (continueTime - _system->getMillis() >= 10)
@@ -778,7 +775,10 @@
 				--frame;
 			}
 		}
-		++curTime;
+		if (!_skipFlag)
+			break;
+		else
+			++curTime;
 	}
 	_screen->showMouse();
 	

Modified: scummvm/trunk/kyra/seqplayer.cpp
===================================================================
--- scummvm/trunk/kyra/seqplayer.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/seqplayer.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 
@@ -170,7 +171,7 @@
 
 void SeqPlayer::s1_waitTicks() {
 	uint16 ticks = READ_LE_UINT16(_seqData); _seqData += 2;
-	_vm->waitTicks(ticks);
+	_vm->delay(ticks);
 }
 
 void SeqPlayer::s1_copyWaitTicks() {
@@ -373,7 +374,7 @@
 
 void SeqPlayer::s1_playEffect() {
 	uint8 track = *_seqData++;
-	_vm->waitTicks(3);
+	_vm->delay(3 * _vm->tickLength());
 	_sound->playSoundEffect(track);
 }
 

Modified: scummvm/trunk/kyra/seqplayer.h
===================================================================
--- scummvm/trunk/kyra/seqplayer.h	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/seqplayer.h	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/sequences.cpp
===================================================================
--- scummvm/trunk/kyra/sequences.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/sequences.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 
@@ -43,7 +44,7 @@
 	_screen->copyRegion(0, 0, 0, 0, 320, 200, 6, 0);
 	_system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200);
 	_screen->fadeFromBlack();
-	waitTicks(60);
+	delay(60 * _tickLength);
 	_screen->fadeToBlack();
 
 	_screen->clearPage(0);
@@ -55,8 +56,7 @@
 	_screen->fadeFromBlack();
 	
 	_seq->playSequence(_seq_WestwoodLogo, true);
-	waitTicks(60);
-
+	delay(60 * _tickLength);
 	_seq->playSequence(_seq_KyrandiaLogo, true);
 
 	_screen->fadeToBlack();
@@ -80,13 +80,14 @@
 	_screen->copyRegion(0, 0, 0, 0, 320, 200, 6, 0);
 	_system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200);
 	_screen->fadeFromBlack();
-	waitTicks(60);
+	delay(60 * _tickLength);
 	_screen->fadeToBlack();
 	_sound->stopMusic();
 }
 
 void KyraEngine::seq_intro() {
 	debug(9, "KyraEngine::seq_intro()");
+
 	if (_features & GF_TALKIE) {
 		_res->loadPakFile("INTRO.VRM");
 	}
@@ -115,7 +116,7 @@
 		(this->*introProcTable[i])();
 	}
 	_text->setTalkCoords(136);
-	waitTicks(30);
+	delay(30 * _tickLength);
 	_seq->setCopyViewOffs(false);
 	_sound->stopMusic();
 	if (_features & GF_TALKIE) {
@@ -135,13 +136,13 @@
 	_system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200);
 	_screen->fadeFromBlack();
 	
-	if (_seq->playSequence(_seq_WestwoodLogo, _skipIntroFlag)) {
+	if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag)) {
 		_screen->fadeToBlack();
 		_screen->clearPage(0);
 		return;
 	}
-	waitTicks(60);
-	if (_seq->playSequence(_seq_KyrandiaLogo, _skipIntroFlag)) {
+	delay(60 * _tickLength);
+	if (_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) {
 		_screen->fadeToBlack();
 		_screen->clearPage(0);
 		return;
@@ -152,9 +153,12 @@
 	int h1 = 175;
 	int y2 = 176;
 	int h2 = 0;
+	int32 start, now;
+	int wait;
 	_screen->copyRegion(0, 91, 0, 8, 320, 103, 6, 2);
 	_screen->copyRegion(0, 0, 0, 111, 320, 64, 6, 2);
 	do {
+		start = (int32)_system->getMillis();
 		if (h1 > 0) {
 			_screen->copyRegion(0, y1, 0, 8, 320, h1, 2, 0);
 		}
@@ -166,7 +170,11 @@
 		--y2;
 		++h2;
 		_screen->updateScreen();
-		waitTicks(1);
+		now = (int32)_system->getMillis();
+		wait = _tickLength - (now - start);
+		if (wait > 0) {
+			delay(wait);
+		}
 	} while (y2 >= 64);
 
 	_seq->playSequence(_seq_Forest, true);
@@ -176,22 +184,23 @@
 	debug(9, "KyraEngine::seq_introStory()");
 	_screen->clearPage(3);
 	_screen->clearPage(0);
-	if ((_features & GF_ENGLISH) && (_features & GF_TALKIE)) {
-		loadBitmap("TEXT_ENG.CPS", 3, 3, 0);
+	if (_features & GF_TALKIE) {
+		return;
+	} else if (_features & GF_ENGLISH) {
+		loadBitmap("TEXT.CPS", 3, 3, 0);
 	} else if (_features & GF_GERMAN) {
 		loadBitmap("TEXT_GER.CPS", 3, 3, 0);
 	} else if (_features & GF_FRENCH) {
 		loadBitmap("TEXT_FRE.CPS", 3, 3, 0);
 	} else if (_features & GF_SPANISH) {
 		loadBitmap("TEXT_SPA.CPS", 3, 3, 0);
-	} else if ((_features & GF_ENGLISH) && (_features & GF_FLOPPY)) {
-		loadBitmap("TEXT.CPS", 3, 3, 0);
 	} else {
 		warning("no story graphics file found");
 	}
 	_screen->copyRegion(0, 0, 0, 0, 320, 200, 3, 0);
 	_screen->updateScreen();
-	waitTicks(360);
+	debug("skipFlag %i, %i", _skipFlag, _tickLength);
+	delay(360 * _tickLength);
 }
 
 void KyraEngine::seq_introMalcolmTree() {
@@ -852,7 +861,7 @@
 			_screen->_curPage = 0;
 			checkAmuletAnimFlags();
 			seq_brandonToStone();
-			waitTicks(60);
+			delay(60 * _tickLength);
 			return 1;
 		} else {
 			_endSequenceSkipFlag = 1;
@@ -862,7 +871,7 @@
 			_screen->_curPage = 0;
 			_screen->hideMouse();
 			_screen->fadeSpecialPalette(32, 228, 20, 60);
-			waitTicks(60);
+			delay(60 * _tickLength);
 			loadBitmap("GEMHEAL.CPS", 3, 3, _screen->_currentPalette);
 			_screen->setScreenPalette(_screen->_currentPalette);
 			_screen->shuffleScreen(8, 8, 304, 128, 2, 0, 1, 0);
@@ -954,7 +963,7 @@
 	// delete
 	_screen->updateScreen();
 	// XXX
-	waitTicks(120); // wait until user presses escape normally
+	delay(120 * _tickLength); // wait until user presses escape normally
 	_screen->fadeToBlack();
 	_screen->clearCurPage();
 	_screen->showMouse();

Modified: scummvm/trunk/kyra/sound.cpp
===================================================================
--- scummvm/trunk/kyra/sound.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/sound.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 
@@ -421,7 +422,7 @@
 
 void KyraEngine::snd_voiceWaitForFinish(bool ingame) {
 	debug(9, "KyraEngine::snd_voiceWaitForFinish(%d)", ingame);
-	while (_sound->voiceIsPlaying() && !_fastMode) {
+	while (_sound->voiceIsPlaying() && !_skipFlag) {
 		if (ingame) {
 			delay(10, true);
 		} else {

Modified: scummvm/trunk/kyra/sound.h
===================================================================
--- scummvm/trunk/kyra/sound.h	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/sound.h	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/sprites.cpp
===================================================================
--- scummvm/trunk/kyra/sprites.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/sprites.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/sprites.h
===================================================================
--- scummvm/trunk/kyra/sprites.h	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/sprites.h	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/kyra/staticres.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/staticres.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/text.cpp
===================================================================
--- scummvm/trunk/kyra/text.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/text.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 
@@ -92,6 +93,7 @@
 		currPage = _screen->_curPage;
 		_screen->_curPage = 2;
 		_text->printCharacterText(chatStr, charNum, _characterList[charNum].x1);
+		_animator->_updateScreen = true;
 		_screen->_curPage = currPage;
 
 		_animator->copyChangedObjectsForward(0);
@@ -104,7 +106,7 @@
 			switch (event.type) {
 			case OSystem::EVENT_KEYDOWN:
 				if (event.kbd.keycode == '.')
-					runLoop = false;
+					_skipFlag = true;
 				break;
 			case OSystem::EVENT_QUIT:
 				quitGame();
@@ -116,7 +118,7 @@
 			}
 		}
 		
-		if (_fastMode)
+		if (_skipFlag)
 			runLoop = false;
 
 		delayTime = (loopStart + _gameSpeed) - _system->getMillis();

Modified: scummvm/trunk/kyra/text.h
===================================================================
--- scummvm/trunk/kyra/text.h	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/text.h	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/timer.cpp
===================================================================
--- scummvm/trunk/kyra/timer.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/timer.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/wsamovie.cpp
===================================================================
--- scummvm/trunk/kyra/wsamovie.cpp	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/wsamovie.cpp	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 

Modified: scummvm/trunk/kyra/wsamovie.h
===================================================================
--- scummvm/trunk/kyra/wsamovie.h	2006-02-09 07:37:19 UTC (rev 20437)
+++ scummvm/trunk/kyra/wsamovie.h	2006-02-09 12:19:53 UTC (rev 20438)
@@ -15,7 +15,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 







More information about the Scummvm-git-logs mailing list