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

whoozle noreply at scummvm.org
Thu Feb 12 19:45:17 UTC 2026


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

Summary:
e6eaf262cc PHOENIXVR: move state loading into enterScript(), implement ContextRestored function. Lochness saves are working now.
71aca526b7 PHOENIXVR: save non-existent limits as -1
ac8f732018 PHOENIXVR: reimplement file path resolution logic, mark loch ness as unstable as it appears to be working


Commit: e6eaf262cc88515a52a2192d618b53105bc088ea
    https://github.com/scummvm/scummvm/commit/e6eaf262cc88515a52a2192d618b53105bc088ea
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-02-12T19:44:50Z

Commit Message:
PHOENIXVR: move state loading into enterScript(), implement ContextRestored function. Lochness saves are working now.

Changed paths:
    engines/phoenixvr/commands.h
    engines/phoenixvr/phoenixvr.cpp
    engines/phoenixvr/phoenixvr.h


diff --git a/engines/phoenixvr/commands.h b/engines/phoenixvr/commands.h
index e74e2735755..2338a0e11f6 100644
--- a/engines/phoenixvr/commands.h
+++ b/engines/phoenixvr/commands.h
@@ -56,7 +56,7 @@ struct LoadSave_Enter_Script : public Script::Command {
 	LoadSave_Enter_Script(const Common::Array<Common::String> &args) : reloading(args[0]), notReloading(args[1]) {}
 	void exec(Script::ExecutionContext &ctx) const override {
 		debug("LoadSave_Enter_Script %s, %s", reloading.c_str(), notReloading.c_str());
-		auto loading = g_engine->isLoading();
+		auto loading = g_engine->enterScript();
 		g_engine->setVariable(reloading, loading);
 		g_engine->setVariable(notReloading, !loading);
 	}
@@ -440,9 +440,10 @@ struct LoadSave_Context_Restored : public Script::Command {
 
 	LoadSave_Context_Restored(const Common::Array<Common::String> &args) : progress(args[0]), done(args[1]) {}
 	void exec(Script::ExecutionContext &ctx) const override {
-		debug("LoadSave_Context_Restored: semi-stub: can be used to report that loading is in a progress");
+		int value = g_engine->getVariable(progress);
+		debug("LoadSave_Context_Restored: %s -> %d -> %s", progress.c_str(), value, done.c_str());
 		g_engine->setVariable(progress, 0);
-		g_engine->setVariable(done, g_engine->isLoading());
+		g_engine->setVariable(done, value);
 	}
 };
 
diff --git a/engines/phoenixvr/phoenixvr.cpp b/engines/phoenixvr/phoenixvr.cpp
index c05c6517cfa..46aa587c55c 100644
--- a/engines/phoenixvr/phoenixvr.cpp
+++ b/engines/phoenixvr/phoenixvr.cpp
@@ -586,7 +586,6 @@ void PhoenixVREngine::tick(float dt) {
 			test->scope.exec(ctx);
 		else
 			warning("no default script!");
-		_loading = false;
 	}
 
 	if (_nextTest >= 0) {
@@ -904,22 +903,11 @@ void PhoenixVREngine::captureContext() {
 	debug("captured %u bytes of state", _capturedState.size());
 }
 
-Common::Error PhoenixVREngine::loadGameStream(Common::SeekableReadStream *slot) {
-	auto state = GameState::load(*slot);
-
-	killTimer();
-	setNextScript(state.script);
-	// keep it alive until loading finishes.
-	auto currentScript = Common::move(_script);
-	assert(!_nextScript.empty());
-	loadNextScript();
-	{
-		auto test = _script->getWarp(0)->getDefaultTest();
-		Script::ExecutionContext ctx;
-		test->scope.exec(ctx);
-	}
+bool PhoenixVREngine::enterScript() {
+	if (_loadedState.empty())
+		return false;
 
-	Common::MemoryReadStream ms(state.state.data(), state.state.size());
+	Common::MemoryReadStream ms(_loadedState.data(), _loadedState.size());
 
 	auto angleX = ms.readSint32LE();
 	auto angleY = ms.readSint32LE();
@@ -999,8 +987,27 @@ Common::Error PhoenixVREngine::loadGameStream(Common::SeekableReadStream *slot)
 		if (!name.empty())
 			playSound(name, vol, -1, true, static_cast<float>(angle) * kPi);
 	}
+	_loadedState.clear();
+	return true;
+}
+
+Common::Error PhoenixVREngine::loadGameStream(Common::SeekableReadStream *slot) {
+	auto state = GameState::load(*slot);
+
+	killTimer();
+	setNextScript(state.script);
+	// keep it alive until loading finishes.
+	auto currentScript = Common::move(_script);
+	assert(!_nextScript.empty());
+	loadNextScript();
+
+	_loadedState = state.state;
+	{
+		auto test = _script->getWarp(0)->getDefaultTest();
+		Script::ExecutionContext ctx;
+		test->scope.exec(ctx);
+	}
 
-	_loading = true;
 	return Common::kNoError;
 }
 
diff --git a/engines/phoenixvr/phoenixvr.h b/engines/phoenixvr/phoenixvr.h
index 09866f7b959..e1f2fcf3373 100644
--- a/engines/phoenixvr/phoenixvr.h
+++ b/engines/phoenixvr/phoenixvr.h
@@ -164,10 +164,8 @@ public:
 	void setContextLabel(const Common::String &contextLabel) {
 		_contextLabel = contextLabel;
 	}
-
-	bool isLoading() const {
-		return _loading;
-	}
+	bool enterScript();
+	bool isLoading() const { return !_loadedState.empty(); }
 
 	void saveVariables();
 	void loadVariables();
@@ -232,7 +230,6 @@ private:
 	AngleX _angleX;
 	AngleY _angleY;
 	Audio::Mixer *_mixer;
-	bool _loading = false;
 	bool _showRegions = false;
 
 	static constexpr byte kPaused = 2;
@@ -243,6 +240,7 @@ private:
 	Common::String _contextScript;
 	Common::String _contextLabel;
 	Common::Array<byte> _capturedState;
+	Common::Array<byte> _loadedState;
 
 	Common::HashMap<int, Common::String> _textes;
 


Commit: 71aca526b740097bd45499e52d602c94a89e7751
    https://github.com/scummvm/scummvm/commit/71aca526b740097bd45499e52d602c94a89e7751
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-02-12T19:44:50Z

Commit Message:
PHOENIXVR: save non-existent limits as -1

Changed paths:
    engines/phoenixvr/script.h


diff --git a/engines/phoenixvr/script.h b/engines/phoenixvr/script.h
index b644365ef9b..27672fcf8da 100644
--- a/engines/phoenixvr/script.h
+++ b/engines/phoenixvr/script.h
@@ -40,6 +40,8 @@ inline float toAngle(int a) {
 }
 
 inline int fromAngle(float a) {
+	if (a == INFINITY || a == -INFINITY)
+		return -1;
 	static const float floatToAngle = 4096.0f / kPi;
 	return static_cast<int>(floatToAngle * a);
 }


Commit: ac8f73201831dd9d05677135a4b925895a02e265
    https://github.com/scummvm/scummvm/commit/ac8f73201831dd9d05677135a4b925895a02e265
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-02-12T19:44:50Z

Commit Message:
PHOENIXVR: reimplement file path resolution logic, mark loch ness as unstable as it appears to be working

You can run the game now, but it's yet untested.

Changed paths:
    engines/phoenixvr/detection_tables.h
    engines/phoenixvr/phoenixvr.cpp
    engines/phoenixvr/phoenixvr.h
    engines/phoenixvr/region_set.cpp
    engines/phoenixvr/region_set.h


diff --git a/engines/phoenixvr/detection_tables.h b/engines/phoenixvr/detection_tables.h
index 0f4d3d976b8..34769c32981 100644
--- a/engines/phoenixvr/detection_tables.h
+++ b/engines/phoenixvr/detection_tables.h
@@ -96,7 +96,7 @@ const ADGameDescription gameDescriptions[] = {
 		 "textes.txt", "294efb30581661615359ce234e2e85fb", 1596),
 	 Common::EN_ANY,
 	 Common::kPlatformWindows,
-	 ADGF_DROPPLATFORM | ADGF_UNSUPPORTED,
+	 ADGF_DROPPLATFORM | ADGF_UNSTABLE,
 	 GUIO1(GUIO_NONE)},
 
 	{"messenger",
diff --git a/engines/phoenixvr/phoenixvr.cpp b/engines/phoenixvr/phoenixvr.cpp
index 46aa587c55c..93f34dbdc03 100644
--- a/engines/phoenixvr/phoenixvr.cpp
+++ b/engines/phoenixvr/phoenixvr.cpp
@@ -93,11 +93,24 @@ Common::String PhoenixVREngine::removeDrive(const Common::String &path) {
 	else
 		return path.substr(2);
 }
-
-Common::Path PhoenixVREngine::resolve(const Common::String &name) {
-	auto p = _currentScriptPath.append(name, '\\').normalize();
-	debug("resolved %s to %s", name.c_str(), p.toString().c_str());
-	return p;
+Common::SeekableReadStream *PhoenixVREngine::open(const Common::String &name) {
+	debug("open %s", name.c_str());
+	auto packed = name.hasSuffixIgnoreCase(".lst");
+	auto filename = packed ? name.substr(0, name.size() - 4) + ".pak" : name;
+	auto p = _currentScriptPath.append(filename, '\\').normalize();
+	Common::ScopedPtr<Common::File> s(new Common::File());
+	debug("trying %s", p.toString().c_str());
+	if (s->open(p)) {
+		debug("opening %s: %s", name.c_str(), p.toString().c_str());
+		return packed ? unpack(*s) : s.release();
+	}
+	p = filename;
+	debug("trying %s", p.toString().c_str());
+	if (s->open(p)) {
+		debug("opening %s: %s", name.c_str(), p.toString().c_str());
+		return packed ? unpack(*s) : s.release();
+	}
+	return nullptr;
 }
 
 void PhoenixVREngine::setNextScript(const Common::String &nextScript) {
@@ -120,19 +133,11 @@ void PhoenixVREngine::loadNextScript() {
 	auto nextScript = Common::move(_nextScript);
 	_nextScript.clear();
 
-	Common::File file;
-	auto nextPath = resolve(nextScript);
-	if (file.open(nextPath)) {
-		_script.reset(new Script(file));
-	} else {
-		auto pakFile = nextPath;
-		pakFile = pakFile.removeExtension().append(".pak");
-		file.open(pakFile);
-		if (!file.isOpen())
-			error("can't open script file %s", nextScript.c_str());
-		Common::ScopedPtr<Common::SeekableReadStream> scriptStream(unpack(file));
-		_script.reset(new Script(*scriptStream));
-	}
+	Common::ScopedPtr<Common::SeekableReadStream> s(open(nextScript));
+	if (!s)
+		error("can't open script file %s", nextScript.c_str());
+
+	_script.reset(new Script(*s));
 	for (auto &var : _script->getVarNames())
 		declareVariable(var);
 
@@ -237,7 +242,7 @@ void PhoenixVREngine::returnToWarp() {
 
 const Region *PhoenixVREngine::getRegion(int idx) const {
 	if (!_regSet)
-		error("no region set");
+		return nullptr;
 	return (idx < static_cast<int>(_regSet->size())) ? &_regSet->getRegion(idx) : nullptr;
 }
 
@@ -276,13 +281,13 @@ int PhoenixVREngine::getVariable(const Common::String &name) const {
 void PhoenixVREngine::playSound(const Common::String &sound, uint8 volume, int loops, bool spatial, float angle) {
 	debug("play sound %s %d %d 3d: %d, angle: %g", sound.c_str(), volume, loops, spatial, angle);
 	Audio::SoundHandle h;
-	Common::ScopedPtr<Common::File> f(new Common::File());
-	if (!f->open(resolve(sound))) {
-		warning("sound %s couldn't be found", sound.c_str());
+	Common::ScopedPtr<Common::SeekableReadStream> stream(open(sound));
+	if (!stream) {
+		warning("can't load sound %s", sound.c_str());
 		return;
 	}
 
-	_mixer->playStream(Audio::Mixer::kPlainSoundType, &h, Audio::makeWAVStream(f.release(), DisposeAfterUse::YES), -1, volume);
+	_mixer->playStream(Audio::Mixer::kPlainSoundType, &h, Audio::makeWAVStream(stream.release(), DisposeAfterUse::YES), -1, volume);
 	if (loops < 0)
 		_mixer->loopChannel(h);
 	_sounds[sound] = Sound{h, spatial, angle, volume, loops};
@@ -303,7 +308,12 @@ void PhoenixVREngine::playMovie(const Common::String &movie) {
 	debug("playMovie %s", movie.c_str());
 	Video::FourXMDecoder dec;
 
-	if (dec.loadFile(resolve(movie))) {
+	auto *stream = open(movie);
+	if (!stream) {
+		warning("can't load movie %s", movie.c_str());
+		return;
+	}
+	if (dec.loadStream(stream)) {
 		dec.start();
 
 		bool playing = true;
@@ -353,14 +363,14 @@ void PhoenixVREngine::lockKey(int idx, const Common::String &warp) {
 }
 
 Graphics::Surface *PhoenixVREngine::loadSurface(const Common::String &path) {
-	Common::File file;
-	if (!file.open(resolve(path))) {
-		warning("can't find %s", path.c_str());
+	Common::ScopedPtr<Common::SeekableReadStream> stream(open(path));
+	if (!stream) {
+		warning("can't find image %s", path.c_str());
 		return nullptr;
 	}
 	if (path.hasSuffix(".pcx")) {
 		Image::PCXDecoder pcx;
-		if (pcx.loadStream(file)) {
+		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;
@@ -567,17 +577,26 @@ void PhoenixVREngine::tick(float dt) {
 		debug("warp %d -> %s %s", _nextWarp, _warp->vrFile.c_str(), _warp->testFile.c_str());
 		_nextWarp = -1;
 
-		Common::File vr;
-		if (vr.open(resolve(_warp->vrFile))) {
-			_vr = VR::loadStatic(_pixelFormat, vr);
-			if (_vr.isVR()) {
-				_mousePos = _screenCenter;
-				_mouseRel = {};
-			}
-			_system->lockMouse(_vr.isVR());
+		{
+			Common::ScopedPtr<Common::SeekableReadStream> stream(open(_warp->vrFile));
+			if (stream) {
+				_vr = VR::loadStatic(_pixelFormat, *stream);
+				if (_vr.isVR()) {
+					_mousePos = _screenCenter;
+					_mouseRel = {};
+				}
+				_system->lockMouse(_vr.isVR());
+			} else
+				debug("can't find vr file %s", _warp->vrFile.c_str());
 		}
 
-		_regSet.reset(new RegionSet(resolve(_warp->testFile)));
+		{
+			Common::ScopedPtr<Common::SeekableReadStream> stream(open(_warp->testFile));
+			if (stream)
+				_regSet.reset(new RegionSet(*stream));
+			else
+				debug("no region %s", _warp->testFile.c_str());
+		}
 
 		Script::ExecutionContext ctx;
 		debug("execute warp script %s", _warp->vrFile.c_str());
diff --git a/engines/phoenixvr/phoenixvr.h b/engines/phoenixvr/phoenixvr.h
index e1f2fcf3373..0175e9f7b6b 100644
--- a/engines/phoenixvr/phoenixvr.h
+++ b/engines/phoenixvr/phoenixvr.h
@@ -174,7 +174,7 @@ public:
 
 private:
 	static Common::String removeDrive(const Common::String &path);
-	Common::Path resolve(const Common::String &name);
+	Common::SeekableReadStream *open(const Common::String &name);
 
 	Graphics::Surface *loadSurface(const Common::String &path);
 	Graphics::Surface *loadCursor(const Common::String &path);
diff --git a/engines/phoenixvr/region_set.cpp b/engines/phoenixvr/region_set.cpp
index 5210cf229b3..848ea77bb91 100644
--- a/engines/phoenixvr/region_set.cpp
+++ b/engines/phoenixvr/region_set.cpp
@@ -25,18 +25,13 @@
 #include "phoenixvr/math.h"
 
 namespace PhoenixVR {
-RegionSet::RegionSet(const Common::Path &fname) {
-	Common::File file;
-	if (!file.open(fname)) {
-		debug("can't find region %s", fname.toString().c_str());
-		return;
-	}
-	auto n = file.readUint32LE();
+RegionSet::RegionSet(Common::SeekableReadStream &s) {
+	auto n = s.readUint32LE();
 	while (n--) {
-		auto a = file.readFloatLE();
-		auto b = file.readFloatLE();
-		auto c = file.readFloatLE();
-		auto d = file.readFloatLE();
+		auto a = s.readFloatLE();
+		auto b = s.readFloatLE();
+		auto c = s.readFloatLE();
+		auto d = s.readFloatLE();
 		_regions.push_back(Region{MIN(a, b), MAX(a, b), MIN(c, d), MAX(c, d)});
 		debug("region %s", _regions.back().toString().c_str());
 	}
diff --git a/engines/phoenixvr/region_set.h b/engines/phoenixvr/region_set.h
index 91926156779..187f6f9269e 100644
--- a/engines/phoenixvr/region_set.h
+++ b/engines/phoenixvr/region_set.h
@@ -23,12 +23,12 @@
 #define PHOENIXVR_REGIONS_H
 
 #include "common/array.h"
-#include "common/path.h"
 #include "phoenixvr/rectf.h"
 
 namespace Common {
 class String;
-}
+class SeekableReadStream;
+} // namespace Common
 
 namespace PhoenixVR {
 struct Region {
@@ -49,7 +49,7 @@ class RegionSet {
 	Common::Array<Region> _regions;
 
 public:
-	RegionSet(const Common::Path &fname);
+	RegionSet(Common::SeekableReadStream &s);
 	uint size() const { return _regions.size(); }
 	const Common::Array<Region> &getRegions() const { return _regions; }
 	const Region &getRegion(uint idx) const {




More information about the Scummvm-git-logs mailing list