[Scummvm-cvs-logs] CVS: scummvm/saga animation.cpp,1.49,1.50 animation.h,1.26,1.27 scene.cpp,1.123,1.124 scene.h,1.64,1.65 script.h,1.97,1.98 sfuncs.cpp,1.143,1.144

Eugene Sandulenko sev at users.sourceforge.net
Sun Jul 24 19:40:12 CEST 2005


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

Modified Files:
	animation.cpp animation.h scene.cpp scene.h script.h 
	sfuncs.cpp 
Log Message:
More IHNM differences


Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- animation.cpp	19 Jul 2005 19:05:41 -0000	1.49
+++ animation.cpp	25 Jul 2005 02:38:41 -0000	1.50
@@ -572,7 +572,7 @@
 			outbuf_remain -= runcount;
 			continue;
 			break;
-		case 0x1F: // 31: Unusued?
+		case SAGA_FRAME_NOOP: // Unused
 			if (thisf_len - readS.pos() < 3) {
 				warning("0x%02X: Input buffer underrun", in_ch);
 				return FAILURE;
@@ -775,6 +775,12 @@
 					readS.readByte();
 				continue;
 				break;
+			case SAGA_FRAME_NOOP: // Does nothing
+				readS.readByte();
+				readS.readByte();
+				readS.readByte();
+				continue;
+				break;
 			default:
 				break;
 			}

Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- animation.h	19 Jul 2005 19:05:41 -0000	1.26
+++ animation.h	25 Jul 2005 02:38:43 -0000	1.27
@@ -30,12 +30,13 @@
 
 namespace Saga {
 
-#define MAX_ANIMATIONS 7
+#define MAX_ANIMATIONS 10
 #define DEFAULT_FRAME_TIME 140
 
 
 #define SAGA_FRAME_START 0xF
 #define SAGA_FRAME_END 0x3F
+#define SAGA_FRAME_NOOP 0x1F
 #define SAGA_FRAME_REPOSITION 0x30
 #define SAGA_FRAME_ROW_END 0x2F
 #define SAGA_FRAME_LONG_COMPRESSED_RUN	0x20

Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.cpp,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- scene.cpp	24 Jul 2005 17:04:15 -0000	1.123
+++ scene.cpp	25 Jul 2005 02:38:43 -0000	1.124
@@ -675,7 +675,7 @@
 
 	for (i = 0; i < _resourceListCount; i++) {
 		_resourceList[i].resourceId = readS.readUint16();
-		_resourceList[i].reourceType = readS.readUint16();
+		_resourceList[i].resourceType = readS.readUint16();
 		// demo version may contain invalid resourceId
 		_resourceList[i].invalid = !_vm->_resource->validResourceId(_sceneContext, _resourceList[i].resourceId);
 	}
@@ -688,6 +688,7 @@
 	size_t resourceDataLength;
 	const byte *palPointer;
 	size_t i;
+	int resType;
 
 	// Process the scene resource list
 	for (i = 0; i < _resourceListCount; i++) {
@@ -696,8 +697,25 @@
 		}
 		resourceData = _resourceList[i].buffer;
 		resourceDataLength = _resourceList[i].size;
-		switch (_resourceList[i].reourceType) {
+		
+		resType = _resourceList[i].resourceType;
+
+		if (_vm->getGameType() == GType_IHNM) {
+			// IHNM has more animation slots and so resource numbers are shifted
+			// We use this trick to avoid code duplication.
+			// SAGA_ANIM_X code is correctly dependent on _resourceList[i].resourceType
+			if (resType > SAGA_ANIM_7)
+				resType -= 3;
+		}
+
+		switch (resType) {
 		case SAGA_ACTOR:
+			//for (a = actorsInScene; a; a = a->nextInScene)
+			//	if (a->obj.figID == glist->file_id)
+			//		if (_vm->getGameType() == GType_ITE ||
+			//			((a->obj.flags & ACTORF_FINAL_FACE) & 0xff))
+			//			a->sprites = (xSpriteSet *)glist->offset;
+			warning("STUB: unimplemeted handler of SAGA_ACTOR resource");
 			break;
 		case SAGA_OBJECT:
 			break;
@@ -797,13 +815,17 @@
 		case SAGA_ANIM_6:
 		case SAGA_ANIM_7:
 			{
-				uint16 animId = _resourceList[i].reourceType - SAGA_ANIM_1;
+				uint16 animId = _resourceList[i].resourceType - SAGA_ANIM_1;
 
 				debug(3, "Loading animation resource animId=%i", animId);
 
 				_vm->_anim->load(animId, resourceData, resourceDataLength);
 			}
 			break;
+		case SAGA_ENTRY:
+			debug(3, "Loading entry list resource...");
+			loadSceneEntryList(resourceData, resourceDataLength);
+			break;
 		case SAGA_ISO_MULTI:
 			if (!(_sceneDescription.flags & kSceneFlagISO)) {
 				error("Scene::ProcessSceneResources(): not Iso mode");
@@ -817,12 +839,9 @@
 			debug(3, "Loading palette animation resource.");
 			_vm->_palanim->loadPalAnim(resourceData, resourceDataLength);
 			break;
-		case SAGA_ENTRY:
-			debug(3, "Loading entry list resource...");
-			loadSceneEntryList(resourceData, resourceDataLength);
-			break;
 		case SAGA_FACES:
-			_vm->_interface->loadScenePortraits(_resourceList[i].resourceId);
+			if (_vm->getGameType() == GType_ITE)
+				_vm->_interface->loadScenePortraits(_resourceList[i].resourceId);
 			break;
 		case SAGA_PALETTE:
 			{
@@ -841,7 +860,7 @@
 			}
 			break;
 		default:
-			error("Scene::ProcessSceneResources() Encountered unknown resource type %i", _resourceList[i].reourceType);
+			error("Scene::ProcessSceneResources() Encountered unknown resource type %i", _resourceList[i].resourceType);
 			break;
 		}
 	}

Index: scene.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.h,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- scene.h	24 Jul 2005 17:07:16 -0000	1.64
+++ scene.h	25 Jul 2005 02:38:43 -0000	1.65
@@ -78,6 +78,9 @@
 	SAGA_ANIM_5,
 	SAGA_ANIM_6,
 	SAGA_ANIM_7,
+	//SAGA_ANIM_8,  // IHNM. We use trick to avoid code duplication
+	//SAGA_ANIM_9,  
+	//SAGA_ANIM_10, 
 	SAGA_ISO_MULTI = 22,
 	SAGA_PAL_ANIM = 23,
 	SAGA_FACES = 24,
@@ -88,7 +91,7 @@
 
 struct SceneResourceData {
 	uint32 resourceId;
-	int reourceType;
+	int resourceType;
 	byte *buffer;
 	size_t size;
 	bool invalid;

Index: script.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.h,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- script.h	24 Jul 2005 13:41:49 -0000	1.97
+++ script.h	25 Jul 2005 02:38:43 -0000	1.98
@@ -537,6 +537,8 @@
 	void sfDebugShowData(SCRIPTFUNC_PARAMS);
 	void SF_stub(SCRIPTFUNC_PARAMS);
 	void sfNull(SCRIPTFUNC_PARAMS);
+	void sfPsychicProfile(SCRIPTFUNC_PARAMS);
+	void sfPsychicProfileOff(SCRIPTFUNC_PARAMS);
 };
 
 } // End of namespace Saga

Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -d -r1.143 -r1.144
--- sfuncs.cpp	24 Jul 2005 13:41:49 -0000	1.143
+++ sfuncs.cpp	25 Jul 2005 02:38:43 -0000	1.144
@@ -183,8 +183,8 @@
 		OPCODE(sfScriptWalkRelative),
 		OPCODE(sfScriptMoveRelative),
 		OPCODE(sfSimulSpeech2),
-		OPCODE(sfPlacard),
-		OPCODE(sfPlacardOff),
+		OPCODE(sfPsychicProfile),
+		OPCODE(sfPsychicProfileOff),
 		OPCODE(sfSetProtagState),
 		OPCODE(sfResumeBgdAnim),
 		OPCODE(sfThrowActor),
@@ -1466,6 +1466,18 @@
 
 }
 
+void Script::sfPsychicProfile(SCRIPTFUNC_PARAMS) {
+	for (int i = 0; i < nArgs; i++)
+		thread->pop();
+	warning("STUB: sfPsychicProfile()");
+}
+
+void Script::sfPsychicProfileOff(SCRIPTFUNC_PARAMS) {
+	for (int i = 0; i < nArgs; i++)
+		thread->pop();
+	warning("STUB: sfPsychicProfileOff()");
+}
+
 // Script function #50 (0x32)
 void Script::sfSetProtagState(SCRIPTFUNC_PARAMS) {
 	int protagState = thread->pop();





More information about the Scummvm-git-logs mailing list