[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.192,1.193 game.cpp,1.102,1.103 sfuncs.cpp,1.170,1.171 sprite.cpp,1.64,1.65

Eugene Sandulenko sev at users.sourceforge.net
Thu Oct 6 22:32:19 CEST 2005


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

Modified Files:
	actor.cpp game.cpp sfuncs.cpp sprite.cpp 
Log Message:
Draw acrtors (eriktorbjorn, rejoice).

It:
 o breaks intro, as now everything seems to be shifted.
 o Shows problem at our firt scene where there is no inventory drawn
 o Shows problem with our animation code, actor frames are wrong
 o Draws actors upside down and probably at wrong location
 o Due to incomplete implementation of whichObject() it crashes when
   you hover over characters.


Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.192
retrieving revision 1.193
diff -u -d -r1.192 -r1.193
--- actor.cpp	4 Oct 2005 23:38:19 -0000	1.192
+++ actor.cpp	7 Oct 2005 05:31:08 -0000	1.193
@@ -403,7 +403,7 @@
 		
 	_actorsCount = actorCount;
 
-	if ((int)(actorListLength / ACTOR_INHM_SIZE) < _actorsCount) {
+	if (actorListLength != (uint)_actorsCount * ACTOR_INHM_SIZE) {
 		error("Actor::loadActorList wrong actorlist length");
 	}
 
@@ -412,9 +412,9 @@
 	_actors = (ActorData **)malloc(_actorsCount * sizeof(*_actors));
 	for (i = 0; i < _actorsCount; i++) {
 		actor = _actors[i] = new ActorData();
-		actor->_id = actorIndexToId(i);
+		actor->_id = objectIndexToId(kGameObjectActor, i); //actorIndexToId(i);
 		actor->_index = i;
-		debug(9, "init actor id=%d index=%d", actor->_id, actor->_index);
+		debug(0, "init actor id=0x%x index=%d", actor->_id, actor->_index);
 		actorS.readUint32LE(); //next displayed	
 		actorS.readByte(); //type
 		actor->_flags = actorS.readByte();
@@ -429,10 +429,7 @@
 		actor->_frameListResourceId = actorS.readUint32LE();
 		debug(0, "%d: %d, %d", i, actor->_spriteListResourceId, actor->_frameListResourceId);
 		actor->_scriptEntrypointNumber = actorS.readUint32LE();
-		actorS.readByte();
-		actorS.readByte();
-		actorS.readByte();
-		actorS.readByte();
+		actorS.readUint32LE(); // xSprite *dSpr;
 		actorS.readUint16LE(); //LEFT
 		actorS.readUint16LE(); //RIGHT
 		actorS.readUint16LE(); //TOP
@@ -486,14 +483,7 @@
 
 	for (i = 0; i < _actorsCount; i++) {
 		actor = _actors[i];
-		if (actor->_flags & kExtended) {
-			loadActorResources(actor);
-
-			if (actor->_disabled) {
-				warning("Disabling actor Id=%d index=%d", actor->_id, actor->_index);
-			}
-			break;
-		}
+		loadActorResources(actor);
 	}
 
 	_centerActor = _protagonist = _actors[protagonistIdx];
@@ -1520,6 +1510,7 @@
 	_drawOrderList.clear();
 	for (i = 0; i < _actorsCount; i++) {
 		actor = _actors[i];
+
 		if (!actor->_inScene)
 			continue;
 

Index: game.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/game.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- game.cpp	29 Sep 2005 15:57:41 -0000	1.102
+++ game.cpp	7 Oct 2005 05:31:13 -0000	1.103
@@ -567,7 +567,7 @@
 	640, 480,	// logical width&height
 
 	0,			// scene path y offset
-	304,		// scene height
+	618,		// scene height
 
 	0,			// status x offset
 	304,		// status y offset

Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -d -r1.170 -r1.171
--- sfuncs.cpp	4 Oct 2005 23:38:19 -0000	1.170
+++ sfuncs.cpp	7 Oct 2005 05:31:13 -0000	1.171
@@ -1100,7 +1100,7 @@
 	frameType =  thread->pop();
 	frameOffset =  thread->pop();
 
-	debug(1, "sfPlaceActor(id = %d, x=%d, y=%d, dir=%d, frameType=%d, frameOffset=%d)", actorId, actorLocation.x,
+	debug(1, "sfPlaceActor(id = 0x%x, x=%d, y=%d, dir=%d, frameType=%d, frameOffset=%d)", actorId, actorLocation.x,
 		  actorLocation.y, actorDirection, frameType, frameOffset);
 
 	actor = _vm->_actor->getActor(actorId);
@@ -1122,7 +1122,6 @@
 	}
 
 	actor->_targetObject = ID_NOTHING;
-
 }
 
 // Script function #44 (0x2C) nonblocking

Index: sprite.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sprite.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- sprite.cpp	15 Aug 2005 01:01:52 -0000	1.64
+++ sprite.cpp	7 Oct 2005 05:31:13 -0000	1.65
@@ -108,20 +108,32 @@
 		spritePointer = spriteListData;
 		spritePointer += offset;
 
-		MemoryReadStream readS2(spritePointer, (_vm->getFeatures() & GF_MAC_RESOURCES) ? 8 : 4);
+		MemoryReadStream readS2(spritePointer, (_vm->getFeatures() & GF_MAC_RESOURCES || _vm->getGameType() == GType_IHNM) ? 8 : 4);
 
-		if (!(_vm->getFeatures() & GF_MAC_RESOURCES)) {
-			spriteInfo->xAlign = readS2.readSByte();
-			spriteInfo->yAlign = readS2.readSByte();
+		if (_vm->getGameType() == GType_ITE) {
+			if (!(_vm->getFeatures() & GF_MAC_RESOURCES)) {
+				spriteInfo->xAlign = readS2.readSByte();
+				spriteInfo->yAlign = readS2.readSByte();
 
-			spriteInfo->width = readS2.readByte();
-			spriteInfo->height = readS2.readByte();
+				spriteInfo->width = readS2.readByte();
+				spriteInfo->height = readS2.readByte();
+			} else {
+				spriteInfo->xAlign = readS2.readSint16BE();
+				spriteInfo->yAlign = readS2.readSint16BE();
+
+				spriteInfo->width = readS2.readUint16BE();
+				spriteInfo->height = readS2.readUint16BE();
+			}
 		} else {
-			spriteInfo->xAlign = readS2.readSint16BE();
-			spriteInfo->yAlign = readS2.readSint16BE();
+			spriteInfo->xAlign = readS2.readSint16LE();
+			spriteInfo->yAlign = readS2.readSint16LE();
 
-			spriteInfo->width = readS2.readUint16BE();
-			spriteInfo->height = readS2.readUint16BE();
+			spriteInfo->width = readS2.readUint16LE();
+			spriteInfo->height = readS2.readUint16LE();
+
+			if (spriteInfo->width > 100) { // FIXME: HACK
+				spriteInfo->width = spriteInfo->height = 0;
+			}
 		}
 		spriteDataPointer = spritePointer + readS2.pos();
 		outputLength = spriteInfo->width * spriteInfo->height;
@@ -156,7 +168,6 @@
 		width = spriteInfo->width;
 		buffer = spriteInfo->decodedBuffer;
 	}
-
 }
 
 void Sprite::drawClip(Surface *ds, const Rect &clipRect, const Point &spritePointer, int width, int height, const byte *spriteBuffer) {
@@ -219,6 +230,7 @@
 
 	spritePointer.x = screenCoord.x + xAlign;
 	spritePointer.y = screenCoord.y + yAlign;
+
 	drawClip(ds, clipRect, spritePointer, width, height, spriteBuffer);
 }
 





More information about the Scummvm-git-logs mailing list