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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Tue Mar 18 18:00:26 CET 2008


Revision: 31183
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31183&view=rev
Author:   lordhoto
Date:     2008-03-18 10:00:26 -0700 (Tue, 18 Mar 2008)

Log Message:
-----------
- Implemented opcodes:
  -> 12: o2_setCharacterFacing
  -> 14: o2_moveCharacter
  -> 61: o2_loadZShapes
  -> 83: o2_setPathfinderFlag
  -> 90: o2_setSceneAnimPos
  -> 160: o2_updateTwoSceneAnims
- Implemented dino riding sequence
- Fixed bug in KyraEngine_v2::initSceneScreen which caused some gfx glitches

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/animator_v2.cpp
    scummvm/trunk/engines/kyra/kyra_v2.cpp
    scummvm/trunk/engines/kyra/kyra_v2.h
    scummvm/trunk/engines/kyra/scene_v2.cpp
    scummvm/trunk/engines/kyra/script_v2.cpp

Modified: scummvm/trunk/engines/kyra/animator_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/animator_v2.cpp	2008-03-18 15:50:43 UTC (rev 31182)
+++ scummvm/trunk/engines/kyra/animator_v2.cpp	2008-03-18 17:00:26 UTC (rev 31183)
@@ -174,7 +174,7 @@
 			height -= height + y - 144;
 
 		_screen->hideMouse();
-		_screen->copyRegion(x, y, x, y, width, height, 2, 0, Screen::CR_CLIPPED);
+		_screen->copyRegion(x, y, x, y, width, height, 2, 0, Screen::CR_CLIPPED | Screen::CR_NO_P_CHECK);
 		_screen->showMouse();
 
 		curObject->needRefresh = false;

Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-03-18 15:50:43 UTC (rev 31182)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-03-18 17:00:26 UTC (rev 31183)
@@ -397,10 +397,10 @@
 		if (_system->getMillis() > _nextIdleAnim)
 			showIdleAnim();
 
