[Scummvm-cvs-logs] CVS: scummvm/scumm/smush chunk.cpp,1.24,1.25 chunk.h,1.12,1.13 smush_player.cpp,1.100,1.101

Eugene Sandulenko sev at users.sourceforge.net
Tue Jan 27 16:40:21 CET 2004


Update of /cvsroot/scummvm/scummvm/scumm/smush
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1203/scumm/smush

Modified Files:
	chunk.cpp chunk.h smush_player.cpp 
Log Message:
Fixed plenty of bugs:
  o Seek error. Now it seems to cover all cases
  o Shadows in tunnels on mineroad
  o Renamed some function to match functionality
  o bug #867555 (Problems between Mink Farm and Poyhoga)
  o Ben disappearing in car chase


Index: chunk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/chunk.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- chunk.cpp	6 Jan 2004 12:45:31 -0000	1.24
+++ chunk.cpp	25 Jan 2004 05:25:50 -0000	1.25
@@ -189,8 +189,7 @@
 	return _data->readUint32LE();
 }
 
-void FileChunk::reinit() {
-	_data->seek(0);
+void FileChunk::reinit(uint32 offset) {
 	_offset = 0;
 	_type = _data->readUint32BE();
 	_size = _data->readUint32BE();

Index: chunk.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/chunk.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- chunk.h	6 Jan 2004 12:45:31 -0000	1.12
+++ chunk.h	25 Jan 2004 05:25:50 -0000	1.13
@@ -83,7 +83,7 @@
 	short getShort();
 	uint16 getWord();
 	uint32 getDword();
-	void reinit();
+	void reinit(uint32 offset);
 };
 
 class MemoryChunk : public BaseChunk {

Index: smush_player.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/smush_player.cpp,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- smush_player.cpp	19 Jan 2004 19:34:48 -0000	1.100
+++ smush_player.cpp	25 Jan 2004 05:25:50 -0000	1.101
@@ -292,7 +292,7 @@
 
 void SmushPlayer::checkBlock(const Chunk &b, Chunk::type type_expected, uint32 min_size) {
 	if (type_expected != b.getType()) {
-		error("Chunk type is different from expected : %d != %d", b.getType(), type_expected);
+		error("Chunk type is different from expected : %x != %x", b.getType(), type_expected);
 	}
 	if (min_size > b.getSize()) {
 		error("Chunk size is inferior than minimum required size : %d < %d", b.getSize(), min_size);
@@ -867,7 +867,7 @@
 		handleFrame(*sub);
 		break;
 	default:
-		error("Unknown Chunk found at %x: %d, %d", _base->tell(), sub->getType(), sub->getSize());
+		error("Unknown Chunk found at %x: %x, %d", _base->tell(), sub->getType(), sub->getSize());
 	}
 	delete sub;
 }
@@ -951,24 +951,26 @@
 
 void SmushPlayer::seekSan(const char *file, const char *directory, int32 pos, int32 contFrame) {
 	Chunk *sub;
-	
+
 	if (file) {
 		if (_base)
 			delete _base;
 
 		_base = new FileChunk(file, directory);
+		pos = 0;
 	} else {
-		_base->reinit();
+		_base->reinit(pos);
+		debug(0, "Yup");
 	}
 
-	sub = _base->subBlock();
-	checkBlock(*sub, TYPE_AHDR);
-	handleAnimHeader(*sub);
-
-	if (pos != 8) {
-		_base->reinit();
+	if (pos != 8 && pos) {
 		_base->seek(pos, FileChunk::seek_start);
 		_middleAudio = true;
+	} else {
+		_base->seek(pos, FileChunk::seek_start);
+		sub = _base->subBlock();
+		checkBlock(*sub, TYPE_AHDR);
+		handleAnimHeader(*sub);
 	}
 
 	_frame = contFrame;





More information about the Scummvm-git-logs mailing list