[Scummvm-cvs-logs] scummvm master -> 93763acd328df7a25a77136769086329761c8023

bluegr bluegr at gmail.com
Tue Jan 22 03:24:29 CET 2013


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
63660cd019 TOLTECS: Whitespace fixes and explanation of some magic values
93763acd32 TOLTECS: Don't change the archive position when loading a resource (bug #3601567)


Commit: 63660cd019eaa5d45a4f58b4f3865c43a9e58988
    https://github.com/scummvm/scummvm/commit/63660cd019eaa5d45a4f58b4f3865c43a9e58988
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-01-21T18:21:00-08:00

Commit Message:
TOLTECS: Whitespace fixes and explanation of some magic values

Changed paths:
    engines/toltecs/movie.cpp



diff --git a/engines/toltecs/movie.cpp b/engines/toltecs/movie.cpp
index 201a0d6..8bc0051 100644
--- a/engines/toltecs/movie.cpp
+++ b/engines/toltecs/movie.cpp
@@ -52,7 +52,6 @@ MoviePlayer::~MoviePlayer() {
 }
 
 void MoviePlayer::playMovie(uint resIndex) {
-
 	const uint32 subtitleSlot = kMaxScriptSlots - 1;
 	int16 savedSceneWidth = _vm->_sceneWidth;
 	int16 savedSceneHeight = _vm->_sceneHeight;
@@ -109,7 +108,7 @@ void MoviePlayer::playMovie(uint resIndex) {
 		debug(0, "chunkType = %d; chunkSize = %d", chunkType, chunkSize);
 
 		// Skip audio chunks - we've already queued them in
-		// fetchAudioChunks() above
+		// fetchAudioChunks()
 		if (chunkType == kChunkAudio) {
 			_vm->_arc->skip(chunkSize);
 		} else {
@@ -208,7 +207,6 @@ void MoviePlayer::playMovie(uint resIndex) {
 }
 
 void MoviePlayer::fetchAudioChunks() {
-
 	uint32 startOfs = _vm->_arc->pos();
 	uint32 chunkCount = _chunkCount;
 	uint prefetchChunkCount = 0;
@@ -219,7 +217,7 @@ void MoviePlayer::fetchAudioChunks() {
 	while (chunkCount-- && prefetchChunkCount < _framesPerSoundChunk / 2) {
 		byte chunkType = _vm->_arc->readByte();
 		uint32 chunkSize = _vm->_arc->readUint32LE();
-		if (chunkType == 4) {
+		if (chunkType == kChunkAudio) {
 			byte *chunkBuffer = (byte *)malloc(chunkSize);
 			_vm->_arc->read(chunkBuffer, chunkSize);
 			_audioStream->queueBuffer(chunkBuffer, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
@@ -234,7 +232,6 @@ void MoviePlayer::fetchAudioChunks() {
 	_lastPrefetchOfs = _vm->_arc->pos();
 
 	_vm->_arc->seek(startOfs, SEEK_SET);
-
 }
 
 void MoviePlayer::unpackPalette(byte *source, byte *dest, int elemCount, int elemSize) {
@@ -254,10 +251,12 @@ void MoviePlayer::unpackPalette(byte *source, byte *dest, int elemCount, int ele
 }
 
 void MoviePlayer::unpackRle(byte *source, byte *dest) {
-	int size = 256000;
+	int size = 256000;	// 640x400
+	//int packedSize = 0;
 	while (size > 0) {
 		byte a = *source++;
 		byte b = *source++;
+		//packedSize += 2;
 		if (a == 0) {
 			dest += b;
 			size -= b;
@@ -267,6 +266,7 @@ void MoviePlayer::unpackRle(byte *source, byte *dest) {
 			size -= a;
 		}
 	}
+	//debug("Packed RLE size: %d", packedSize);
 }
 
 bool MoviePlayer::handleInput() {


Commit: 93763acd328df7a25a77136769086329761c8023
    https://github.com/scummvm/scummvm/commit/93763acd328df7a25a77136769086329761c8023
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-01-21T18:23:11-08:00

Commit Message:
TOLTECS: Don't change the archive position when loading a resource (bug #3601567)

Changed paths:
    engines/toltecs/resource.cpp



diff --git a/engines/toltecs/resource.cpp b/engines/toltecs/resource.cpp
index 437b4a9..d660750 100644
--- a/engines/toltecs/resource.cpp
+++ b/engines/toltecs/resource.cpp
@@ -107,11 +107,13 @@ Resource *ResourceCache::load(uint resIndex) {
 	} else {
 		debug(1, "ResourceCache::load(%d) From disk", resIndex);
 
+		int32 curPos = _vm->_arc->pos();
 		Resource *resItem = new Resource();
 		resItem->size = _vm->_arc->openResource(resIndex);
 		resItem->data = new byte[resItem->size];
 		_vm->_arc->read(resItem->data, resItem->size);
 		_vm->_arc->closeResource();
+		_vm->_arc->seek(curPos);
 
 		_cache[resIndex] = resItem;
 






More information about the Scummvm-git-logs mailing list