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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Apr 25 19:59:38 CEST 2008


Revision: 31727
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31727&view=rev
Author:   lordhoto
Date:     2008-04-25 10:59:38 -0700 (Fri, 25 Apr 2008)

Log Message:
-----------
Implemented opcodes:
 - 20: o3_setCharacterAnimFrameFromFacing
 - 61: o3_disguiseMalcolm

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_v3.h
    scummvm/trunk/engines/kyra/script_v3.cpp
    scummvm/trunk/engines/kyra/text_v3.cpp

Modified: scummvm/trunk/engines/kyra/kyra_v3.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v3.h	2008-04-25 17:43:40 UTC (rev 31726)
+++ scummvm/trunk/engines/kyra/kyra_v3.h	2008-04-25 17:59:38 UTC (rev 31727)
@@ -565,6 +565,7 @@
 	int8 _conversationState[30][30];
 	bool _chatAltFlag;
 	void setDlgIndex(uint16 index);
+	void updateDlgIndex();
 
 	Common::SeekableReadStream *_cnvFile;
 	Common::SeekableReadStream *_dlgBuffer;
@@ -683,6 +684,7 @@
 	int o3_moveCharacter(ScriptState *script);
 	int o3_setCharacterFacing(ScriptState *script);
 	int o3_showSceneFileMessage(ScriptState *script);
+	int o3_setCharacterAnimFrameFromFacing(ScriptState *script);
 	int o3_showBadConscience(ScriptState *script);
 	int o3_hideBadConscience(ScriptState *script);
 	int o3_addItemToCurScene(ScriptState *script);
@@ -707,6 +709,7 @@
 	int o3_updateScore(ScriptState *script);
 	int o3_setSceneFilename(ScriptState *script);
 	int o3_removeItemsFromScene(ScriptState *script);
+	int o3_disguiseMalcolm(ScriptState *script);
 	int o3_drawSceneShape(ScriptState *script);
 	int o3_drawSceneShapeOnPage(ScriptState *script);
 	int o3_checkInRect(ScriptState *script);

Modified: scummvm/trunk/engines/kyra/script_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v3.cpp	2008-04-25 17:43:40 UTC (rev 31726)
+++ scummvm/trunk/engines/kyra/script_v3.cpp	2008-04-25 17:59:38 UTC (rev 31727)
@@ -164,6 +164,15 @@
 	return 0;
 }
 
+int KyraEngine_v3::o3_setCharacterAnimFrameFromFacing(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setCharacterAnimFrameFromFacing(%p) ()", (const void *)script);
+	updateCharPal(0);
+	_mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+	updateCharacterAnim(0);
+	refreshAnimObjectsIfNeed();
+	return 0;
+}
+
 int KyraEngine_v3::o3_showBadConscience(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showBadConscience(%p) ()", (const void *)script);
 	showBadConscience();
@@ -392,6 +401,13 @@
 	return retValue;
 }
 
+int KyraEngine_v3::o3_disguiseMalcolm(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o3_disguiseMalcolm(%p) (%d)", (const void *)script, stackPos(0));
+	loadMalcolmShapes(stackPos(0));
+	updateDlgIndex();
+	return 0;
+}
+
 int KyraEngine_v3::o3_drawSceneShape(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o3_drawSceneShape(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
 
@@ -1195,7 +1211,7 @@
 	Opcode(o3_dummy);
 	Opcode(o3_dummy);
 	// 0x14
-	OpcodeUnImpl();
+	Opcode(o3_setCharacterAnimFrameFromFacing);
 	Opcode(o3_showBadConscience);
 	Opcode(o3_dummy);
 	Opcode(o3_hideBadConscience);
@@ -1246,7 +1262,7 @@
 	OpcodeUnImpl();
 	// 0x3c
 	Opcode(o3_removeItemsFromScene);
-	OpcodeUnImpl();
+	Opcode(o3_disguiseMalcolm);
 	Opcode(o3_drawSceneShape);
 	Opcode(o3_drawSceneShapeOnPage);
 	// 0x40

Modified: scummvm/trunk/engines/kyra/text_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text_v3.cpp	2008-04-25 17:43:40 UTC (rev 31726)
+++ scummvm/trunk/engines/kyra/text_v3.cpp	2008-04-25 17:59:38 UTC (rev 31727)
@@ -508,6 +508,46 @@
 	}
 }
 
+void KyraEngine_v3::updateDlgIndex() {
+	debugC(9, kDebugLevelMain, "KyraEngine_v3::updateDlgIndex()");
+	uint16 dlgIndex = _mainCharacter.dlgIndex;
+
+	if (_curChapter == 1) {
+		static const uint8 dlgIndexMoodNice[] = { 0x0C, 0x0E, 0x10, 0x0F, 0x11 };
+		static const uint8 dlgIndexMoodNormal[] = { 0x00, 0x02, 0x04, 0x03, 0x05 };
+		static const uint8 dlgIndexMoodEvil[] = { 0x06, 0x08, 0x0A, 0x09, 0x0B };
+
+		if (_malcolmsMood == 0)
+			dlgIndex = dlgIndexMoodNice[_malcolmShapes];
+		else if (_malcolmsMood == 1)
+			dlgIndex = dlgIndexMoodNormal[_malcolmShapes];
+		else if (_malcolmsMood == 2)
+			dlgIndex = dlgIndexMoodEvil[_malcolmShapes];
+	} else if (_curChapter == 2) {
+		if (dlgIndex >= 8)
+			dlgIndex -= 4;
+		if (dlgIndex >= 4)
+			dlgIndex -= 4;
+
+		if (_malcolmsMood == 0)
+			dlgIndex += 8;
+		else if (_malcolmsMood == 2)
+			dlgIndex += 4;
+	} else if (_curChapter == 4) {
+		if (dlgIndex >= 10)
+			dlgIndex -= 5;
+		if (dlgIndex >= 5)
+			dlgIndex -= 5;
+
+		if (_malcolmsMood == 0)
+			dlgIndex += 10;
+		else if (_malcolmsMood == 2)
+			dlgIndex += 5;
+	}
+
+	_mainCharacter.dlgIndex = dlgIndex;
+}
+
 void KyraEngine_v3::processDialog(int vocHighIndex, int vocHighBase, int funcNum) {
 	debugC(9, kDebugLevelMain, "KyraEngine_v3::processDialog(%d, %d, %d)", vocHighIndex, vocHighBase, funcNum);
 	bool running = true;


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