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

sev- noreply at scummvm.org
Mon Sep 2 15:01:50 UTC 2024


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:
87c5b89fc1 QDENGINE: Implement debug routine for scanning all animations
face0cd0a5 QDENGINE: Fix potential crash on closing winvideo


Commit: 87c5b89fc145b0e95afab4a62d3b427c6a61980e
    https://github.com/scummvm/scummvm/commit/87c5b89fc145b0e95afab4a62d3b427c6a61980e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-02T17:01:39+02:00

Commit Message:
QDENGINE: Implement debug routine for scanning all animations

Changed paths:
    engines/qdengine/qdengine.cpp


diff --git a/engines/qdengine/qdengine.cpp b/engines/qdengine/qdengine.cpp
index 405d7b2f168..0d8a2a57534 100644
--- a/engines/qdengine/qdengine.cpp
+++ b/engines/qdengine/qdengine.cpp
@@ -112,6 +112,8 @@ const char *QDEngineEngine::getExeName() const {
 	return _gameDescription->filesDescriptions[1].fileName;
 }
 
+void scan_qda();
+
 Common::Error QDEngineEngine::run() {
 	initGraphics(640, 480);
 	_screen = new Graphics::Screen();
@@ -226,6 +228,8 @@ Common::Error QDEngineEngine::run() {
 	// Activate the window
 	grDispatcher::activate(true);
 
+	//scan_qda();
+
 	Common::Event event;
 
 	while (!exit_flag && !_gameD->need_exit()) {
@@ -474,6 +478,46 @@ void restore_graphics() {
 		dp->set_flag(qdGameDispatcher::FULLSCREEN_REDRAW_FLAG);
 }
 
+void scan_qda() {
+	for (int i = 0; i < 3; i++) {
+		Common::Archive *archive = qdFileManager::instance().get_package(i);
+		Common::ArchiveMemberList members;
+
+		if (archive)
+			archive->listMembers(members);
+
+			for (auto &it : members) {
+				if (it->getFileName().hasSuffixIgnoreCase(".qda")) {
+					Common::SeekableReadStream *fh;
+
+					if (!qdFileManager::instance().open_file(&fh, it->getPathInArchive()))
+						continue;
+
+					int32 version = fh->readSint32LE();
+
+					if (version < 105)
+						continue;
+
+					/* int sx = */fh->readSint32LE();
+					/* int sy = */fh->readSint32LE();
+					/* int length = */fh->readFloatLE();
+					/* int32 fl = */fh->readSint32LE();
+					/* int32 num_fr = */fh->readSint32LE();
+
+					/*int num_scales = */fh->readSint32LE();
+
+					char tile_flag = fh->readByte();
+
+					if (tile_flag) {
+						qdAnimation anim;
+
+						anim.qda_load(it->getPathInArchive());
+					}
+				}
+			}
+	}
+}
+
 } // namespace QDEngine
 
 // Translates cp-1251..utf-8


Commit: face0cd0a51c2633cdcb78e3fa684da38caad959
    https://github.com/scummvm/scummvm/commit/face0cd0a51c2633cdcb78e3fa684da38caad959
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-02T17:01:39+02:00

Commit Message:
QDENGINE: Fix potential crash on closing winvideo

Changed paths:
    engines/qdengine/qdcore/util/WinVideo.cpp


diff --git a/engines/qdengine/qdcore/util/WinVideo.cpp b/engines/qdengine/qdcore/util/WinVideo.cpp
index a7dd26e6dd0..c07d675cebb 100644
--- a/engines/qdengine/qdcore/util/WinVideo.cpp
+++ b/engines/qdengine/qdcore/util/WinVideo.cpp
@@ -155,7 +155,8 @@ bool winVideo::get_movie_size(int &sx, int &sy) {
 }
 
 void winVideo::close_file() {
-	_videostream->close();
+	if (_videostream)
+		_videostream->close();
 }
 
 } // namespace QDEngine




More information about the Scummvm-git-logs mailing list