[Scummvm-cvs-logs] CVS: scummvm/saga animation.cpp,1.45,1.46 animation.h,1.23,1.24 scene.cpp,1.111,1.112 scene.h,1.56,1.57

Andrew Kurushin h00ligan at users.sourceforge.net
Mon Jun 20 04:47:14 CEST 2005


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

Modified Files:
	animation.cpp animation.h scene.cpp scene.h 
Log Message:
fix animation bug at rats

Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- animation.cpp	15 Jun 2005 19:14:19 -0000	1.45
+++ animation.cpp	20 Jun 2005 11:46:32 -0000	1.46
@@ -44,20 +44,10 @@
 	reset();
 }
 
-uint16 Anim::load(const byte *animResourceData, size_t animResourceLength) {
+void Anim::load(uint16 animId, const byte *animResourceData, size_t animResourceLength) {
 	AnimationData *anim;
-	uint16 animId = 0;
-	uint16 i;
-
-	// Find an unused animation slot
-	for (i = 0; i < MAX_ANIMATIONS; i++) {
-		if (_animations[i] == NULL) {
-			animId = i;
-			break;
-		}
-	}
 
-	if (animId == MAX_ANIMATIONS) {
+	if (animId >= MAX_ANIMATIONS) {
 		error("Anim::load could not find unused animation slot");
 	}
 
@@ -74,8 +64,6 @@
 	anim->loopFrame = headerReadS.readByte() - 1;
 	anim->start = headerReadS.readUint16BE();
 
-	if (anim->start != 65535 && anim->start != 0)
-		warning("Anim::load: found different start: %d. Fix Anim::play()", anim->start);
 	anim->start += headerReadS.pos();
 
 
@@ -100,9 +88,7 @@
 	anim->frameTime = DEFAULT_FRAME_TIME;
 	anim->flags = 0;
 	anim->linkId = -1;
-	anim->state = ANIM_PAUSE;
-
-	return animId;
+	anim->state = ANIM_PAUSE;	
 }
 
 void Anim::link(int16 animId1, int16 animId2) {
@@ -814,7 +800,7 @@
 
 	for (i = 0; i < MAX_ANIMATIONS; i++) {
 		if (_animations[i] == NULL) {
-			break;
+			continue;
 		}
 
 		_vm->_console->DebugPrintf("%02d: Frames: %u Flags: %u\n", i, _animations[i]->maxFrame, _animations[i]->flags);

Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- animation.h	11 Jun 2005 17:24:06 -0000	1.23
+++ animation.h	20 Jun 2005 11:46:34 -0000	1.24
@@ -116,7 +116,7 @@
 	Anim(SagaEngine *vm);
 	~Anim(void);
 
-	uint16 load(const byte *animResourceData, size_t animResourceLength);
+	void load(uint16 animId, const byte *animResourceData, size_t animResourceLength);
 	void freeId(uint16 animId);
 	void play(uint16 animId, int vectorTime, bool playing = true);
 	void link(int16 animId1, int16 animId2);

Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.cpp,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- scene.cpp	19 Jun 2005 14:06:19 -0000	1.111
+++ scene.cpp	20 Jun 2005 11:46:34 -0000	1.112
@@ -114,7 +114,6 @@
 	memset(&_sceneDescription, 0, sizeof(_sceneDescription));
 	_resListEntries = 0;
 	_resList = NULL;
-	_animEntries = 0;
 	_sceneProc = NULL;
 	_objectMap = new ObjectMap(_vm);
 	_actionMap = new ObjectMap(_vm);
@@ -831,19 +830,11 @@
 		case SAGA_ANIM_6:
 		case SAGA_ANIM_7:
 			{
-				uint16 animId;
-
-				debug(0, "Loading animation resource...");
-
-				animId = _vm->_anim->load(resourceData, resourceDataLength);
-
-				SCENE_ANIMINFO *new_animinfo;
+				uint16 animId = _resList[i].res_type - SAGA_ANIM_1;
 
-				new_animinfo = _animList.pushBack().operator->();
+				debug(0, "Loading animation resource animId=%i", animId);
 
-				new_animinfo->anim_handle = animId;
-				new_animinfo->anim_res_number =  _resList[i].res_number;
-				_animEntries++;
+				_vm->_anim->load(animId, resourceData, resourceDataLength);
 			}
 			break;
 		case SAGA_ISO_MULTI:
@@ -949,10 +940,6 @@
 	_sceneStrings.freeMem();
 	_vm->_isoMap->freeMem();
 
-	_animList.clear();
-
-	_animEntries = 0;
-
 	_vm->_events->clearList();
 	_vm->textClearList(_textList);
 

Index: scene.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- scene.h	4 Jun 2005 12:34:38 -0000	1.56
+++ scene.h	20 Jun 2005 11:46:34 -0000	1.57
@@ -148,12 +148,6 @@
 	PALENTRY pal[256];
 };
 
-struct SCENE_ANIMINFO {
-	int anim_res_number;
-	int anim_handle;
-};
-
-typedef SortedList<SCENE_ANIMINFO> SceneAnimInfoList;
 
 enum SceneTransitionType {
 	kTransitionNoFade,
@@ -298,8 +292,6 @@
 	SceneDescription _sceneDescription;
 	int _resListEntries;
 	SCENE_RESLIST *_resList;
-	int _animEntries;
-	SceneAnimInfoList _animList;
 	SceneProc *_sceneProc;
 	SCENE_IMAGE _bg;
 	SCENE_IMAGE _bgMask;





More information about the Scummvm-git-logs mailing list