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

digitall noreply at scummvm.org
Sun May 7 01:20:46 UTC 2023


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

Summary:
c4371efcb1 WATCHMAKER: Further Fixes for GCC Compiler Warnings


Commit: c4371efcb12cb51c50ec890774c470731ce64b83
    https://github.com/scummvm/scummvm/commit/c4371efcb12cb51c50ec890774c470731ce64b83
Author: D G Turner (digitall at scummvm.org)
Date: 2023-05-07T02:20:25+01:00

Commit Message:
WATCHMAKER: Further Fixes for GCC Compiler Warnings

Changed paths:
    engines/watchmaker/classes/do_dialog.cpp
    engines/watchmaker/t3d.h
    engines/watchmaker/walk/act.cpp
    engines/watchmaker/walk/walkutil.cpp


diff --git a/engines/watchmaker/classes/do_dialog.cpp b/engines/watchmaker/classes/do_dialog.cpp
index 9fcea2ae89d..0fefb6c36ae 100644
--- a/engines/watchmaker/classes/do_dialog.cpp
+++ b/engines/watchmaker/classes/do_dialog.cpp
@@ -55,7 +55,6 @@ int32 ic1, ic2;
 void doDialog(WGame &game) {
 	Init &init = game.init;
 	struct SItemCommand *ic;
-	char str[T3D_NAMELEN];
 	uint8 r;
 
 	switch (TheMessage->event) {
@@ -184,8 +183,7 @@ void doDialog(WGame &game) {
 				Character[ic->param1]->Flags &= ~T3D_CHARACTER_HIDE;
 				break;
 			case IC_CHANGE_ROOM:
-				snprintf(str, T3D_NAMELEN, "%s.t3d", init.Room[ic->param1].name);
-				ChangeRoom(game, str, 0, aNULL);
+				ChangeRoom(game, Common::String::format("%s.t3d", init.Room[ic->param1].name), 0, aNULL);
 				break;
 			case IC_EXPRESSION:
 				if (Character[ic->param1])
diff --git a/engines/watchmaker/t3d.h b/engines/watchmaker/t3d.h
index ef72a11acc8..4076dd1df53 100644
--- a/engines/watchmaker/t3d.h
+++ b/engines/watchmaker/t3d.h
@@ -313,6 +313,14 @@ struct t3dSTEPS {
 	t3dF32  Angle = 0.0f;                   // angle
 	int16  curp = 0;                       // cur panel
 	int16  Act = 0, Frame = 0;             // cur action and frame
+
+	void reset() {
+		Pos = t3dV3F();
+		Angle = 0.0f;
+		curp = 0;
+		Act = 0;
+		Frame = 0;
+	}
 };
 
 struct t3dWALK {
diff --git a/engines/watchmaker/walk/act.cpp b/engines/watchmaker/walk/act.cpp
index 5bbabef4236..1b4b513d83f 100644
--- a/engines/watchmaker/walk/act.cpp
+++ b/engines/watchmaker/walk/act.cpp
@@ -740,7 +740,7 @@ uint8 CharNextFrame(WGame &game, int32 oc) {
 			PlayerGotoPos[CurPlayer + ocDARRELL] = 0;
 		}
 		an = Char->Walk.WalkSteps[Char->Walk.NumSteps].Act;
-		memset(&Char->Walk.WalkSteps[0], 0, sizeof(Char->Walk.WalkSteps));
+		Char->Walk.WalkSteps[0].reset();
 		Char->Walk.NumSteps = 0;
 		if (an) StartAnim(game, an);
 		return false;
diff --git a/engines/watchmaker/walk/walkutil.cpp b/engines/watchmaker/walk/walkutil.cpp
index 4161e2784b5..68b15b4b3f6 100644
--- a/engines/watchmaker/walk/walkutil.cpp
+++ b/engines/watchmaker/walk/walkutil.cpp
@@ -187,9 +187,11 @@ t3dF32 SinCosAngle(t3dF32 sinus, t3dF32 cosinus) {
 	cosinus /= t;
 	sinus /= t;
 
-	if ((sinus == cosinus) && (cosinus == 0))
+	if ((sinus == cosinus) && (cosinus == 0)) {
 		return 0;
-	else if (sinus * cosinus >= 0) {
+#if 0
+	// FIXME: Is this duplicate code correct as the 2e4 is identical...
+	} else if (sinus * cosinus >= 0) {
 		// 1e3 quad
 		if (sinus >= 0)
 			// 1 quad
@@ -197,6 +199,7 @@ t3dF32 SinCosAngle(t3dF32 sinus, t3dF32 cosinus) {
 		else
 			// 3 quad
 			return (t3dF32)T3D_PI * 2.0f - (t3dF32)acos(cosinus);
+#endif
 	} else {
 		// 2e4 quad
 		if (sinus >= 0)




More information about the Scummvm-git-logs mailing list