[Scummvm-cvs-logs] SF.net SVN: scummvm: [22565] scummvm/trunk/engines/kyra/vqa.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sun May 21 13:09:02 CEST 2006


Revision: 22565
Author:   eriktorbjorn
Date:     2006-05-21 13:08:14 -0700 (Sun, 21 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22565&view=rev

Log Message:
-----------
Grotesque hack to support the jung2.vqa movie. Either the VQA is less well
understood than I hoped, or the offset to the first frame of the movie is
completely out to lunch. Scan the file for the first VQFR chunk and use that
offset instead.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/vqa.cpp
Modified: scummvm/trunk/engines/kyra/vqa.cpp
===================================================================
--- scummvm/trunk/engines/kyra/vqa.cpp	2006-05-21 19:08:10 UTC (rev 22564)
+++ scummvm/trunk/engines/kyra/vqa.cpp	2006-05-21 20:08:14 UTC (rev 22565)
@@ -26,8 +26,7 @@
 // The benchl.vqa movie (or whatever it is) is not supported. It does not have
 // a FINF chunk.
 //
-// The jung2.vqa movie does not work. The offset to the first frame is strange,
-// so we don't find the palette.
+// The jung2.vqa movie does work, but only thanks to a grotesque hack.
 
 #include "common/stdafx.h"
 #include "common/system.h"
@@ -367,6 +366,39 @@
 			for (int i = 0; i < _header.numFrames; i++) {
 				_frameInfo[i] = 2 * _file.readUint32LE();
 			}
+
+			// HACK: This flag is set in jung2.vqa, and its
+			// purpose, if it has one, is unknown. It can't be a
+			// general purpose flag, because in large movies the
+			// frame offsets can be large enough to set this flag.
+			//
+			// At least in my copy of Kyrandia 3, _frameInfo[0] is
+			// 0x81000098, and the desired index is 0x4716. So the
+			// value should be 0x80004716, but I don't want to
+			// hard-code it. Instead, scan the file for the offset
+			// to the first VQFR chunk.
+
+			if (_frameInfo[0] & 0x01000000) {
+				uint32 oldPos = _file.pos();
+
+				while (1) {
+					uint32 scanTag = readTag();
+					uint32 scanSize = _file.readUint32BE();
+
+					if (_file.eof())
+						break;
+
+					if (scanTag == MKID_BE('VQFR')) {
+						_frameInfo[0] = (_file.pos() - 8) | 0x80000000;
+						break;
+					}
+
+					_file.seek(scanSize, SEEK_CUR);
+				}
+
+				_file.seek(oldPos);
+			}
+
 			break;
 
 		default:


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list