[Scummvm-git-logs] scummvm master -> 50548fb4aa76ddd91206dea5c4fc46b10c5938b7

whoozle noreply at scummvm.org
Wed Jul 22 22:55:46 UTC 2026


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

Summary:
a78440f23b PHOENIXVR: make returnToWarp implementation more readable
5c97c367da PHOENIXVR: stop script execution on goto warp
a89c244820 PHOENIXVR: Implement V2 load/save/enter_level
50548fb4aa PHOENIXVR: implement warp history


Commit: a78440f23be19bbaf19877bb9c74899828280468
    https://github.com/scummvm/scummvm/commit/a78440f23be19bbaf19877bb9c74899828280468
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-07-22T23:55:06+01:00

Commit Message:
PHOENIXVR: make returnToWarp implementation more readable

Changed paths:
    engines/phoenixvr/phoenixvr.cpp


diff --git a/engines/phoenixvr/phoenixvr.cpp b/engines/phoenixvr/phoenixvr.cpp
index 5c4c29b7de1..41ae28d7f09 100644
--- a/engines/phoenixvr/phoenixvr.cpp
+++ b/engines/phoenixvr/phoenixvr.cpp
@@ -825,6 +825,8 @@ void PhoenixVREngine::goToLevel(const Common::String &name) {
 void PhoenixVREngine::returnToWarp() {
 	if (_prevWarp < 0) {
 		warning("return: no previous warp");
+		_nextWarp = -1;
+		return;
 	}
 	debug("returning to previous warp: %d", _prevWarp);
 	_nextWarp = _prevWarp;


Commit: 5c97c367dad75f8d1eb713140458d77848fafd5d
    https://github.com/scummvm/scummvm/commit/5c97c367dad75f8d1eb713140458d77848fafd5d
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-07-22T23:55:06+01:00

Commit Message:
PHOENIXVR: stop script execution on goto warp

Changed paths:
    engines/phoenixvr/commands_v2.cpp


diff --git a/engines/phoenixvr/commands_v2.cpp b/engines/phoenixvr/commands_v2.cpp
index 5c4e67b5c78..88e3f0ab60b 100644
--- a/engines/phoenixvr/commands_v2.cpp
+++ b/engines/phoenixvr/commands_v2.cpp
@@ -94,7 +94,8 @@ struct Goto_Warp : public Command {
 	Common::String name;
 	Goto_Warp(const Common::Array<Common::String> &args) : name(args[0]) {}
 	void exec(ExecutionContext &ctx) const override {
-		g_engine->goToWarp(name, true);
+		if (g_engine->goToWarp(name, true))
+			ctx.running = false;
 	}
 };
 


Commit: a89c2448200dd656fed5b2eac2d2d2334dd0b826
    https://github.com/scummvm/scummvm/commit/a89c2448200dd656fed5b2eac2d2d2334dd0b826
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-07-22T23:55:06+01:00

Commit Message:
PHOENIXVR: Implement V2 load/save/enter_level

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


diff --git a/engines/phoenixvr/commands_v2.cpp b/engines/phoenixvr/commands_v2.cpp
index 88e3f0ab60b..4220ddec1f8 100644
--- a/engines/phoenixvr/commands_v2.cpp
+++ b/engines/phoenixvr/commands_v2.cpp
@@ -70,7 +70,10 @@ struct Goto_Level : public Command {
 struct Enter_Level : public Command {
 	Enter_Level(const Common::Array<Common::String> &args) {}
 	void exec(ExecutionContext &ctx) const override {
-		g_engine->enterLevel();
+		bool loaded = g_engine->enterScript();
+		debug("enter level, loaded: %d", loaded);
+		if (loaded)
+			ctx.running = false;
 	}
 };
 
@@ -86,7 +89,11 @@ struct Save_Slot : public Command {
 	Common::String name;
 	Save_Slot(const Common::Array<Common::String> &args) : index(atoi(args[0].c_str())), name(args[1]) {}
 	void exec(ExecutionContext &ctx) const override {
-		warning("save slot %d: %s", index, name.c_str());
+		debug("save slot %d: %s", index, name.c_str());
+		g_engine->captureContext();
+		auto err = g_engine->saveGameState(index, name);
+		if (err.getCode() != Common::kNoError)
+			warning("saving to slot %d failed: %s / %d", index, err.getDesc().c_str(), (int)err.getCode());
 	}
 };
 
@@ -351,19 +358,23 @@ struct Test_Slot : public Command {
 	Common::String var;
 	Test_Slot(const Common::Array<Common::String> &args) : index(atoi(args[0].c_str())), sprite(args[1]), var(args[2]) {}
 	void exec(ExecutionContext &ctx) const override {
-		debug("test slot %d %s %s", index, sprite.c_str(), var.c_str());
-		g_engine->testSaveSlot(index);
+		auto value = g_engine->testSaveSlot(index);
+		debug("test slot %d %s %s, slot exists: %d", index, sprite.c_str(), var.c_str(), value);
+		g_engine->setVariable(var, value);
+		if (!value)
+			return;
+		g_engine->loadSaveCardSprite(index, sprite);
 	}
 };
 
 struct Load_Slot : public Command {
-	Common::String slot;
-	Load_Slot(const Common::Array<Common::String> &args) : slot(args[0]) {}
+	int slot;
+	Load_Slot(const Common::Array<Common::String> &args) : slot(atoi(args[0].c_str())) {}
 	void exec(ExecutionContext &ctx) const override {
-		auto index = valueOf(slot);
-		auto err = g_engine->loadGameState(index);
+		debug("load slot %d", slot);
+		auto err = g_engine->loadGameState(slot);
 		if (err.getCode() != Common::ErrorCode::kNoError)
-			error("loading state failed %d", index);
+			error("loading state failed %d", slot);
 	}
 };
 
diff --git a/engines/phoenixvr/phoenixvr.cpp b/engines/phoenixvr/phoenixvr.cpp
index 41ae28d7f09..b78bbb1e0c1 100644
--- a/engines/phoenixvr/phoenixvr.cpp
+++ b/engines/phoenixvr/phoenixvr.cpp
@@ -1295,10 +1295,6 @@ void PhoenixVREngine::spriteScreen(int index, const Common::String &name, int x,
 	sprite.y = y;
 }
 
-void PhoenixVREngine::enterLevel() {
-	enterScript();
-}
-
 void PhoenixVREngine::setLens(int index, const Common::String &name, float size) {
 	debug("set lens %d %s %g", index, name.c_str(), size);
 	if (index < 0 || index >= 16)
@@ -2145,6 +2141,21 @@ bool PhoenixVREngine::testSaveSlot(int idx) const {
 	return _saveFileMan->exists(getSaveStateName(idx));
 }
 
+void PhoenixVREngine::loadSaveCardSprite(int idx, const Common::String &name) {
+	auto &sprite = _loadedSprites[name];
+	sprite.reset();
+	Common::ScopedPtr<Common::InSaveFile> slot(_saveFileMan->openForLoading(getSaveStateName(idx)));
+	if (!slot)
+		return;
+
+	auto state = GameState::load(*slot);
+	auto *src = state.getThumbnail(_pixelFormat);
+	sprite.reset(new Graphics::ManagedSurface(src->w, src->h, src->format));
+	sprite->copyFrom(*src);
+	src->free();
+	delete src;
+}
+
 void PhoenixVREngine::captureContext() {
 	Common::MemoryWriteStreamDynamic ms(DisposeAfterUse::YES);
 
diff --git a/engines/phoenixvr/phoenixvr.h b/engines/phoenixvr/phoenixvr.h
index 50bfe8cdee3..75e43838c7c 100644
--- a/engines/phoenixvr/phoenixvr.h
+++ b/engines/phoenixvr/phoenixvr.h
@@ -201,6 +201,7 @@ public:
 	Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
 	void drawSlot(int idx, int face, int x, int y);
 	void drawSaveCard(int idx);
+	void loadSaveCardSprite(int idx, const Common::String &name);
 	void captureContext();
 
 	void setContextLabel(const Common::String &contextLabel) {
@@ -239,7 +240,6 @@ public:
 
 	void spriteLoad(const Common::String &name, const Common::String &path);
 	void spriteScreen(int index, const Common::String &name, int x, int y);
-	void enterLevel();
 	void setLens(int index, const Common::String &name, float size);
 	void resetLensflare();
 	void setLensflare(float x, float y);


Commit: 50548fb4aa76ddd91206dea5c4fc46b10c5938b7
    https://github.com/scummvm/scummvm/commit/50548fb4aa76ddd91206dea5c4fc46b10c5938b7
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-07-22T23:55:06+01:00

Commit Message:
PHOENIXVR: implement warp history

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


diff --git a/engines/phoenixvr/commands_v2.cpp b/engines/phoenixvr/commands_v2.cpp
index 4220ddec1f8..f9cfdee05e3 100644
--- a/engines/phoenixvr/commands_v2.cpp
+++ b/engines/phoenixvr/commands_v2.cpp
@@ -101,7 +101,7 @@ struct Goto_Warp : public Command {
 	Common::String name;
 	Goto_Warp(const Common::Array<Common::String> &args) : name(args[0]) {}
 	void exec(ExecutionContext &ctx) const override {
-		if (g_engine->goToWarp(name, true))
+		if (g_engine->goToWarp(name))
 			ctx.running = false;
 	}
 };
diff --git a/engines/phoenixvr/phoenixvr.cpp b/engines/phoenixvr/phoenixvr.cpp
index b78bbb1e0c1..9670d5f9cad 100644
--- a/engines/phoenixvr/phoenixvr.cpp
+++ b/engines/phoenixvr/phoenixvr.cpp
@@ -805,6 +805,12 @@ bool PhoenixVREngine::goToWarp(const Common::String &warp, bool savePrev) {
 		_prevWarp = _warpIdx;
 		saveThumbnail();
 	}
+	if (version() == 2) {
+		if (_warpIdx >= 0)
+			_prevWarpHistory.push_back(_warpIdx);
+		if (_prevWarpHistory.size() > 10)
+			_prevWarpHistory.pop_front();
+	}
 	return true;
 }
 
@@ -823,14 +829,19 @@ void PhoenixVREngine::goToLevel(const Common::String &name) {
 }
 
 void PhoenixVREngine::returnToWarp() {
-	if (_prevWarp < 0) {
-		warning("return: no previous warp");
-		_nextWarp = -1;
-		return;
+	if (version() == 2) {
+		_nextWarp = _prevWarpHistory.back();
+		_prevWarpHistory.pop_back();
+	} else {
+		if (_prevWarp < 0) {
+			warning("return: no previous warp");
+			_nextWarp = -1;
+			return;
+		}
+		debug("returning to previous warp: %d", _prevWarp);
+		_nextWarp = _prevWarp;
+		_prevWarp = -1;
 	}
-	debug("returning to previous warp: %d", _prevWarp);
-	_nextWarp = _prevWarp;
-	_prevWarp = -1;
 }
 
 const Region *PhoenixVREngine::getRegion(int idx) const {
diff --git a/engines/phoenixvr/phoenixvr.h b/engines/phoenixvr/phoenixvr.h
index 75e43838c7c..34cc80b16be 100644
--- a/engines/phoenixvr/phoenixvr.h
+++ b/engines/phoenixvr/phoenixvr.h
@@ -313,6 +313,7 @@ private:
 	Script::ConstWarpPtr _warp;
 	int _nextWarp = -1;
 	int _prevWarp = -1;
+	Common::List<int> _prevWarpHistory; // V2 stack of warps
 	int _hoverIndex = -1;
 	int _messengerInventoryHover = -1;
 	int _nextTest = -1;




More information about the Scummvm-git-logs mailing list