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

digitall noreply at scummvm.org
Sat May 27 22:25:54 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:
c32aa4e4c6 WATCHMAKER: Fix Redundant Null Pointer Test GCC Compiler Warnings


Commit: c32aa4e4c60f350d8005eda489dfddc3c960c6da
    https://github.com/scummvm/scummvm/commit/c32aa4e4c60f350d8005eda489dfddc3c960c6da
Author: D G Turner (digitall at scummvm.org)
Date: 2023-05-27T23:24:28+01:00

Commit Message:
WATCHMAKER: Fix Redundant Null Pointer Test GCC Compiler Warnings

Changed paths:
    engines/watchmaker/classes/do_camera.cpp
    engines/watchmaker/classes/do_player.cpp
    engines/watchmaker/ll/ll_string.cpp
    engines/watchmaker/walk/act.cpp


diff --git a/engines/watchmaker/classes/do_camera.cpp b/engines/watchmaker/classes/do_camera.cpp
index 8d1e9fa8455..ccecdd1c9be 100644
--- a/engines/watchmaker/classes/do_camera.cpp
+++ b/engines/watchmaker/classes/do_camera.cpp
@@ -645,8 +645,7 @@ void ProcessCamera(WGame &game) {
 			Player->Walk.OldPanel = -1;
 			for (a = 0; a < Player->Walk.NumSteps; a++)
 				Player->Walk.WalkSteps[a].curp = -1;
-			if (&t3dCurRoom->PanelHeight[t3dCurRoom->CurLevel])
-				CurFloorY = t3dCurRoom->PanelHeight[t3dCurRoom->CurLevel];
+			CurFloorY = t3dCurRoom->PanelHeight[t3dCurRoom->CurLevel];
 		}
 
 
