[Scummvm-git-logs] scummvm master -> b251fd5aff96285c225d037851afd74adaa8e14b

sev- noreply at scummvm.org
Sun Sep 1 21:33:31 UTC 2024


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

Summary:
b251fd5aff QDENGINE: Load (no processing yet) QDA versions 105 and 106


Commit: b251fd5aff96285c225d037851afd74adaa8e14b
    https://github.com/scummvm/scummvm/commit/b251fd5aff96285c225d037851afd74adaa8e14b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-01T23:33:17+02:00

Commit Message:
QDENGINE: Load (no processing yet) QDA versions 105 and 106

Changed paths:
    engines/qdengine/qdcore/qd_animation.cpp
    engines/qdengine/system/graphics/gr_tile_animation.cpp
    engines/qdengine/system/graphics/gr_tile_animation.h


diff --git a/engines/qdengine/qdcore/qd_animation.cpp b/engines/qdengine/qdcore/qd_animation.cpp
index fcb6a8193d7..cb4d0567db1 100644
--- a/engines/qdengine/qdcore/qd_animation.cpp
+++ b/engines/qdengine/qdcore/qd_animation.cpp
@@ -555,9 +555,6 @@ bool qdAnimation::qda_load(Common::Path fpath) {
 		tile_flag = fh->readByte();
 	}
 
