[Scummvm-cvs-logs] scummvm master -> 6afeec129504a16ee67c77b35cd27f0808d566d2

bluegr bluegr at gmail.com
Wed Dec 24 02:58:18 CET 2014


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

Summary:
78ba3e3246 ZVISION: Add error checking when loading in-game animations and videos
6edc16b686 ZVISION: Spacing
6afeec1295 ZVISION: Handle animation rewinding outside the RLF encoder


Commit: 78ba3e32466992ee7d01aabff493617a6401273e
    https://github.com/scummvm/scummvm/commit/78ba3e32466992ee7d01aabff493617a6401273e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-12-23T21:46:20+02:00

Commit Message:
ZVISION: Add error checking when loading in-game animations and videos

Changed paths:
    engines/zvision/video/rlf_decoder.cpp
    engines/zvision/video/video.cpp



diff --git a/engines/zvision/video/rlf_decoder.cpp b/engines/zvision/video/rlf_decoder.cpp
index b798093..76fd70c 100644
--- a/engines/zvision/video/rlf_decoder.cpp
+++ b/engines/zvision/video/rlf_decoder.cpp
@@ -39,9 +39,13 @@ RLFDecoder::~RLFDecoder() {
 bool RLFDecoder::loadStream(Common::SeekableReadStream *stream) {
 	close();
 
-	addTrack(new RLFVideoTrack(stream));
-
-	return true;
+	// Check if the stream is valid
+	if (stream && !stream->err() && stream->readUint32BE() == MKTAG('F', 'E', 'L', 'R')) {
+		addTrack(new RLFVideoTrack(stream));
+		return true;
+	} else {
+		return false;
+	}
 }
 
 RLFDecoder::RLFVideoTrack::RLFVideoTrack(Common::SeekableReadStream *stream)
@@ -81,10 +85,6 @@ RLFDecoder::RLFVideoTrack::~RLFVideoTrack() {
 }
 
 bool RLFDecoder::RLFVideoTrack::readHeader() {
-	if (_readStream->readUint32BE() != MKTAG('F', 'E', 'L', 'R')) {
-		return false;
-	}
-
 	// Read the header
 	_readStream->readUint32LE();                // Size1
 	_readStream->readUint32LE();                // Unknown1
diff --git a/engines/zvision/video/video.cpp b/engines/zvision/video/video.cpp
index 97fbd87..50a6fc1 100644
--- a/engines/zvision/video/video.cpp
+++ b/engines/zvision/video/video.cpp
@@ -48,7 +48,12 @@ Video::VideoDecoder *ZVision::loadAnimation(const Common::String &fileName) {
 		error("Unknown suffix for animation %s", fileName.c_str());
 
 	Common::File *_file = getSearchManager()->openFile(tmpFileName);
-	animation->loadStream(_file);
+	if (!_file)
+		error("Error opening %s", tmpFileName.c_str());
+
+	bool loaded = animation->loadStream(_file);
+	if (!loaded)
+		error("Error loading animation %s", tmpFileName.c_str());
 	
 	return animation;
 }


Commit: 6edc16b6863c3957efa5ad23596e904d89f8627c
    https://github.com/scummvm/scummvm/commit/6edc16b6863c3957efa5ad23596e904d89f8627c
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-12-23T21:54:53+02:00

Commit Message:
ZVISION: Spacing

Changed paths:
    engines/zvision/scripting/sidefx/animation_node.cpp



diff --git a/engines/zvision/scripting/sidefx/animation_node.cpp b/engines/zvision/scripting/sidefx/animation_node.cpp
index 4f26f03..134ab13 100644
--- a/engines/zvision/scripting/sidefx/animation_node.cpp
+++ b/engines/zvision/scripting/sidefx/animation_node.cpp
@@ -111,7 +111,6 @@ bool AnimationNode::process(uint32 deltaTimeInMillis) {
 			}
 
 			if (frame) {
-
 				uint32 dstw;
 				uint32 dsth;
 				if (_engine->getRenderManager()->getRenderTable()->getRenderState() == RenderTable::PANORAMA) {


Commit: 6afeec129504a16ee67c77b35cd27f0808d566d2
    https://github.com/scummvm/scummvm/commit/6afeec129504a16ee67c77b35cd27f0808d566d2
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-12-23T21:55:42+02:00

Commit Message:
ZVISION: Handle animation rewinding outside the RLF encoder

Changed paths:
    engines/zvision/video/rlf_decoder.cpp



diff --git a/engines/zvision/video/rlf_decoder.cpp b/engines/zvision/video/rlf_decoder.cpp
index 76fd70c..f1ac10b 100644
--- a/engines/zvision/video/rlf_decoder.cpp
+++ b/engines/zvision/video/rlf_decoder.cpp
@@ -200,9 +200,8 @@ bool RLFDecoder::RLFVideoTrack::seek(const Audio::Timestamp &time) {
 }
 
 const Graphics::Surface *RLFDecoder::RLFVideoTrack::decodeNextFrame() {
-	// When an animation ends, rewind
 	if (_curFrame == (int)_frameCount)
-		seek(Audio::Timestamp(0, getFrameRate().toInt()));
+		return NULL;
 	
 	applyFrameToCurrent(_curFrame);
 






More information about the Scummvm-git-logs mailing list