[Scummvm-git-logs] scummvm master -> 37ad7bf53df401f31de501b663c9c0982733beac

bluegr noreply at scummvm.org
Wed Sep 9 13:21:41 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:
37ad7bf53d TETRAEDGE: Do not string format an awry float for debug print


Commit: 37ad7bf53df401f31de501b663c9c0982733beac
    https://github.com/scummvm/scummvm/commit/37ad7bf53df401f31de501b663c9c0982733beac
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2026-09-09T16:21:36+03:00

Commit Message:
TETRAEDGE: Do not string format an awry float for debug print

Fixes #15077

Trying to debug print an awry, really big float value for light exponent caused freeze on Android for Syberia.
Instead we print the string value as it was before being parsed to double.
The bug occured in SceneLightsXmlParser::parserCallback_Exponent(), but this commit
also changes SceneLightsXmlParser::parserCallback_Cutoff() and SceneLightsXmlParser::parserCallback_Attenuation() accordingly
for consistency.

Changed paths:
    engines/tetraedge/game/scene_lights_xml_parser.cpp
    engines/tetraedge/te/te_light.cpp


diff --git a/engines/tetraedge/game/scene_lights_xml_parser.cpp b/engines/tetraedge/game/scene_lights_xml_parser.cpp
index 9702631f0a8..58a83df8caf 100644
--- a/engines/tetraedge/game/scene_lights_xml_parser.cpp
+++ b/engines/tetraedge/game/scene_lights_xml_parser.cpp
@@ -95,7 +95,8 @@ bool SceneLightsXmlParser::parserCallback_Attenuation(ParserNode *node) {
 	float l = parseDouble(node, "linear");
 	float q = parseDouble(node, "quadratic");
 	if (c < 0 || l < 0 || q < 0)
-		warning("Loaded invalid lighting attenuation vals %f %f %f", c, l, q);
+		warning("Loaded invalid lighting attenuation vals %s %s %s", node->values["constant"].c_str(), node->values["linear"].c_str(), node->values["quadratic"].c_str());
+
 	_lights->back()->setConstAtten(c);
 	_lights->back()->setLinearAtten(l);
 	_lights->back()->setQuadraticAtten(q);
@@ -105,7 +106,7 @@ bool SceneLightsXmlParser::parserCallback_Attenuation(ParserNode *node) {
 bool SceneLightsXmlParser::parserCallback_Cutoff(ParserNode *node) {
 	float cutoff = parseDouble(node);
 	if (cutoff < 0.0f || (cutoff > 90.0f && cutoff != 180.0f))
-		warning("Loaded invalid lighting cutoff value %f", cutoff);
+		warning("Loaded invalid lighting cutoff value %s", node->values["value"].c_str());
 	_lights->back()->setCutoff((cutoff * M_PI) / 180.0);
 	return true;
 }
@@ -114,8 +115,8 @@ bool SceneLightsXmlParser::parserCallback_Exponent(ParserNode *node) {
 	float expon = parseDouble(node);
 	if (expon < 0.0f || expon > 128.0f) {
 		// Print debug but don't bother warning - the value is not used anyway.
-		debug("Loaded invalid lighting exponent value %f, default to 1.0", expon);
-		expon = 1.0;
+		debug("Loaded invalid lighting exponent value %s, default to 1.0", node->values["value"].c_str());
+		expon = 1.0f;
 	}
 	_lights->back()->setExponent(expon);
 	return true;
diff --git a/engines/tetraedge/te/te_light.cpp b/engines/tetraedge/te/te_light.cpp
index 5f0dac5c3ff..c41ab0ec8f6 100644
--- a/engines/tetraedge/te/te_light.cpp
+++ b/engines/tetraedge/te/te_light.cpp
@@ -90,7 +90,7 @@ Common::String TeLight::dump() const {
 
 void TeLight::correctAttenuation() {
 	if (!_constAtten && !_linearAtten && !_quadraticAtten)
-		_constAtten = 1.0;
+		_constAtten = 1.0f;
 }
 
 /*static*/




More information about the Scummvm-git-logs mailing list