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

mduggan noreply at scummvm.org
Sat Mar 11 12:13:14 UTC 2023


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

Summary:
00ee44e4e7 TETRAEDGE: Remove redundant null check
8aa9b7de1f TETRAEDGE: Avoid potential crash on double-leaving cellphone
dc8008af99 TETRAEDGE: Fix potential leak and redundant check.  PVS-Studio V654, V773
cdff3655a1 TETRAEDGE: Use real value for haveSave. PVS-Studio V547
d1e4f1c18d TETRAEDGE: Correct type for bools. PVS-Studio V601
cd33aadb89 TETRAEDGE: Ensure teFormat is initialized.  PVS-Studio V730
2b6ddb5396 TETRAEDGE: Fix null check on output flag. PVS-Studio V595
a7e5f38c87 TETRAEDGE: Correct variant return types. PVS-Studio V601
a1f6784f35 TETRAEDGE: Remove redundant value check. PVS-Studio V560


Commit: 00ee44e4e74120fcd693dfa2a303f60db1139795
    https://github.com/scummvm/scummvm/commit/00ee44e4e74120fcd693dfa2a303f60db1139795
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-11T20:55:52+09:00

Commit Message:
TETRAEDGE: Remove redundant null check

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


diff --git a/engines/tetraedge/game/game.cpp b/engines/tetraedge/game/game.cpp
index 110d7884bd1..7081b99c19c 100644
--- a/engines/tetraedge/game/game.cpp
+++ b/engines/tetraedge/game/game.cpp
@@ -909,8 +909,8 @@ bool Game::onCharacterAnimationFinished(const Common::String &charName) {
 		Character *character = scene().character(charName);
 		if (character) {
 			const Common::String curAnimName = character->curAnimName();
-			if (character && (curAnimName == character->walkAnim(Character::WalkPart_EndD)
-				|| curAnimName == character->walkAnim(Character::WalkPart_EndG))) {
+			if (curAnimName == character->walkAnim(Character::WalkPart_EndD)
+				|| curAnimName == character->walkAnim(Character::WalkPart_EndG)) {
 				character->updatePosition(1.0);
 				character->endMove();
 			}


Commit: 8aa9b7de1f6716b952cabdbcbfa68bda1086c46c
    https://github.com/scummvm/scummvm/commit/8aa9b7de1f6716b952cabdbcbfa68bda1086c46c
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-11T20:56:34+09:00

Commit Message:
TETRAEDGE: Avoid potential crash on double-leaving cellphone

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


diff --git a/engines/tetraedge/game/cellphone.cpp b/engines/tetraedge/game/cellphone.cpp
index 076b9d9fc60..b6c8d45e0ea 100644
--- a/engines/tetraedge/game/cellphone.cpp
+++ b/engines/tetraedge/game/cellphone.cpp
@@ -78,6 +78,9 @@ void Cellphone::enter() {
 }
 
 void Cellphone::leave() {
+	if (!_gui.loaded())
+		return;
+
 	_gui.buttonLayoutChecked("background")->setVisible(false);
 	for (TeTextLayout *text : _textLayoutArray) {
 		text->deleteLater();


Commit: dc8008af997252eb542d5c3d7d361cdab6f7ac14
    https://github.com/scummvm/scummvm/commit/dc8008af997252eb542d5c3d7d361cdab6f7ac14
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-11T20:57:30+09:00

Commit Message:
TETRAEDGE: Fix potential leak and redundant check.  PVS-Studio V654, V773

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


diff --git a/engines/tetraedge/game/inventory.cpp b/engines/tetraedge/game/inventory.cpp
index 0cd05e9633c..fec7800fe42 100644
--- a/engines/tetraedge/game/inventory.cpp
+++ b/engines/tetraedge/game/inventory.cpp
@@ -37,6 +37,12 @@ namespace Tetraedge {
 Inventory::Inventory() : _cellphone(nullptr), _selectedObject(nullptr) {
 }
 
+Inventory::~Inventory() {
+	if (_cellphone)
+		_cellphone->unload();
+	delete _cellphone;
+}
+
 void Inventory::enter() {
 	setVisible(true);
 	Game *game = g_engine->getGame();
@@ -406,8 +412,7 @@ InventoryObject *Inventory::selectedInventoryObject() {
 
 void Inventory::selectedObject(const Common::String &objname) {
 	int pageNo = 0;
-	bool finished = false;
-	while (!finished) {
+	while (true) {
 		TeLayout *page = _gui.layout(Common::String::format("page%d", pageNo));
 		if (!page)
 			break;
diff --git a/engines/tetraedge/game/inventory.h b/engines/tetraedge/game/inventory.h
index c004e59d361..62e98a1b02e 100644
--- a/engines/tetraedge/game/inventory.h
+++ b/engines/tetraedge/game/inventory.h
@@ -40,7 +40,7 @@ public:
 	};
 
 	Inventory();
-	virtual ~Inventory() {}
+	virtual ~Inventory();
 
 	void enter();
 	void leave();


Commit: cdff3655a1fbd2094503d072cd819f7569f4a050
    https://github.com/scummvm/scummvm/commit/cdff3655a1fbd2094503d072cd819f7569f4a050
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-11T21:03:54+09:00

Commit Message:
TETRAEDGE: Use real value for haveSave. PVS-Studio V547

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


diff --git a/engines/tetraedge/game/main_menu.cpp b/engines/tetraedge/game/main_menu.cpp
index 572b0afc9a6..87ec3fb14d0 100644
--- a/engines/tetraedge/game/main_menu.cpp
+++ b/engines/tetraedge/game/main_menu.cpp
@@ -308,8 +308,7 @@ bool MainMenu::onUnlockGameButtonValidated() {
 }
 
 void MainMenu::refresh() {
-	// TODO: get a real value
-	bool haveSave = false;
+	bool haveSave = ConfMan.hasKey(LAST_SAVE_CONF);
 	TeButtonLayout *continueGameButton = buttonLayout("continueGameButton");
 	if (continueGameButton) {
 		continueGameButton->setEnable(haveSave);
@@ -317,7 +316,7 @@ void MainMenu::refresh() {
 }
 
 void MainMenu::setCenterButtonsVisibility(bool visible) {
-	bool haveSave = false;
+	bool haveSave = ConfMan.hasKey(LAST_SAVE_CONF);
 
 	TeButtonLayout *continuegameunlockButton = buttonLayout("continuegameunlockButton");
 	if (continuegameunlockButton) {


Commit: d1e4f1c18dc40bfbf403b7c200eee092b3a18e27
    https://github.com/scummvm/scummvm/commit/d1e4f1c18dc40bfbf403b7c200eee092b3a18e27
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-11T21:03:57+09:00

Commit Message:
TETRAEDGE: Correct type for bools. PVS-Studio V601

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 80a5fe6dab3..10919264cb5 100644
--- a/engines/tetraedge/game/lua_binds.cpp
+++ b/engines/tetraedge/game/lua_binds.cpp
@@ -2270,8 +2270,8 @@ static int tolua_ExportedFunctions_BlendCharacterPlayerAnimation00(lua_State *L)
 		&& tolua_isnoobj(L, 5, &err)) {
 		Common::String s1(tolua_tostring(L, 1, nullptr));
 		float f1 = tolua_tonumber(L, 2, 0.0);
-		float b1 = tolua_toboolean(L, 3, true);
-		float b2 = tolua_toboolean(L, 4, false);
+		bool b1 = tolua_toboolean(L, 3, true);
+		bool b2 = tolua_toboolean(L, 4, false);
 		BlendCharacterPlayerAnimation(s1, f1, b1, b2);
 		return 0;
 	}


Commit: cd33aadb89f6fa5da1e67f009c2132c0b340f0f2
    https://github.com/scummvm/scummvm/commit/cd33aadb89f6fa5da1e67f009c2132c0b340f0f2
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-11T21:04:28+09:00

Commit Message:
TETRAEDGE: Ensure teFormat is initialized.  PVS-Studio V730

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


diff --git a/engines/tetraedge/te/te_image.cpp b/engines/tetraedge/te/te_image.cpp
index 2aa8d6b1ebf..06f9776b5f4 100644
--- a/engines/tetraedge/te/te_image.cpp
+++ b/engines/tetraedge/te/te_image.cpp
@@ -31,7 +31,7 @@ namespace Tetraedge {
 TeImage::TeImage() : ManagedSurface(), _teFormat(INVALID) {
 }
 
-TeImage::TeImage(const TeImage &other) : ManagedSurface(other) {
+TeImage::TeImage(const TeImage &other) : ManagedSurface(other), _teFormat(INVALID) {
 	error("TODO: Implement TeImage::TeImage copy constructor");
 }
 


Commit: 2b6ddb539637e906e165ef16ec86f859f7445906
    https://github.com/scummvm/scummvm/commit/2b6ddb539637e906e165ef16ec86f859f7445906
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-11T21:06:03+09:00

Commit Message:
TETRAEDGE: Fix null check on output flag. PVS-Studio V595

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


diff --git a/engines/tetraedge/te/te_free_move_zone.cpp b/engines/tetraedge/te/te_free_move_zone.cpp
index 98368ea3b84..893852539b6 100644
--- a/engines/tetraedge/te/te_free_move_zone.cpp
+++ b/engines/tetraedge/te/te_free_move_zone.cpp
@@ -271,7 +271,7 @@ TeVector3f32 TeFreeMoveZone::correctCharacterPosition(const TeVector3f32 &pos, b
 		if (!intersect(testPos, TeVector3f32(0, 1, 0), intersectPoint, f, intersectFlag, nullptr)) {
 			// Note: This flag should only ever get set in Syberia 2.
 			if (!_collisionSlide) {
-				if (*flagout)
+				if (flagout)
 					*flagout = false;
 				return pos;
 			}


Commit: a7e5f38c8774c7e2494fc667a52f80699612ac1d
    https://github.com/scummvm/scummvm/commit/a7e5f38c8774c7e2494fc667a52f80699612ac1d
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-11T21:07:53+09:00

Commit Message:
TETRAEDGE: Correct variant return types. PVS-Studio V601

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


diff --git a/engines/tetraedge/te/te_variant.cpp b/engines/tetraedge/te/te_variant.cpp
index 79f6f8c906d..c86ad18dab6 100644
--- a/engines/tetraedge/te/te_variant.cpp
+++ b/engines/tetraedge/te/te_variant.cpp
@@ -62,7 +62,7 @@ float TeVariant::toFloat32(bool *success) const {
 	} else {
 		if (success)
 			*success = false;
-		return false;
+		return 0;
 	}
 
 }
@@ -75,7 +75,7 @@ double TeVariant::toFloat64(bool *success) const {
 	} else {
 		if (success)
 			*success = false;
-		return false;
+		return 0;
 	}
 
 }
@@ -88,7 +88,7 @@ int32 TeVariant::toSigned32(bool *success) const {
 	} else {
 		if (success)
 			*success = false;
-		return false;
+		return 0;
 	}
 
 }
@@ -101,7 +101,7 @@ int64 TeVariant::toSigned64(bool *success) const {
 	} else {
 		if (success)
 			*success = false;
-		return false;
+		return 0;
 	}
 
 }
@@ -127,7 +127,7 @@ uint32 TeVariant::toUnsigned32(bool *success) const {
 	} else {
 		if (success)
 			*success = false;
-		return false;
+		return 0;
 	}
 
 }
@@ -140,7 +140,7 @@ uint64 TeVariant::toUnsigned64(bool *success) const {
 	} else {
 		if (success)
 			*success = false;
-		return false;
+		return 0;
 	}
 
 }


Commit: a1f6784f3599fc09827c5ce3ab83dbf022c0212b
    https://github.com/scummvm/scummvm/commit/a1f6784f3599fc09827c5ce3ab83dbf022c0212b
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-11T21:12:09+09:00

Commit Message:
TETRAEDGE: Remove redundant value check. PVS-Studio V560

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


diff --git a/engines/tetraedge/te/te_renderer.cpp b/engines/tetraedge/te/te_renderer.cpp
index 1444ff9b49e..dbf76cff06d 100644
--- a/engines/tetraedge/te/te_renderer.cpp
+++ b/engines/tetraedge/te/te_renderer.cpp
@@ -92,7 +92,7 @@ void TeRenderer::addTransparentMesh(const TeMesh &mesh, uint i1, uint tricount,
 				_transparentMeshColors[propNo + 2] = mesh.color(mesh.index(meshNo0 + 2));
 			}
 		}
-	} else if (meshMode == TeMesh::MeshMode_TriangleStrip && tricount > 0) {
+	} else if (meshMode == TeMesh::MeshMode_TriangleStrip) {
 		for (uint i = 0; i < tricount; i++) {
 			const uint meshNo0 = (i1 + i);  // TODO: This appears to be the only difference between this and the above?
 			const uint propNo = (_numTransparentMeshes + i) * 3;




More information about the Scummvm-git-logs mailing list