-	if (version > 104)
-		warning("qdAnimation::qda_load(): Animation version > 104: %d, '%s'", version, transCyrillic(fpath.toString()));
-
 	if (!tile_flag) {
 		if (num_scales) {
 			_scales.resize(num_scales);
@@ -598,7 +595,7 @@ bool qdAnimation::qda_load(Common::Path fpath) {
 
 		debugC(1, kDebugLoad, "qdAnimation::qda_load() tileAnimation %s", transCyrillic(fpath.toString()));
 		_tileAnimation = new grTileAnimation;
-		_tileAnimation->load(fh);
+		_tileAnimation->load(fh, version);
 	}
 
 	init_size();
diff --git a/engines/qdengine/system/graphics/gr_tile_animation.cpp b/engines/qdengine/system/graphics/gr_tile_animation.cpp
index c1d974c14a5..959500bc765 100644
--- a/engines/qdengine/system/graphics/gr_tile_animation.cpp
+++ b/engines/qdengine/system/graphics/gr_tile_animation.cpp
@@ -185,9 +185,10 @@ void grTileAnimation::addFrame(const uint32 *frame_data) {
 	}
 }
 
-bool grTileAnimation::load(Common::SeekableReadStream *fh) {
+bool grTileAnimation::load(Common::SeekableReadStream *fh, int version) {
+	int debugLevel = (version >= 105) ? 2 : 7;
 
-	debugC(7, kDebugLoad, "grTileAnimation::load(): pos start: %lu", fh->pos());
+	debugC(debugLevel, kDebugLoad, "grTileAnimation::load(): pos start: %lu", fh->pos());
 
 	_frameCount = fh->readSint32LE();
 	_frameSize.x = fh->readSint32LE();
@@ -196,14 +197,50 @@ bool grTileAnimation::load(Common::SeekableReadStream *fh) {
 	_frameTileSize.y = fh->readSint32LE();
 	uint32 size = fh->readUint32LE();
 
-	debugC(7, kDebugLoad, "grTileAnimation::load(): frameCount: %d  frame: %d x %d tile: %d x %d compsize: %d", _frameCount, _frameSize.x, _frameSize.y,
+	debugC(debugLevel, kDebugLoad, "grTileAnimation::load(): frameCount: %d, frame: %d x %d, tile: %d x %d, comp: %d", _frameCount, _frameSize.x, _frameSize.y,
 		_frameTileSize.x, _frameTileSize.y, size);
 
 	_compression = grTileCompressionMethod(size);
 
+	if (version >= 105) {
+		size = fh->readUint32LE();
+		_scaleArray.resize(size);
+
+		debugC(2, kDebugLoad, "grTileAnimation::load(): pos: %ld _scaleArray size: %u", fh->pos() - 4, size);
+
+		debugCN(3, kDebugLoad, "   ");
+
+		for (uint i = 0; i < size; i++) {
+			_scaleArray[i] = fh->readFloatLE();
+			debugCN(3, kDebugLoad, " %f ", _scaleArray[i]);
+		}
+		debugCN(3, kDebugLoad, "\n");
+	}
+
+	_frameSizeArray.resize(_frameCount);
+
+	if (version < 106) {
+		for (uint i = 0; i < _frameCount; i++)
+			_frameSizeArray[i] = _frameSize;
+	} else {
+		debugC(2, kDebugLoad, "grTileAnimation::load(): pos: %ld _frameSizeArray size: %u", fh->pos() - 4, _frameCount);
+
+		debugCN(3, kDebugLoad, "   ");
+
+		for (uint i = 0; i < _frameCount; i++) {
+			_frameSizeArray[i].x = fh->readUint32LE();
+			_frameSizeArray[i].y = fh->readUint32LE();
+
+			debugCN(3, kDebugLoad, " %d x %d, ", _frameSizeArray[i].x, _frameSizeArray[i].y);
+		}
+		debugCN(3, kDebugLoad, "\n");
+	}
+
 	size = fh->readUint32LE();
 	_frameIndex.resize(size);
 	debugC(7, kDebugLoad, "grTileAnimation::load(): pos: %ld _frameIndex size: %u", fh->pos() - 4, size);
+
+	debugCN(8, kDebugLoad, "   ");
 	for (uint i = 0; i < size; i++) {
 		_frameIndex[i] = fh->readUint32LE();
 		debugCN(8, kDebugLoad, " %d ", _frameIndex[i]);
@@ -222,6 +259,8 @@ bool grTileAnimation::load(Common::SeekableReadStream *fh) {
 		_tileData[i] = fh->readUint32LE();
 	}
 
+	debugC(2, kDebugLoad, "  --> grTileAnimation::load(): pos: %ld remaining: %ld", fh->pos(), fh->size() - fh->pos());
+
 	return true;
 }
 
diff --git a/engines/qdengine/system/graphics/gr_tile_animation.h b/engines/qdengine/system/graphics/gr_tile_animation.h
index d443d038cc4..6754402eec1 100644
--- a/engines/qdengine/system/graphics/gr_tile_animation.h
+++ b/engines/qdengine/system/graphics/gr_tile_animation.h
@@ -67,7 +67,7 @@ public:
 
 	void addFrame(const uint32 *frame_data);
 
-	bool load(Common::SeekableReadStream *fh);
+	bool load(Common::SeekableReadStream *fh, int version);
 
 	void drawFrame(const Vect2i &position, int32 frame_index, int32 mode = 0) const;
 	void drawFrame(const Vect2i &position, int frame_index, float angle, int mode = 0) const;
@@ -95,6 +95,8 @@ private:
 	int _frameCount;
 
 	typedef Std::vector<uint32> FrameIndex;
+	Std::vector<float> _scaleArray;
+
 	/// индекс кадров - номера тайлов, из которых состоят кадры
 	/// _frameTileSize.x * _frameTileSize.y на кадр
 	FrameIndex _frameIndex;
@@ -106,6 +108,8 @@ private:
 	/// данные тайлов
 	TileData _tileData;
 
+	Std::vector<Vect2i> _frameSizeArray;
+
 	static CompressionProgressHandler _progressHandler;
 	static void *_progressHandlerContext;
 };
@@ -113,4 +117,3 @@ private:
 } // namespace QDEngine
 
 #endif // QDENGINE_SYSTEM_GRAPHICS_GR_TILE_ANIMATION_H
-




More information about the Scummvm-git-logs mailing list