[Scummvm-git-logs] scummvm master -> 18cf4b562af852efd40ca21ad78f1e12a817427d

mduggan noreply at scummvm.org
Sat Feb 25 06:23:08 UTC 2023


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

Summary:
9acbc5f3a4 TETRAEDGE: Don't warn about expected xml tags
51b8769e36 TETRAEDGE: Small workarounds for Syberia 2 lua bugs
1874c35f27 TETRAEDGE: Disable "simple" shadow in Syberia 2
2510ec5d50 TETRAEDGE: Free geometry after capturing fade for Syberia 2
8aac5ef76d TETRAEDGE: Allow alternate orient value in particle parser
c88ca76aa7 TETRAEDGE: Work around random seed problems in Syberia 2
18cf4b562a TETRAEDGE: Enable ratioStretched on Syberia 2 so scenes scroll


Commit: 9acbc5f3a46f1faadf0e1df88e63b3a267717309
    https://github.com/scummvm/scummvm/commit/9acbc5f3a46f1faadf0e1df88e63b3a267717309
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-02-25T15:22:57+09:00

Commit Message:
TETRAEDGE: Don't warn about expected xml tags

Changed paths:
    engines/tetraedge/game/character_settings_xml_parser.cpp


diff --git a/engines/tetraedge/game/character_settings_xml_parser.cpp b/engines/tetraedge/game/character_settings_xml_parser.cpp
index b081263367f..059bd659db6 100644
--- a/engines/tetraedge/game/character_settings_xml_parser.cpp
+++ b/engines/tetraedge/game/character_settings_xml_parser.cpp
@@ -171,9 +171,11 @@ bool CharacterSettingsXmlParser::textCallback(const Common::String &val) {
 
 bool CharacterSettingsXmlParser::handleUnknownKey(ParserNode *node) {
 	if (node->values.contains("animFile")) {
-		const Common::String &animFile = node->values["animFile"];
-		warning("TODO: CharacterSettingsXmlParser handle mapping %s -> %s",
-			node->name.c_str(), animFile.c_str());
+		// The game actually does nothing with these, they seem to be
+		// for debugging purposes only.
+		//const Common::String &animFile = node->values["animFile"];
+		//debug("TODO: CharacterSettingsXmlParser handle mapping %s -> %s",
+		//	node->name.c_str(), animFile.c_str());
 		return true;
 	}
 	parserError("Unknown key");


Commit: 51b8769e36474c968a6ed09c100ff9c8ebd42908
    https://github.com/scummvm/scummvm/commit/51b8769e36474c968a6ed09c100ff9c8ebd42908
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-02-25T15:22:57+09:00

Commit Message:
TETRAEDGE: Small workarounds for Syberia 2 lua bugs

Changed paths:
    engines/tetraedge/game/lua_binds.cpp


diff --git a/engines/tetraedge/game/lua_binds.cpp b/engines/tetraedge/game/lua_binds.cpp
index 93a9380e0bd..b0f0dc3bf51 100644
--- a/engines/tetraedge/game/lua_binds.cpp
+++ b/engines/tetraedge/game/lua_binds.cpp
@@ -1739,7 +1739,9 @@ static void SetRecallageY(const Common::String &charName, bool val) {
 	if (character) {
 		character->setRecallageY(val);
 	} else {
-		error("[SetRecallageY] Character not found %s", charName.c_str());
+		// Not an error - some scenes in Syberia 2 look for a Kate that isn't
+		// loaded yet.
+		warning("[SetRecallageY] Character not found %s", charName.c_str());
 	}
 }
 
@@ -2328,7 +2330,7 @@ static int tolua_ExportedFunctions_SetCharacterPlayerPosition00(lua_State *L) {
 	error("#ferror in function 'SetCharacterPlayerPosition': %d %d %s", err.index, err.array, err.type);
 }
 
-static void SetCharacterPlayerAnimation(const Common::String &animname, bool repeat, bool returnToIdle, int startframe, int endframe) {
+static void SetCharacterPlayerAnimation(Common::String animname, bool repeat, bool returnToIdle, int startframe, int endframe) {
 	Game *game = g_engine->getGame();
 	Character *c = game->scene()._character;
 	if (!c) {
@@ -2336,6 +2338,12 @@ static void SetCharacterPlayerAnimation(const Common::String &animname, bool rep
 		return;
 	}
 
+	//
+	// WORKAROUND: Typo in Syberia 2 A1_RomHaut/11110/Logic11110.lua
+	//
+	if (animname == "Kate/ka_esc_h2d.te3d")
+		animname = "Kate/ka_esc_h2d.te3da";
+
 	bool result = c->setAnimation(animname, repeat, returnToIdle, false, startframe, endframe);
 	if (!result) {
 		warning("[SetCharacterPlayerAnimation] Character's animation \"%s\" doesn't exist",


Commit: 1874c35f27b4893f264fdcbedd335a232da31814
    https://github.com/scummvm/scummvm/commit/1874c35f27b4893f264fdcbedd335a232da31814
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-02-25T15:22:57+09:00

Commit Message:
TETRAEDGE: Disable "simple" shadow in Syberia 2

The feature of 2 fuzzy circles at the character's feet was not present in
Syberia 2 code - just the full character shadow.

Changed paths:
    engines/tetraedge/game/character.cpp
    engines/tetraedge/game/game.cpp
    engines/tetraedge/game/in_game_scene.cpp


diff --git a/engines/tetraedge/game/character.cpp b/engines/tetraedge/game/character.cpp
index a1e8c4ba978..ee5282b0571 100644
--- a/engines/tetraedge/game/character.cpp
+++ b/engines/tetraedge/game/character.cpp
@@ -412,21 +412,24 @@ bool Character::loadModel(const Common::String &mname, bool unused) {
 	_walkEndGAnimLen = animLengthFromFile(walkAnim(WalkPart_EndG), &_walkEndGAnimFrameCount);
 	_walkLoopAnimLen = animLengthFromFile(walkAnim(WalkPart_Loop), &_walkLoopAnimFrameCount);
 
-	TeIntrusivePtr<Te3DTexture> shadow = Te3DTexture::makeInstance();
-	TeCore *core = g_engine->getCore();
-	shadow->load(core->findFile("models/Textures/simple_shadow_alpha.tga"));
-
-	for (int i = 0; i < 2; i++) {
-		TeModel *pmodel = new TeModel();
-		_shadowModel[i] = pmodel;
-		pmodel->setName("Shadow");
-		Common::Array<TeVector3f32> arr;
-		arr.resize(4);
-		arr[0] = TeVector3f32(-60.0, 0.0, -60.0);
-		arr[1] = TeVector3f32(-60.0, 0.0, 60.0);
-		arr[2] = TeVector3f32(60.0, 0.0, -60.0);
-		arr[3] = TeVector3f32(60.0, 0.0, 60.0);
-		pmodel->setQuad(shadow, arr, TeColor(0xff, 0xff, 0xff, 0x50));
+	if (g_engine->gameType() == TetraedgeEngine::kSyberia) {
+		// Only Syberia 1 has the simple shadow.
+		TeIntrusivePtr<Te3DTexture> shadow = Te3DTexture::makeInstance();
+		TeCore *core = g_engine->getCore();
+		shadow->load(core->findFile("models/Textures/simple_shadow_alpha.tga"));
+
+		for (int i = 0; i < 2; i++) {
+			TeModel *pmodel = new TeModel();
+			_shadowModel[i] = pmodel;
+			pmodel->setName("Shadow");
+			Common::Array<TeVector3f32> arr;
+			arr.resize(4);
+			arr[0] = TeVector3f32(-60.0, 0.0, -60.0);
+			arr[1] = TeVector3f32(-60.0, 0.0, 60.0);
+			arr[2] = TeVector3f32(60.0, 0.0, -60.0);
+			arr[3] = TeVector3f32(60.0, 0.0, 60.0);
+			pmodel->setQuad(shadow, arr, TeColor(0xff, 0xff, 0xff, 0x50));
+		}
 	}
 	return true;
 }
@@ -551,9 +554,11 @@ bool Character::onBonesUpdate(const Common::String &boneName, TeMatrix4x4 &boneM
 			pos = _freeMoveZone->correctCharacterPosition(pos, &flag, true);
 		}
 		int shadowNo = boneName.contains("Bip01 L Foot") ? 0 : 1;
-		_shadowModel[shadowNo]->setPosition(pos);
-		_shadowModel[shadowNo]->setRotation(_model->rotation());
-		_shadowModel[shadowNo]->setScale(_model->scale());
+		if (_shadowModel[shadowNo]) {
+			_shadowModel[shadowNo]->setPosition(pos);
+			_shadowModel[shadowNo]->setRotation(_model->rotation());
+			_shadowModel[shadowNo]->setScale(_model->scale());
+		}
 	}
 
 	// Move any objects attached to the bone
@@ -794,8 +799,10 @@ void Character::setStepSound(const Common::String &stepSound1, const Common::Str
 }
 
 bool Character::setShadowVisible(bool visible) {
-	_shadowModel[0]->setVisible(visible);
-	_shadowModel[1]->setVisible(visible);
+	if (_shadowModel[0]) {
+		_shadowModel[0]->setVisible(visible);
+		_shadowModel[1]->setVisible(visible);
+	}
 	return false;
 }
 
diff --git a/engines/tetraedge/game/game.cpp b/engines/tetraedge/game/game.cpp
index 21182ba9bc2..02327c50571 100644
--- a/engines/tetraedge/game/game.cpp
+++ b/engines/tetraedge/game/game.cpp
@@ -486,8 +486,10 @@ bool Game::initWarp(const Common::String &zone, const Common::String &scene, boo
 		_scene._character->setAnimation(_scene._character->characterSettings()._idleAnimFileName, true);
 		if (!_scene.findKate()) {
 			_scene.models().push_back(_scene._character->_model);
-			_scene.models().push_back(_scene._character->_shadowModel[0]);
-			_scene.models().push_back(_scene._character->_shadowModel[1]);
+			if (_scene._character->_shadowModel[0]) {
+				_scene.models().push_back(_scene._character->_shadowModel[0]);
+				_scene.models().push_back(_scene._character->_shadowModel[1]);
+			}
 		}
 	}
 
diff --git a/engines/tetraedge/game/in_game_scene.cpp b/engines/tetraedge/game/in_game_scene.cpp
index 3d951e3fe90..36e2c6727a8 100644
--- a/engines/tetraedge/game/in_game_scene.cpp
+++ b/engines/tetraedge/game/in_game_scene.cpp
@@ -225,8 +225,10 @@ void InGameScene::close() {
 	freeGeometry();
 	if (_character && _character->_model && !findKate()) {
 		models().push_back(_character->_model);
-		models().push_back(_character->_shadowModel[0]);
-		models().push_back(_character->_shadowModel[1]);
+		if (_character->_shadowModel[0]) {
+			models().push_back(_character->_shadowModel[0]);
+			models().push_back(_character->_shadowModel[1]);
+		}
 	}
 	_objects.clear();
 	for (TeFreeMoveZone *zone : _freeMoveZones)
@@ -866,8 +868,10 @@ bool InGameScene::loadCharacter(const Common::String &name) {
 			return false;
 		}
 		models().push_back(c->_model);
-		models().push_back(c->_shadowModel[0]);
-		models().push_back(c->_shadowModel[1]);
+		if (_character->_shadowModel[0]) {
+			models().push_back(c->_shadowModel[0]);
+			models().push_back(c->_shadowModel[1]);
+		}
 		_characters.push_back(c);
 	}
 	c->_model->setVisible(true);
@@ -981,8 +985,10 @@ bool InGameScene::loadPlayerCharacter(const Common::String &name) {
 
 		if (!findKate()) {
 			models().push_back(_character->_model);
-			models().push_back(_character->_shadowModel[0]);
-			models().push_back(_character->_shadowModel[1]);
+			if (_character->_shadowModel[0]) {
+				models().push_back(_character->_shadowModel[0]);
+				models().push_back(_character->_shadowModel[1]);
+			}
 		}
 	}
 


Commit: 2510ec5d50f416e131fa0ef73fe6d6cea32108f9
    https://github.com/scummvm/scummvm/commit/2510ec5d50f416e131fa0ef73fe6d6cea32108f9
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-02-25T15:22:57+09:00

Commit Message:
TETRAEDGE: Free geometry after capturing fade for Syberia 2

Changed paths:
    engines/tetraedge/game/game.cpp


diff --git a/engines/tetraedge/game/game.cpp b/engines/tetraedge/game/game.cpp
index 02327c50571..7798037169f 100644
--- a/engines/tetraedge/game/game.cpp
+++ b/engines/tetraedge/game/game.cpp
@@ -213,14 +213,16 @@ void Game::addToScore(int score) {
 
 bool Game::changeWarp(const Common::String &zone, const Common::String &scene, bool fadeFlag) {
 	//debug("Game::changeWarp(%s, %s, %s)", zone.c_str(), scene.c_str(), fadeFlag ? "true" : "false");
-	if (g_engine->gameType() == TetraedgeEngine::kSyberia2)
-		_scene.freeGeometry();
 	Application *app = g_engine->getApplication();
-	if (fadeFlag) {
+	if (fadeFlag && g_engine->gameType() == TetraedgeEngine::kSyberia) {
 		app->blackFade();
 	} else {
 		app->captureFade();
 	}
+	// Slight divergence from original.. free after capturing fade so characters don't disappear.
+	if (g_engine->gameType() == TetraedgeEngine::kSyberia2)
+		_scene.freeGeometry();
+
 	_warpZone = zone;
 	_warpScene = scene;
 	_warpFadeFlag = fadeFlag;


Commit: 8aac5ef76d0b0961339281e6790b044a6786b92e
    https://github.com/scummvm/scummvm/commit/8aac5ef76d0b0961339281e6790b044a6786b92e
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-02-25T15:22:57+09:00

Commit Message:
TETRAEDGE: Allow alternate orient value in particle parser

Changed paths:
    engines/tetraedge/game/particle_xml_parser.cpp
    engines/tetraedge/game/particle_xml_parser.h


diff --git a/engines/tetraedge/game/particle_xml_parser.cpp b/engines/tetraedge/game/particle_xml_parser.cpp
index 36854f6bacc..7d3bccf8483 100644
--- a/engines/tetraedge/game/particle_xml_parser.cpp
+++ b/engines/tetraedge/game/particle_xml_parser.cpp
@@ -117,7 +117,16 @@ bool ParticleXmlParser::parserCallback_randomdirection(ParserNode *node) {
 }
 
 bool ParticleXmlParser::parserCallback_orientation(ParserNode *node) {
-	_scene->particles().back()->setOrientation(parsePoint(node));
+	TeVector3f32 orient;
+	if (node->values.contains("x")) {
+		orient = parsePoint(node);
+	} else if (node->values.contains("value")) {
+		orient.y() = parseDouble(node);
+	} else {
+		return false;
+	}
+
+	_scene->particles().back()->setOrientation(orient);
 	return true;
 }
 
diff --git a/engines/tetraedge/game/particle_xml_parser.h b/engines/tetraedge/game/particle_xml_parser.h
index a9722945c04..cc438f52340 100644
--- a/engines/tetraedge/game/particle_xml_parser.h
+++ b/engines/tetraedge/game/particle_xml_parser.h
@@ -92,9 +92,11 @@ public:
 				XML_PROP(value, true)
 			KEY_END()
 			XML_KEY(orientation)
-				XML_PROP(x, true)
-				XML_PROP(y, true)
-				XML_PROP(z, true)
+				// Can either be x/y/z or "value" (which is y)
+				XML_PROP(x, false)
+				XML_PROP(y, false)
+				XML_PROP(z, false)
+				XML_PROP(value, false)
 			KEY_END()
 		KEY_END()
 	} PARSER_END()


Commit: c88ca76aa72056712697a2a1f68132aaf5ec4444
    https://github.com/scummvm/scummvm/commit/c88ca76aa72056712697a2a1f68132aaf5ec4444
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-02-25T15:22:57+09:00

Commit Message:
TETRAEDGE: Work around random seed problems in Syberia 2

Changed paths:
    engines/tetraedge/te/te_lua_thread.cpp


diff --git a/engines/tetraedge/te/te_lua_thread.cpp b/engines/tetraedge/te/te_lua_thread.cpp
index 417a5ad8ff0..f3cb6b2fb00 100644
--- a/engines/tetraedge/te/te_lua_thread.cpp
+++ b/engines/tetraedge/te/te_lua_thread.cpp
@@ -147,11 +147,30 @@ void TeLuaThread::executeFile(const Common::FSNode &node) {
 	scriptFile.read(buf, fileLen);
 	buf[fileLen] = 0;
 	scriptFile.close();
-	// WORKAROUND: Some script files have rogue ";" lines in them with nothing else, clean those up.
+
+	//
+	// WORKAROUND: Some script files have rogue ";" lines in them with nothing
+	// else, and ScummVM common lua version doesn't like them. Clean those up.
+	//
 	char *fixline = strstr(buf, "\n\t;");
 	if (fixline)
 		fixline[2] = '\t';
 
+	//
+	// WORKAROUND: Syberia 2 constantly re-seeds the random number generator.
+	// This fails on ScummVM Lua because os.time() returns a large Number and
+	// math.randomseed() clamps the number to an int, so it always seeds on the
+	// same value.  It's also kind of pointless, so just patch it out.
+	//
+	static const char RESEED_PATTERN[] = "math.randomseed( os.time() )";
+	fixline = strstr(buf, RESEED_PATTERN);
+	while (fixline != nullptr) {
+		for (int i = 0; i < ARRAYSIZE(RESEED_PATTERN); i++) {
+			fixline[i] = ' ';
+		}
+		fixline = strstr(fixline, RESEED_PATTERN);
+	}
+
 	_lastResumeResult = luaL_loadbuffer(_luaThread, buf, fileLen, node.getPath().c_str());
 	if (_lastResumeResult) {
 		const char *msg = lua_tostring(_luaThread, -1);


Commit: 18cf4b562af852efd40ca21ad78f1e12a817427d
    https://github.com/scummvm/scummvm/commit/18cf4b562af852efd40ca21ad78f1e12a817427d
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-02-25T15:22:57+09:00

Commit Message:
TETRAEDGE: Enable ratioStretched on Syberia 2 so scenes scroll

Changed paths:
    engines/tetraedge/game/application.cpp


diff --git a/engines/tetraedge/game/application.cpp b/engines/tetraedge/game/application.cpp
index cbf95fada41..575a6bf9a72 100644
--- a/engines/tetraedge/game/application.cpp
+++ b/engines/tetraedge/game/application.cpp
@@ -48,7 +48,14 @@ bool Application::_dontUpdateWhenApplicationPaused = false;
 
 Application::Application() : _finishedGame(false), _finishedFremium(false),
 _captureFade(false), _difficulty(1), _created(false), _tutoActivated(false),
-_drawShadows(true), _ratioStretched(false) {
+_drawShadows(true) {
+	//
+	// TODO: Game defaults _ratioStretched to false, but then
+	// the horizontally scrolling scenes don't scroll properly.
+	// For now just default to true.
+	//
+	_ratioStretched = g_engine->gameType() == TetraedgeEngine::kSyberia2;
+
 	TeCore *core = g_engine->getCore();
 	core->_coreNotReady = true;
 	core->fileFlagSystemSetFlag("platform", "MacOSX");




More information about the Scummvm-git-logs mailing list