-		//if (queryGameFlag(0x159) {
-		//	sub_C86A();
-		//	resetGameFlag(0x159);
-		//}
+		if (queryGameFlag(0x159)) {
+			dinoRide();
+			resetGameFlag(0x159);
+		}
 
 		if (queryGameFlag(0x124) && !queryGameFlag(0x125)) {
 			_mainCharacter.animFrame = 32;
@@ -2134,6 +2134,43 @@
 
 #pragma mark -
 
+void KyraEngine_v2::dinoRide() {
+	_mainCharX = _mainCharY = -1;
+
+	setGameFlag(0x15A);
+	enterNewScene(41, -1, 0, 0, 0);
+	resetGameFlag(0x15A);
+
+	setGameFlag(0x15B);
+	enterNewScene(39, -1, 0, 0, 0);
+	resetGameFlag(0x15B);
+
+	setGameFlag(0x16F);
+
+	setGameFlag(0x15C);
+	enterNewScene(42, -1, 0, 0, 0);
+	resetGameFlag(0x15C);
+
+	setGameFlag(0x15D);
+	enterNewScene(39, -1, 0, 0, 0);
+	resetGameFlag(0x15D);
+
+	setGameFlag(0x15E);
+	enterNewScene(40, -1, 0, 0, 0);
+	resetGameFlag(0x15E);
+
+	_mainCharX = 262;
+	_mainCharY = 28;
+	_mainCharacter.facing = 5;
+	_mainCharacter.animFrame = _characterFrameTable[5];
+	enterNewScene(39, 4, 0, 0, 0);
+	setHandItem(0x61);
+	_screen->showMouse();
+	resetGameFlag(0x159);
+}
+
+#pragma mark -
+
 void KyraEngine_v2::registerDefaultSettings() {
 	KyraEngine::registerDefaultSettings();
 

Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h	2008-03-18 15:50:43 UTC (rev 31182)
+++ scummvm/trunk/engines/kyra/kyra_v2.h	2008-03-18 17:00:26 UTC (rev 31183)
@@ -307,6 +307,8 @@
 
 	void updateMouse();
 
+	void dinoRide();
+
 	struct Button;
 	int checkInput(Button *buttonList, bool mainLoop = false);
 	void removeInputTop();
@@ -961,7 +963,9 @@
 	int o2_getCharacterScene(ScriptState *script);
 	int o2_setSceneComment(ScriptState *script);
 	int o2_setCharacterAnimFrame(ScriptState *script);
+	int o2_setCharacterFacing(ScriptState *script);
 	int o2_trySceneChange(ScriptState *script);
+	int o2_moveCharacter(ScriptState *script);
 	int o2_customCharacterChat(ScriptState *script);
 	int o2_soundFadeOut(ScriptState *script);
 	int o2_showChapterMessage(ScriptState *script);
@@ -1000,6 +1004,7 @@
 	int o2_setScaleTableItem(ScriptState *script);
 	int o2_setDrawLayerTableItem(ScriptState *script);
 	int o2_setCharPalEntry(ScriptState *script);
+	int o2_loadZShapes(ScriptState *script);
 	int o2_drawSceneShape(ScriptState *script);
 	int o2_drawSceneShapeOnPage(ScriptState *script);
 	int o2_disableAnimObject(ScriptState *script);
@@ -1016,11 +1021,13 @@
 	int o2_enterNewSceneEx(ScriptState *script);
 	int o2_switchScene(ScriptState *script);
 	int o2_getShapeFlag1(ScriptState *script);
+	int o2_setPathfinderFlag(ScriptState *script);
 	int o2_setLayerFlag(ScriptState *script);
 	int o2_setZanthiaPos(ScriptState *script);
 	int o2_loadMusicTrack(ScriptState *script);
 	int o2_playWanderScoreViaMap(ScriptState *script);
 	int o2_playSoundEffect(ScriptState *script);
+	int o2_setSceneAnimPos(ScriptState *script);
 	int o2_blockInRegion(ScriptState *script);
 	int o2_blockOutRegion(ScriptState *script);
 	int o2_setCauldronState(ScriptState *script);
@@ -1075,6 +1082,7 @@
 	int o2_enableTimer(ScriptState *script);
 	int o2_setTimerCountdown(ScriptState *script);
 	int o2_processPaletteIndex(ScriptState *script);
+	int o2_updateTwoSceneAnims(ScriptState *script);
 	int o2_getBoolFromStack(ScriptState *script);
 	int o2_setVocHigh(ScriptState *script);
 	int o2_getVocHigh(ScriptState *script);

Modified: scummvm/trunk/engines/kyra/scene_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_v2.cpp	2008-03-18 15:50:43 UTC (rev 31182)
+++ scummvm/trunk/engines/kyra/scene_v2.cpp	2008-03-18 17:00:26 UTC (rev 31183)
@@ -666,7 +666,7 @@
 
 void KyraEngine_v2::initSceneScreen(int unk1) {
 	if (_unkSceneScreenFlag1) {
-		_screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0);
+		_screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0, Screen::CR_NO_P_CHECK);
 		return;
 	}
 
@@ -675,7 +675,7 @@
 		_screen->setScreenPalette(_screen->getPalette(0));
 	}
 
-	_screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0);
+	_screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0, Screen::CR_NO_P_CHECK);
 
 	if (_noScriptEnter) {
 		_screen->setScreenPalette(_screen->getPalette(1));

Modified: scummvm/trunk/engines/kyra/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v2.cpp	2008-03-18 15:50:43 UTC (rev 31182)
+++ scummvm/trunk/engines/kyra/script_v2.cpp	2008-03-18 17:00:26 UTC (rev 31183)
@@ -125,6 +125,13 @@
 	return 0;
 }
 
+int KyraEngine_v2::o2_setCharacterFacing(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharacterFacing(%p) (%d)", (const void *)script, stackPos(0));
+	_mainCharacter.facing = stackPos(0);
+	_overwriteSceneFacing = 1;
+	return 0;
+}
+
 int KyraEngine_v2::o2_trySceneChange(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_trySceneChange(%p) (%d, %d, %d, %d)", (const void *)script,
 			stackPos(0), stackPos(1), stackPos(2), stackPos(3));
@@ -144,6 +151,12 @@
 	}
 }
 
