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

whoozle noreply at scummvm.org
Mon Jul 20 00:22:49 UTC 2026


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

Summary:
ffb246cf71 PHOENIXVR: Make command mandatory, add enough V2 stubs to see main menu


Commit: ffb246cf71106c1adfd95fd1f28c9a006b8dc90a
    https://github.com/scummvm/scummvm/commit/ffb246cf71106c1adfd95fd1f28c9a006b8dc90a
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-07-20T01:22:37+01:00

Commit Message:
PHOENIXVR: Make command mandatory, add enough V2 stubs to see main menu

Multiply 2D rect to match screen coordinates.

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


diff --git a/engines/phoenixvr/commands_v2.cpp b/engines/phoenixvr/commands_v2.cpp
index c5a40d4f01f..5597ab32eab 100644
--- a/engines/phoenixvr/commands_v2.cpp
+++ b/engines/phoenixvr/commands_v2.cpp
@@ -51,6 +51,29 @@ struct Sub : public Command {
 	}
 };
 
+struct Go_Back : public Command {
+	Go_Back(const Common::Array<Common::String> &args) {}
+	void exec(ExecutionContext &ctx) const override {
+		debug("go back");
+	}
+};
+
+struct Goto_Level : public Command {
+	Common::String name;
+	Goto_Level(const Common::Array<Common::String> &args) : name(args[0]) {}
+	void exec(ExecutionContext &ctx) const override {
+		debug("goto level %s", name.c_str());
+	}
+};
+
+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);
+	}
+};
+
 struct Play_AnimBloc : public Command {
 	Common::String name;
 	Common::String dstVar;
@@ -125,17 +148,168 @@ struct Cursor_Set : public Command {
 	}
 };
 
+struct Retrieve_State : public Command {
+	Common::String index;
+	Common::String var;
+
+	Retrieve_State(const Common::Array<Common::String> &args) : index(args[0]), var(args[1]) {}
+
+	void exec(ExecutionContext &ctx) const override {
+		debug("retrieve state stub %s %s", index.c_str(), var.c_str());
+		g_engine->setVariable(var, 1);
+	}
+};
+
+struct Store_State : public Command {
+	Common::String index;
+	Common::String var;
+
+	Store_State(const Common::Array<Common::String> &args) : index(args[0]), var(args[1]) {}
+
+	void exec(ExecutionContext &ctx) const override {
+		debug("store state stub %s %s -> %d", index.c_str(), var.c_str(), valueOf(var));
+	}
+};
+
+struct Fade : public Command {
+	int start;
+	int stop;
+	int speed;
+
+	Fade(const Common::Array<Common::String> &args) : speed(valueOf(args[1].c_str())) {
+		auto &type = args[0];
+		if (type == "_FADE_IN") {
+			start = -255;
+			stop = 0;
+		} else if (type == "_FADE_OUT") {
+			start = 0;
+			stop = -255;
+		} else
+			error("unknown fade type: %s", type.c_str());
+	}
+
+	void exec(ExecutionContext &ctx) const override {
+		g_engine->fade(start, stop, speed);
+	}
+};
+
+struct Sprite_Load : public Command {
+	Common::String name;
+	Common::String path;
+	Common::String unk;
+	Sprite_Load(const Common::Array<Common::String> &args) : name(args[0]), path(args[1]), unk(args[2]) {}
+	void exec(ExecutionContext &ctx) const override {
+		debug("sprite load %s %s %s", name.c_str(), path.c_str(), unk.c_str());
+	}
+};
+
+struct Sprite_Screen : public Command {
+	int index;
+	Common::String name;
+	Common::String x;
+	Common::String y;
+	Sprite_Screen(const Common::Array<Common::String> &args) : index(atoi(args[0].c_str())) {
+		if (args.size() > 1)
+			name = args[1];
+		if (args.size() > 2)
+			x = args[2];
+		if (args.size() > 3)
+			y = args[3];
+	}
+	void exec(ExecutionContext &ctx) const override {
+		debug("sprite screen %d %s %s %s", index, name.c_str(), x.c_str(), y.c_str());
+	}
+};
+
+struct Set_Lens : public Command {
+	Common::String index;
+	Common::String name;
+	Common::String unk;
+	Set_Lens(const Common::Array<Common::String> &args) : index(args[0]), name(args[1]), unk(args[2]) {}
+	void exec(ExecutionContext &ctx) const override {
+		debug("set lens %s %s %s", index.c_str(), name.c_str(), unk.c_str());
+	}
+};
+
+struct Set_Lensflare : public Command {
+	Set_Lensflare(const Common::Array<Common::String> &args) {}
+	void exec(ExecutionContext &ctx) const override {
+		debug("set lensflare");
+	}
+};
+
+struct Set_Jump_Key : public Command {
+	Common::String key;
+	Common::String warp;
+	Set_Jump_Key(const Common::Array<Common::String> &args) : key(args[0]), warp(args.size() > 1 ? args[1] : Common::String{}) {}
+	void exec(ExecutionContext &ctx) const override {
+		debug("set jump key %s %s", key.c_str(), warp.c_str());
+	}
+};
+
+struct Play_Movie : public Command {
+	Common::String path;
+	Play_Movie(const Common::Array<Common::String> &args) : path(args[0]) {}
+	void exec(ExecutionContext &ctx) const override {
+		g_engine->playMovie(path);
+	}
+};
+
+struct Test_Slot : public Command {
+	int index;
+	Common::String sprite;
+	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);
+	}
+};
+
+struct Load_Slot : public Command {
+	Common::String slot;
+	Load_Slot(const Common::Array<Common::String> &args) : slot(args[0]) {}
+	void exec(ExecutionContext &ctx) const override {
+		auto index = valueOf(slot);
+		auto err = g_engine->loadGameState(index);
+		if (err.getCode() != Common::ErrorCode::kNoError)
+			error("loading state failed %d", index);
+	}
+};
+
+struct Stop_Timer : public Command {
+	Stop_Timer(const Common::Array<Common::String> &args) {}
+	void exec(ExecutionContext &ctx) const override {
+		g_engine->killTimer();
+	}
+};
+
 } // namespace
 
 #define COMMAND_LIST(E) \
 	E(Add)              \
 	E(Cursor_Load)      \
 	E(Cursor_Set)       \