diff --git a/engines/watchmaker/classes/do_player.cpp b/engines/watchmaker/classes/do_player.cpp
index cbe4c9d90c4..0d829e6001c 100644
--- a/engines/watchmaker/classes/do_player.cpp
+++ b/engines/watchmaker/classes/do_player.cpp
@@ -434,8 +434,7 @@ void ChangePlayer(WGame &game, uint8 oc) {
 	if (Player && t3dCurRoom) {
 		Player->Walk.Panel = t3dCurRoom->Panel[t3dCurRoom->CurLevel];
 		Player->Walk.PanelNum = t3dCurRoom->NumPanels[t3dCurRoom->CurLevel];
-		if (&t3dCurRoom->PanelHeight[t3dCurRoom->CurLevel])
-			Player->Mesh->Trasl.y = Player->Pos.y = CurFloorY = t3dCurRoom->PanelHeight[t3dCurRoom->CurLevel];
+		Player->Mesh->Trasl.y = Player->Pos.y = CurFloorY = t3dCurRoom->PanelHeight[t3dCurRoom->CurLevel];
 	}
 
 //	Inizia il Fade
diff --git a/engines/watchmaker/ll/ll_string.cpp b/engines/watchmaker/ll/ll_string.cpp
index ff792f85e07..43a45b79995 100644
--- a/engines/watchmaker/ll/ll_string.cpp
+++ b/engines/watchmaker/ll/ll_string.cpp
@@ -168,66 +168,64 @@ void PaintText(WGame &game) {
 
 	if (bTitoliCodaStatic || bTitoliCodaScrolling)  return;
 
-	if (TheString.text) {
-		if (bDialogActive) {
-			obj = init.Anim[TimeAnim].obj;
-			if (obj == ocCURPLAYER)
-				Player->Mesh->ExpressionFrame = VisemaTimeRecon(TheTime - LastTextTime);
-			else if ((obj >= ocDARRELL) && (obj <= ocLASTCHAR) && (obj) && (Character[obj]->Mesh))
-				Character[obj]->Mesh->ExpressionFrame = VisemaTimeRecon(TheTime - LastTextTime);
-		}
+	if (bDialogActive) {
+		obj = init.Anim[TimeAnim].obj;
+		if (obj == ocCURPLAYER)
+			Player->Mesh->ExpressionFrame = VisemaTimeRecon(TheTime - LastTextTime);
+		else if ((obj >= ocDARRELL) && (obj <= ocLASTCHAR) && (obj) && (Character[obj]->Mesh))
+			Character[obj]->Mesh->ExpressionFrame = VisemaTimeRecon(TheTime - LastTextTime);
+	}
 
-		lines = (uint16)CheckText(game._fonts, (uint16)game._renderer->rFitY((int32)TheString.dx), TheString.text);
-		for (i = 0; i < lines; i++) {
-			dx = (TheString.dx - (TextLen(game._fonts, TextLines[i], 0) * SCREEN_RES_X) / game._renderer->rFitX(SCREEN_RES_X)) / 2;
-			obj = init.Anim[TimeAnim].obj;
-			color = WHITE_FONT;
-			if ((obj >= ocCUOCO) && (obj <= ocCURPLAYER)) {
-				switch (obj) {
-				case ocNOTAIO:
-				case ocSUPERVISORE:
-				case ocCUOCO:
-					color = RED_FONT;
-					break;
-				case ocVALENCIA:
-				case ocCHIRURGO:
-				case ocGIARDINIERE:
-					color = GREEN_FONT;
-					break;
-				case ocKRENN:
-				case ocOROLOGIAIO:
-				case ocVICTORIA:
-					color = CYAN_FONT;
-					break;
-				case ocMOORE:
-				case ocMOOREBUCATO:
-				case ocDUKES:
-				case ocTRADUTTORE:
-				case ocCUSTODE:
-					color = MAGENTA_FONT;
-					break;
-				case ocCORONA:
-				case ocMOGLIESUPERVISORE:
-				case ocMOGLIE_KIMONO:
-				case ocSERVETTA:
-					color = YELLOW_FONT;
-					break;
-				case ocVECCHIO:
-				case ocCACCIATORE:
-				case ocCACCIATOREMALPRESO:
-				case ocDOMESTICA:
-					color = GRAY_FONT;
-					break;
-				case ocDARRELL:
-				case ocDARRELLALETTO:
-				case ocCURPLAYER:
-				default:
-					color = WHITE_FONT;
-					break;
-				}
+	lines = (uint16)CheckText(game._fonts, (uint16)game._renderer->rFitY((int32)TheString.dx), TheString.text);
+	for (i = 0; i < lines; i++) {
+		dx = (TheString.dx - (TextLen(game._fonts, TextLines[i], 0) * SCREEN_RES_X) / game._renderer->rFitX(SCREEN_RES_X)) / 2;
+		obj = init.Anim[TimeAnim].obj;
+		color = WHITE_FONT;
+		if ((obj >= ocCUOCO) && (obj <= ocCURPLAYER)) {
+			switch (obj) {
+			case ocNOTAIO:
+			case ocSUPERVISORE:
+			case ocCUOCO:
+				color = RED_FONT;
+				break;
+			case ocVALENCIA:
+			case ocCHIRURGO:
+			case ocGIARDINIERE:
+				color = GREEN_FONT;
+				break;
+			case ocKRENN:
+			case ocOROLOGIAIO:
+			case ocVICTORIA:
+				color = CYAN_FONT;
+				break;
+			case ocMOORE:
+			case ocMOOREBUCATO:
+			case ocDUKES:
+			case ocTRADUTTORE:
+			case ocCUSTODE:
+				color = MAGENTA_FONT;
+				break;
+			case ocCORONA:
+			case ocMOGLIESUPERVISORE:
+			case ocMOGLIE_KIMONO:
+			case ocSERVETTA:
+				color = YELLOW_FONT;
+				break;
+			case ocVECCHIO:
+			case ocCACCIATORE:
+			case ocCACCIATOREMALPRESO:
+			case ocDOMESTICA:
+				color = GRAY_FONT;
+				break;
+			case ocDARRELL:
+			case ocDARRELLALETTO:
+			case ocCURPLAYER:
+			default:
+				color = WHITE_FONT;
+				break;
 			}
-			game._renderer->_2dStuff.displayDDText(TextLines[i], FontKind::Standard, color, TheString.x + dx, TheString.y + i * 12, 0, 0, 0, 0);
 		}
+		game._renderer->_2dStuff.displayDDText(TextLines[i], FontKind::Standard, color, TheString.x + dx, TheString.y + i * 12, 0, 0, 0, 0);
 	}
 }
 
diff --git a/engines/watchmaker/walk/act.cpp b/engines/watchmaker/walk/act.cpp
index 81262843edc..11e2c4d8fe2 100644
--- a/engines/watchmaker/walk/act.cpp
+++ b/engines/watchmaker/walk/act.cpp
@@ -266,8 +266,9 @@ void CheckCharacterWithoutBounds(WGame &game, int32 oc, const uint8 *dpl, uint8
 
 	Char->Walk.Panel = t3dCurRoom->Panel[t3dCurRoom->CurLevel];
 	Char->Walk.PanelNum = t3dCurRoom->NumPanels[t3dCurRoom->CurLevel];
-	if ((t3dCurRoom) && (&t3dCurRoom->PanelHeight[t3dCurRoom->CurLevel]))
+	if (t3dCurRoom) {
 		CurFloorY = t3dCurRoom->PanelHeight[t3dCurRoom->CurLevel];
+	}
 
 	Char->Mesh->Flags |= T3D_MESH_DEFAULTANIM;
 	t3dVectCopy(&Char->Pos, &Char->Mesh->Trasl);
@@ -309,8 +310,9 @@ void FixPos(int32 oc) {
 	t3dCHARACTER *Ch = Character[oc];
 	t3dMESH *mesh = Ch->Mesh;
 
-	if ((t3dCurRoom) && (&t3dCurRoom->PanelHeight[t3dCurRoom->CurLevel]))
+	if (t3dCurRoom) {
 		CurFloorY = t3dCurRoom->PanelHeight[t3dCurRoom->CurLevel];
+	}
 	mesh->Trasl.y = CurFloorY;
 	t3dVectCopy(&Ch->Pos, &mesh->Trasl);
 	t3dVectInit(&Ch->Dir, 0.0f, 0.0f, -1.0f);
@@ -599,8 +601,9 @@ bool CheckCharacterWithBounds(WGame &game, int32 oc, t3dV3F *Pos, uint8 dp, uint
 
 	Char->Walk.Panel = t3dCurRoom->Panel[t3dCurRoom->CurLevel];
 	Char->Walk.PanelNum = t3dCurRoom->NumPanels[t3dCurRoom->CurLevel];
-	if ((t3dCurRoom) && (&t3dCurRoom->PanelHeight[t3dCurRoom->CurLevel]))
+	if (t3dCurRoom) {
 		CurFloorY = t3dCurRoom->PanelHeight[t3dCurRoom->CurLevel];
+	}
 
 	for (i = 0; i < T3D_MAX_CHARACTERS; i++) {
 //		Se il personaggio non e' nascosto e ha pannelli, li aggiunge




More information about the Scummvm-git-logs mailing list