+int KyraEngine_v2::o2_moveCharacter(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_moveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+	moveCharacter(stackPos(0), stackPos(1), stackPos(2));
+	return 0;
+}
+
 int KyraEngine_v2::o2_customCharacterChat(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_customCharacterChat(%p) ('%s', %d, %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
 	playVoice(_vocHigh, stackPos(4));
@@ -603,6 +616,12 @@
 	return 0;
 }
 
+int KyraEngine_v2::o2_loadZShapes(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_loadZShapes(%p) (%d)", (const void *)script, stackPos(0));
+	loadZShapes(stackPos(0));
+	return 0;
+}
+
 int KyraEngine_v2::o2_drawSceneShape(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_drawSceneShape(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1),
 		stackPos(2), stackPos(3));
@@ -767,6 +786,12 @@
 	return _screen->getShapeFlag1(stackPos(0), stackPos(1));
 }
 
+int KyraEngine_v2::o2_setPathfinderFlag(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setPathfinderFlag(%p) (%d)", (const void *)script, stackPos(0));
+	_pathfinderFlag = stackPos(0);
+	return 0;
+}
+
 int KyraEngine_v2::o2_setLayerFlag(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setLayerFlag(%p) (%d)", (const void *)script, stackPos(0));
 	int layer = stackPos(0);
@@ -806,6 +831,13 @@
 	return 0;
 }
 
+int KyraEngine_v2::o2_setSceneAnimPos(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setSceneAnimPos(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+	_sceneAnims[stackPos(0)].x = stackPos(1);
+	_sceneAnims[stackPos(0)].y = stackPos(2);
+	return 0;
+}
+
 int KyraEngine_v2::o2_blockInRegion(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_blockInRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
 	_screen->blockInRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
@@ -1449,6 +1481,14 @@
 	return 0;
 }
 
+int KyraEngine_v2::o2_updateTwoSceneAnims(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_updateTwoSceneAnims(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+	updateSceneAnim(stackPos(0), stackPos(1));
+	updateSceneAnim(stackPos(2), stackPos(3));
+	_specialSceneScriptRunFlag = false;
+	return 0;
+}
+
 int KyraEngine_v2::o2_getBoolFromStack(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getBoolFromStack(%p) ()", (const void *)script);
 	return stackPos(0) ? 1 : 0;
@@ -1564,9 +1604,9 @@
 		OpcodeUnImpl(),
 		Opcode(o2_setCharacterAnimFrame),
 		// 0x0c
-		OpcodeUnImpl(),
+		Opcode(o2_setCharacterFacing),
 		Opcode(o2_trySceneChange),
-		OpcodeUnImpl(),
+		Opcode(o2_moveCharacter),
 		Opcode(o2_customCharacterChat),
 		// 0x10
 		Opcode(o2_soundFadeOut),
@@ -1625,7 +1665,7 @@
 		Opcode(o2_setDrawLayerTableItem),
 		// 0x3c
 		Opcode(o2_setCharPalEntry),
-		OpcodeUnImpl(),
+		Opcode(o2_loadZShapes),
 		Opcode(o2_drawSceneShape),
 		Opcode(o2_drawSceneShapeOnPage),
 		// 0x40
@@ -1652,7 +1692,7 @@
 		Opcode(o2_enterNewSceneEx),
 		Opcode(o2_switchScene),
 		Opcode(o2_getShapeFlag1),
-		OpcodeUnImpl(),
+		Opcode(o2_setPathfinderFlag),
 		// 0x54
 		OpcodeUnImpl(),
 		Opcode(o2_setLayerFlag),
@@ -1661,7 +1701,7 @@
 		// 0x58
 		Opcode(o2_playWanderScoreViaMap),
 		Opcode(o2_playSoundEffect),
-		OpcodeUnImpl(),
+		Opcode(o2_setSceneAnimPos),
 		Opcode(o2_blockInRegion),
 		// 0x5c
 		Opcode(o2_blockOutRegion),
@@ -1749,9 +1789,9 @@
 		Opcode(o2_setTimerCountdown),
 		Opcode(o2_processPaletteIndex),
 		// 0xa0
+		Opcode(o2_updateTwoSceneAnims),
 		OpcodeUnImpl(),
 		OpcodeUnImpl(),
-		OpcodeUnImpl(),
 		Opcode(o2_getBoolFromStack),
 		// 0xa4
 		OpcodeUnImpl(),


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