[Scummvm-cvs-logs] SF.net SVN: scummvm: [28754] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Aug 27 12:03:23 CEST 2007


Revision: 28754
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28754&view=rev
Author:   thebluegr
Date:     2007-08-27 03:03:23 -0700 (Mon, 27 Aug 2007)

Log Message:
-----------
Some more test code for dynamically loading the introduction cutaway list

Modified Paths:
--------------
    scummvm/trunk/engines/saga/animation.h
    scummvm/trunk/engines/saga/ihnm_introproc.cpp

Modified: scummvm/trunk/engines/saga/animation.h
===================================================================
--- scummvm/trunk/engines/saga/animation.h	2007-08-27 09:30:23 UTC (rev 28753)
+++ scummvm/trunk/engines/saga/animation.h	2007-08-27 10:03:23 UTC (rev 28754)
@@ -140,12 +140,7 @@
 	void resume(uint16 animId, int cycles);
 	void resumeAll();
 	int16 getCurrentFrame(uint16 animId);
-	bool hasCutaway(void) {
-		return _cutawayActive;
-	}
-	void setCutAwayMode(int mode) {
-		_cutAwayMode = mode;
-	}
+
 	bool hasAnimation(uint16 animId) {
 		if (animId >= MAX_ANIMATIONS) {
 			if (animId < MAX_ANIMATIONS + ARRAYSIZE(_cutawayAnimations))
@@ -154,7 +149,13 @@
 		}
 		return (_animations[animId] != NULL);
 	}
-	int cutawayResourceID(int cutaway) { return _cutawayList[cutaway].animResourceId; }
+
+	bool hasCutaway(void) { return _cutawayActive; }
+	void setCutAwayMode(int mode) { _cutAwayMode = mode; }
+	int cutawayListLength() { return _cutawayListLength; }
+	int cutawayBgResourceID(int cutaway) { return _cutawayList[cutaway].backgroundResourceId; }
+	int cutawayAnimResourceID(int cutaway) { return _cutawayList[cutaway].animResourceId; }
+
 private:
 	void decodeFrame(AnimationData *anim, size_t frameOffset, byte *buf, size_t bufLength);
 	void fillFrameOffsets(AnimationData *anim);

Modified: scummvm/trunk/engines/saga/ihnm_introproc.cpp
===================================================================
--- scummvm/trunk/engines/saga/ihnm_introproc.cpp	2007-08-27 09:30:23 UTC (rev 28753)
+++ scummvm/trunk/engines/saga/ihnm_introproc.cpp	2007-08-27 10:03:23 UTC (rev 28754)
@@ -128,6 +128,9 @@
 
 	/*
 	// Test code - uses loadCutawayList to load the intro cutaways, like the original
+	LoadSceneParams IHNM_IntroList[10];
+	SceneDescription IHNM_IntroScene[10];
+	SceneResourceData IHNM_IntroScene_ResourceList[10][2];
 
 	ResourceContext *resourceContext;
 	//ResourceContext *soundContext;
@@ -150,11 +153,48 @@
 
 	// Load the cutaways for the title screens
 	_vm->_anim->loadCutawayList(resourcePointer, resourceLength);
-	
-	// Note that the resource ID needed is the returned ID minus one
-	printf("%i\n", _vm->_anim->cutawayResourceID(0));
-	printf("%i\n", _vm->_anim->cutawayResourceID(1));
-	printf("%i\n", _vm->_anim->cutawayResourceID(2));
+
+	for (int k = 0; k < _vm->_anim->cutawayListLength(); k++) {
+		// Scene resources
+		// Cutaway background resource
+		IHNM_IntroScene_ResourceList[k][0].resourceId = _vm->_anim->cutawayBgResourceID(k);
+		IHNM_IntroScene_ResourceList[k][0].resourceType = 2;
+		IHNM_IntroScene_ResourceList[k][0].buffer = 0;
+		IHNM_IntroScene_ResourceList[k][0].size = 0;
+		IHNM_IntroScene_ResourceList[k][0].invalid = false;
+		// Cutaway animation resource
+		IHNM_IntroScene_ResourceList[k][1].resourceId = _vm->_anim->cutawayAnimResourceID(k);
+		IHNM_IntroScene_ResourceList[k][1].resourceType = 2;
+		IHNM_IntroScene_ResourceList[k][1].buffer = 0;
+		IHNM_IntroScene_ResourceList[k][1].size = 0;
+		IHNM_IntroScene_ResourceList[k][1].invalid = false;
+
+		// Scene resource list
+		IHNM_IntroScene[k].resourceListResourceId = 0;
+		IHNM_IntroScene[k].endSlope = 0;
+		IHNM_IntroScene[k].beginSlope = 0;
+		IHNM_IntroScene[k].scriptModuleNumber = 0;
+		IHNM_IntroScene[k].sceneScriptEntrypointNumber = 0;
+		IHNM_IntroScene[k].startScriptEntrypointNumber = 0;
+		IHNM_IntroScene[k].musicResourceId = 0;
+		IHNM_IntroScene[k].resourceList = IHNM_IntroScene_ResourceList[k];
+		IHNM_IntroScene[k].resourceListCount = _vm->_anim->cutawayAnimResourceID(k) > 0 ? 2 : 1;
+
+		// Scene params
+		IHNM_IntroList[k].sceneDescriptor = 0;
+		IHNM_IntroList[k].loadFlag = kLoadByDescription;
+		IHNM_IntroList[k].sceneDescription = &IHNM_IntroScene[0];
+		if (k == 0)
+			IHNM_IntroList[k].sceneProc = Scene::SC_IHNMIntroMovieProc1;
+		else if (k == 1)
+			IHNM_IntroList[k].sceneProc = Scene::SC_IHNMIntroMovieProc2;
+		else
+			IHNM_IntroList[k].sceneProc = Scene::SC_IHNMIntroMovieProc3;
+		IHNM_IntroList[k].sceneSkipTarget = false;
+		IHNM_IntroList[k].transitionType = kTransitionNoFade;
+		IHNM_IntroList[k].actorsEntrance = 0;
+		IHNM_IntroList[k].chapter = NO_CHAPTER_CHANGE; 
+	}
 	*/
 
 	// The original used the "play video" mechanism for the first part of
@@ -168,6 +208,9 @@
 	else
 		n_introscenes = ARRAYSIZE(IHNMDEMO_IntroList);
 
+	// Use this instead when the scenes are loaded dynamically
+	// n_introscenes = _vm->_anim->cutawayListLength();
+
 	// Queue the company and title videos
 	if (_vm->getGameId() != GID_IHNM_DEMO) {
 		for (i = 0; i < n_introscenes; i++) {


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