+	E(Fade)             \
+	E(Go_Back)          \
+	E(Goto_Level)       \
+	E(Goto_Warp)        \
+	E(Load_Slot)        \
+	E(Play_Movie)       \
 	E(Play_Sound)       \
 	E(Play_AnimBloc)    \
+	E(Retrieve_State)   \
+	E(Set_Lens)         \
+	E(Set_Lensflare)    \
+	E(Set_Jump_Key)     \
+	E(Sprite_Load)      \
+	E(Sprite_Screen)    \
 	E(Stop_All_Sounds)  \
 	E(Stop_Sound)       \
-	E(Sub)
+	E(Stop_Timer)       \
+	E(Store_State)      \
+	E(Sub)              \
+	E(Test_Slot)
 
 #define ADD_COMMAND(NAME)            \
 	if (cmd.equalsIgnoreCase(#NAME)) \
@@ -143,8 +317,7 @@ struct Cursor_Set : public Command {
 
 CommandPtr createV2Command(const Common::String &cmd, const Common::Array<Common::String> &args, int lineno) {
 	COMMAND_LIST(ADD_COMMAND)
-	warning("unhandled command %s at line %d", cmd.c_str(), lineno);
-	return nullptr;
+	error("unhandled command %s at line %d", cmd.c_str(), lineno);
 }
 
 } // namespace PhoenixVR
diff --git a/engines/phoenixvr/phoenixvr.cpp b/engines/phoenixvr/phoenixvr.cpp
index 05958d53eb1..02c81ef760b 100644
--- a/engines/phoenixvr/phoenixvr.cpp
+++ b/engines/phoenixvr/phoenixvr.cpp
@@ -1550,7 +1550,7 @@ void PhoenixVREngine::tick(float dt) {
 		{
 			Common::ScopedPtr<Common::SeekableReadStream> stream(!_warp->testFile.empty() ? open(_warp->testFile) : nullptr);
 			if (stream)
-				_regSet.reset(new RegionSet(*stream));
+				_regSet.reset(new RegionSet(*stream, _vr.isVR()));
 			else
 				debug("no region %s", _warp->testFile.c_str());
 		}
diff --git a/engines/phoenixvr/region_set.cpp b/engines/phoenixvr/region_set.cpp
index e97236a78c9..8b231e785cb 100644
--- a/engines/phoenixvr/region_set.cpp
+++ b/engines/phoenixvr/region_set.cpp
@@ -25,7 +25,7 @@
 #include "phoenixvr/phoenixvr.h"
 
 namespace PhoenixVR {
-RegionSet::RegionSet(Common::SeekableReadStream &s) {
+RegionSet::RegionSet(Common::SeekableReadStream &s, bool vr) {
 	auto version = g_engine->version();
 	if (version == 1) {
 		auto n = s.readUint32LE();
@@ -43,6 +43,12 @@ RegionSet::RegionSet(Common::SeekableReadStream &s) {
 			auto b = s.readFloatLE();
 			auto c = s.readFloatLE();
 			auto d = s.readFloatLE();
+			if (!vr) {
+				a = (a + 0.89f) * 360;
+				b = (b + 0.89f) * 360;
+				c = (2.25f - c) * 360;
+				d = (2.25f - d) * 360;
+			}
 			_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 187f6f9269e..f48097b931c 100644
--- a/engines/phoenixvr/region_set.h
+++ b/engines/phoenixvr/region_set.h
@@ -49,7 +49,7 @@ class RegionSet {
 	Common::Array<Region> _regions;
 
 public:
-	RegionSet(Common::SeekableReadStream &s);
+	RegionSet(Common::SeekableReadStream &s, bool vr);
 	uint size() const { return _regions.size(); }
 	const Common::Array<Region> &getRegions() const { return _regions; }
 	const Region &getRegion(uint idx) const {
diff --git a/engines/phoenixvr/script_v2.cpp b/engines/phoenixvr/script_v2.cpp
index 3d45ef56e54..0ad37a41b1a 100644
--- a/engines/phoenixvr/script_v2.cpp
+++ b/engines/phoenixvr/script_v2.cpp
@@ -244,9 +244,6 @@ void ScriptV2::parseLine(const Common::String &line, uint lineno) {
 																					  : _currentTest->scope.commands;
 		if (command)
 			commands.push_back(command);
-		else {
-			warning("unimplemented command %s at line %d", name.c_str(), lineno);
-		}
 	} else {
 		error("command %s is out of the test block at line %d", line.c_str(), lineno);
 	}




More information about the Scummvm-git-logs mailing list