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

whoozle noreply at scummvm.org
Sun Mar 8 02:02:55 UTC 2026


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

Summary:
84b551af6e PHOENIXVR: skip empty vars in ifand/ifor
c74fe0ff35 PHOENIXVR: extract original name and allow gifs


Commit: 84b551af6eb62fb54249f6887a2c019aa2a4786f
    https://github.com/scummvm/scummvm/commit/84b551af6eb62fb54249f6887a2c019aa2a4786f
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-03-08T02:00:29Z

Commit Message:
PHOENIXVR: skip empty vars in ifand/ifor

Changed paths:
    engines/phoenixvr/commands.h


diff --git a/engines/phoenixvr/commands.h b/engines/phoenixvr/commands.h
index c757991cbfa..40187dbd775 100644
--- a/engines/phoenixvr/commands.h
+++ b/engines/phoenixvr/commands.h
@@ -653,6 +653,8 @@ struct IfAnd : public Script::Conditional {
 	void exec(Script::ExecutionContext &ctx) const override {
 		bool result = true;
 		for (auto &var : vars) {
+			if (var.empty())
+				continue;
 			auto value = g_engine->getVariable(var);
 			debug("ifand, %s: %d", var.c_str(), value);
 			if (!value)
@@ -672,6 +674,8 @@ struct IfOr : public Script::Conditional {
 	void exec(Script::ExecutionContext &ctx) const override {
 		bool result = false;
 		for (auto &var : vars) {
+			if (var.empty())
+				continue;
 			auto value = g_engine->getVariable(var);
 			debug("ifor, %s: %d", var.c_str(), value);
 			if (value)


Commit: c74fe0ff353cb64315b214a0f76cc6e5211fc81d
    https://github.com/scummvm/scummvm/commit/c74fe0ff353cb64315b214a0f76cc6e5211fc81d
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-03-08T02:01:22Z

Commit Message:
PHOENIXVR: extract original name and allow gifs

Changed paths:
    engines/phoenixvr/configure.engine
    engines/phoenixvr/pakf.cpp
    engines/phoenixvr/pakf.h
    engines/phoenixvr/phoenixvr.cpp
    engines/phoenixvr/phoenixvr.h


diff --git a/engines/phoenixvr/configure.engine b/engines/phoenixvr/configure.engine
index 991ed26130c..8598764f41e 100644
--- a/engines/phoenixvr/configure.engine
+++ b/engines/phoenixvr/configure.engine
@@ -1,3 +1,3 @@
 # This file is included from the main "configure" script
 # add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] [components]
-add_engine phoenixvr "Phoenix VR" yes "" "" "highres 16bit" ""
+add_engine phoenixvr "Phoenix VR" yes "" "" "highres 16bit gif" ""
diff --git a/engines/phoenixvr/pakf.cpp b/engines/phoenixvr/pakf.cpp
index 904dba61505..05b8e0ac3cd 100644
--- a/engines/phoenixvr/pakf.cpp
+++ b/engines/phoenixvr/pakf.cpp
@@ -65,7 +65,7 @@ void unpack_3(uint8 *dstBegin, uint32 dstSize, Common::SeekableReadStream &input
 }
 } // namespace
 
-Common::SeekableReadStream *unpack(Common::SeekableReadStream &input) {
+Common::SeekableReadStream *unpack(Common::SeekableReadStream &input, Common::String *filename) {
 	input.seek(0);
 	byte header[0x24];
 	input.read(header, sizeof(header));
@@ -77,11 +77,15 @@ Common::SeekableReadStream *unpack(Common::SeekableReadStream &input) {
 	if (fsize != input.size())
 		error("invalid PAKF size");
 
-	ms.skip(16); // original name
+	if (filename)
+		*filename = ms.readString(0, 16);
+	else
+		ms.skip(16);
+
 	auto method = ms.readUint32();
 	auto csize = ms.readUint32();
 	auto usize = ms.readUint32();
-	debug("method %u, compressed size: %u, uncompressed size: %u", method, csize, usize);
+	debug("method %u, compressed size: %u, uncompressed size: %u %s", method, csize, usize, filename ? filename->c_str() : "");
 	Common::SharedPtr<byte> mem(new uint8[usize], Common::ArrayDeleter<byte>());
 	switch (method) {
 	case 3:
diff --git a/engines/phoenixvr/pakf.h b/engines/phoenixvr/pakf.h
index 7a6501e8c8e..5398e7eee50 100644
--- a/engines/phoenixvr/pakf.h
+++ b/engines/phoenixvr/pakf.h
@@ -25,7 +25,7 @@
 #include "common/stream.h"
 
 namespace PhoenixVR {
-Common::SeekableReadStream *unpack(Common::SeekableReadStream &input);
+Common::SeekableReadStream *unpack(Common::SeekableReadStream &input, Common::String *filename);
 }
 
 #endif
diff --git a/engines/phoenixvr/phoenixvr.cpp b/engines/phoenixvr/phoenixvr.cpp
index b0f61a1a366..57f3e25bdc5 100644
--- a/engines/phoenixvr/phoenixvr.cpp
+++ b/engines/phoenixvr/phoenixvr.cpp
@@ -37,6 +37,7 @@
 #include "graphics/framelimiter.h"
 #include "graphics/managed_surface.h"
 #include "graphics/palette.h"
+#include "image/gif.h"
 #include "image/pcx.h"
 #include "phoenixvr/console.h"
 #include "phoenixvr/game_state.h"
@@ -104,7 +105,7 @@ Common::String PhoenixVREngine::removeDrive(const Common::String &path) {
 		return path.substr(2);
 }
 
-Common::SeekableReadStream *PhoenixVREngine::tryOpen(const Common::Path &name) {
+Common::SeekableReadStream *PhoenixVREngine::tryOpen(const Common::Path &name, Common::String *origName) {
 	Common::ScopedPtr<Common::File> s(new Common::File());
 	if (s->open(name)) {
 		auto nameStr = name.toString();
@@ -118,19 +119,19 @@ Common::SeekableReadStream *PhoenixVREngine::tryOpen(const Common::Path &name) {
 	pakName = pakName.substr(0, dotPos) + ".pak";
 	if (s->open(Common::Path{pakName})) {
 		debug("opened %s", pakName.c_str());
-		return unpack(*s);
+		return unpack(*s, origName);
 	}
 
 	return nullptr;
 }
 
-Common::SeekableReadStream *PhoenixVREngine::open(Common::String filename) {
+Common::SeekableReadStream *PhoenixVREngine::open(const Common::String &filename, Common::String *origName) {
 	debug("open %s", filename.c_str());
-	auto *stream = tryOpen(_currentScriptPath.append(filename, '\\').normalize());
+	auto *stream = tryOpen(_currentScriptPath.append(filename, '\\').normalize(), origName);
 	if (stream)
 		return stream;
 
-	stream = tryOpen(Common::Path{filename});
+	stream = tryOpen(Common::Path{filename}, origName);
 	if (stream)
 		return stream;
 
@@ -409,26 +410,32 @@ void PhoenixVREngine::lockKey(int idx, const Common::String &warp) {
 }
 
 Graphics::Surface *PhoenixVREngine::loadSurface(const Common::String &path) {
-	Common::ScopedPtr<Common::SeekableReadStream> stream(open(path));
+	Common::String filename = path;
+	Common::ScopedPtr<Common::SeekableReadStream> stream(open(path, &filename));
 	if (!stream) {
 		warning("can't find image %s", path.c_str());
 		return nullptr;
 	}
-	if (path.hasSuffix(".pcx")) {
-		Image::PCXDecoder pcx;
-		if (pcx.loadStream(*stream)) {
-			auto *s = pcx.getSurface()->convertTo(Graphics::BlendBlit::getSupportedPixelFormat(), pcx.hasPalette() ? pcx.getPalette().data() : nullptr);
-			if (s) {
-				byte r = 0, g = 0, b = 0;
-				s->applyColorKey(r, g, b);
-			}
-			return s;
-		}
-		warning("pcx decode failed on %s", path.c_str());
+	Common::ScopedPtr<Image::ImageDecoder> dec;
+	if (filename.hasSuffixIgnoreCase(".pcx")) {
+		dec.reset(new Image::PCXDecoder);
+	} else if (filename.hasSuffixIgnoreCase(".gif")) {
+		dec.reset(new Image::GIFDecoder);
+	} else {
+		warning("can't find decoder for %s", filename.c_str());
 		return nullptr;
 	}
-	warning("can't find decoder for %s", path.c_str());
-	return nullptr;
+	if (!dec->loadStream(*stream)) {
+		warning("decoding %s failed", filename.c_str());
+		return nullptr;
+	}
+	auto *palette = dec->hasPalette() ? dec->getPalette().data() : nullptr;
+	auto *s = dec->getSurface()->convertTo(Graphics::BlendBlit::getSupportedPixelFormat(), palette);
+	if (s) {
+		byte r = 0, g = 0, b = 0;
+		s->applyColorKey(r, g, b);
+	}
+	return s;
 }
 
 Graphics::Surface *PhoenixVREngine::loadCursor(const Common::String &path) {
diff --git a/engines/phoenixvr/phoenixvr.h b/engines/phoenixvr/phoenixvr.h
index 805e4f5774b..35377f49555 100644
--- a/engines/phoenixvr/phoenixvr.h
+++ b/engines/phoenixvr/phoenixvr.h
@@ -182,8 +182,8 @@ public:
 
 private:
 	static Common::String removeDrive(const Common::String &path);
-	Common::SeekableReadStream *open(Common::String name);
-	Common::SeekableReadStream *tryOpen(const Common::Path &name);
+	Common::SeekableReadStream *open(const Common::String &name, Common::String *origName = nullptr);
+	Common::SeekableReadStream *tryOpen(const Common::Path &name, Common::String *origName);
 
 	Graphics::Surface *loadSurface(const Common::String &path);
 	Graphics::Surface *loadCursor(const Common::String &path);




More information about the Scummvm-git-logs mailing list