[Scummvm-git-logs] scummvm master -> 19e679830316e9993d25b532835a9d7ae5b6f599

digitall noreply at scummvm.org
Sun Apr 30 10:18:33 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:
19e6798303 WATCHMAKER: Further Fixes For GCC Compiler Warnings


Commit: 19e679830316e9993d25b532835a9d7ae5b6f599
    https://github.com/scummvm/scummvm/commit/19e679830316e9993d25b532835a9d7ae5b6f599
Author: D G Turner (digitall at scummvm.org)
Date: 2023-04-30T11:18:15+01:00

Commit Message:
WATCHMAKER: Further Fixes For GCC Compiler Warnings

Changed paths:
    engines/watchmaker/3d/geometry.cpp
    engines/watchmaker/3d/light.cpp
    engines/watchmaker/3d/loader.cpp
    engines/watchmaker/3d/render/opengl_3d.cpp
    engines/watchmaker/fonts.cpp
    engines/watchmaker/ll/ll_diary.cpp
    engines/watchmaker/t2d/t2d.cpp


diff --git a/engines/watchmaker/3d/geometry.cpp b/engines/watchmaker/3d/geometry.cpp
index 2dee4ddf7f7..5ba39fee421 100644
--- a/engines/watchmaker/3d/geometry.cpp
+++ b/engines/watchmaker/3d/geometry.cpp
@@ -2435,7 +2435,6 @@ void t3dCalcHalos(t3dBODY *b) {
 	return;
 
 	gMaterial   *Material;
-	int16      T1;
 	uint32      uvbc;
 	uint32      i;
 	gVertex     *gv;
@@ -2471,7 +2470,6 @@ void t3dCalcHalos(t3dBODY *b) {
 
 		if (l.Type & T3D_LIGHT_FLARE) {
 			Material = &l.Material[0];
-			T1 = Material->Texture->ID;
 
 			size = l.FlareSize;
 
@@ -2734,7 +2732,7 @@ void t3dAnimLights(t3dBODY *b) {
 	t3dCalcHalos(b); // Calculate flare/halos for lights
 
 	bProcessLights = 0;
-	int light = 0;
+	uint32 light = 0;
 	while ((light < b->NumLights())) {
 		t3dLIGHT &l = b->LightTable[light];
 		if (l.Type & T3D_LIGHT_CANDLESMOKE)
diff --git a/engines/watchmaker/3d/light.cpp b/engines/watchmaker/3d/light.cpp
index 495bb7e1c89..d1e5a346cdd 100644
--- a/engines/watchmaker/3d/light.cpp
+++ b/engines/watchmaker/3d/light.cpp
@@ -430,7 +430,7 @@ void t3dLIGHT::SetVisibleFromLight(gVertex *v) {
  * --------------------------------------------------*/
 void t3dLIGHT::setupVisibleVerticesFromLight(t3dBODY *b) {
 	gVertex     *gv;
-	for (int k = 0; k < b->NumMeshes(); k++) {
+	for (uint32 k = 0; k < b->NumMeshes(); k++) {
 		t3dMESH &m = b->MeshTable[k];
 #ifndef WMGEN
 		m.VBptr = m.VertexBuffer;
diff --git a/engines/watchmaker/3d/loader.cpp b/engines/watchmaker/3d/loader.cpp
index e7e8e188507..60fb0ee90c0 100644
--- a/engines/watchmaker/3d/loader.cpp
+++ b/engines/watchmaker/3d/loader.cpp
@@ -135,12 +135,12 @@ public:
 	};
 	_t3dLOADLIST t3dLoadList[MAX_T3D_LOADLIST_ITEMS] = {};
 
-	void addToLoadList(t3dMESH *m, const Common::String &pname, uint32 LoaderFlags) {
+	void addToLoadList(t3dMESH *m, const Common::String &pname, uint32 _LoaderFlags) {
 		if (!pname.empty()) {
 			int32 a;
 			for (a = 0; a < MAX_T3D_LOADLIST_ITEMS; a++) {
 				if (t3dLoadList[a].pname.empty()) {
-					t3dLoadList[a].LoaderFlags = LoaderFlags;
+					t3dLoadList[a].LoaderFlags = _LoaderFlags;
 					t3dLoadList[a].m = m;
 					t3dLoadList[a].pname = pname;
 					break;
@@ -253,8 +253,8 @@ RoomManager *RoomManager::create(WGame *game) {
 /* -----------------10/06/99 16.04-------------------
  *                  t3dLoadRoom
  * --------------------------------------------------*/
-t3dBODY* RoomManagerImplementation::loadRoom(const Common::String &pname, t3dBODY *b, uint16 *NumBody, uint32 LoaderFlags) {
-	warning("t3dLoadRoom(%s, b, %d, %d)", pname.c_str(), *NumBody, LoaderFlags);
+t3dBODY* RoomManagerImplementation::loadRoom(const Common::String &pname, t3dBODY *b, uint16 *NumBody, uint32 _LoaderFlags) {
+	warning("t3dLoadRoom(%s, b, %d, %d)", pname.c_str(), *NumBody, _LoaderFlags);
 	struct _t3dLOADLIST *l;
 	t3dBODY *r = nullptr;
 	t3dBODY *rez = nullptr;
@@ -265,7 +265,7 @@ t3dBODY* RoomManagerImplementation::loadRoom(const Common::String &pname, t3dBOD
 	}
 
 	// Add the base stanza to the upload list
-	addToLoadList(nullptr, pname, LoaderFlags);
+	addToLoadList(nullptr, pname, _LoaderFlags);
 
 	while ((l = getFromLoadList())) {
 		uint16 num = 0;
@@ -286,7 +286,7 @@ t3dBODY* RoomManagerImplementation::loadRoom(const Common::String &pname, t3dBOD
 		*l = _t3dLOADLIST();
 	}
 
-	if (!(LoaderFlags & T3D_NORECURSION)) {
+	if (!(_LoaderFlags & T3D_NORECURSION)) {
 		for (uint16 i = 0; i < NumLoadedFiles; i++)
 			if (LoadedFiles[i].b)
 				t3dCalcRejectedMeshFromPortal(LoadedFiles[i].b);
@@ -296,9 +296,9 @@ t3dBODY* RoomManagerImplementation::loadRoom(const Common::String &pname, t3dBOD
 	return r;
 }
 
-t3dBODY* RoomManagerImplementation::loadSingleRoom(const Common::String &_pname, uint16 *NumBody, uint32 LoaderFlags) {
-	//warning("t3dLoadSingleRoom(workDirs, %s, b, %d, %d)", _pname, *NumBody, LoaderFlags);
-	//decodeLoaderFlags(LoaderFlags);
+t3dBODY* RoomManagerImplementation::loadSingleRoom(const Common::String &_pname, uint16 *NumBody, uint32 _LoaderFlags) {
+	//warning("t3dLoadSingleRoom(workDirs, %s, b, %d, %d)", _pname, *NumBody, _LoaderFlags);
+	//decodeLoaderFlags(_LoaderFlags);
 	Common::String pname(_pname);
 
 	WorkDirs &workdirs = _game->workDirs;
@@ -350,7 +350,7 @@ t3dBODY* RoomManagerImplementation::loadSingleRoom(const Common::String &_pname,
 		LoadedFiles[j].b = b;                                      // Aggiunge Body alla lista
 		j = 0;
 	}
-	b->loadFromStream(*_game, pname, *stream, LoaderFlags);
+	b->loadFromStream(*_game, pname, *stream, _LoaderFlags);
 
 	return b;
 }
@@ -522,12 +522,12 @@ Common::SharedPtr<VertexBuffer> t3dAddVertexBuffer(t3dBODY *b, uint32 numv) {
  *              t3dOptimizeMaterialList
  * --------------------------------------------------*/
 void t3dOptimizeMaterialList(t3dBODY *b) {
-	for (int i = 0; i < b->NumMaterials(); i++) {                                              // Scorre tutti materilai di un body
+	for (uint32 i = 0; i < b->NumMaterials(); i++) {                                              // Scorre tutti materilai di un body
 		MaterialPtr Mat = b->MatTable[i];
 		if ((Mat == nullptr) || /*(!Mat->Texture->Name) ||*/ (Mat->Movie) || (Mat->hasFlag(T3D_MATERIAL_MOVIE))) // Se non esiste o non ha texture
 			continue;                                                                           // esce
 
-		for (int j = 0; j < b->NumMaterials(); j++) {                                       // Cerca materiali uguali
+		for (uint32 j = 0; j < b->NumMaterials(); j++) {                                       // Cerca materiali uguali
 			MaterialPtr CurMat = b->MatTable[j];
 			if (Mat == CurMat)
 				continue;
@@ -540,7 +540,7 @@ void t3dOptimizeMaterialList(t3dBODY *b) {
 				// This is currently broken.
 
 				Mat = rMergeMaterial(Mat, CurMat);                                          // Unisce i due materiali
-				for (int k = 0; k < b->NumMeshes(); k++) {                                       // Aggiorna in tutte le mesh id materiale
+				for (uint32 k = 0; k < b->NumMeshes(); k++) {                                       // Aggiorna in tutte le mesh id materiale
 					auto &m = b->MeshTable[k];
 					for (int q = 0; q < m.NumFaces(); q++) {
 						auto &f = m.FList[q];
@@ -558,11 +558,11 @@ void t3dOptimizeMaterialList(t3dBODY *b) {
 	// references to them. Currently we do this by subtracting 1 from all references that were above
 	// a removed material. This works, but isn't really optimal.
 	int subtract = 0;
-	for (int i = 0; i < b->NumMaterials(); i++) {
+	for (uint32 i = 0; i < b->NumMaterials(); i++) {
 		if (!b->MatTable[i]) {
 			b->MatTable.remove_at(i);
 			subtract++;
-			for (int k = 0; k < b->NumMeshes(); k++) {
+			for (uint32 k = 0; k < b->NumMeshes(); k++) {
 				auto &m = b->MeshTable[k];
 				for (int q = 0; q < m.NumFaces(); q++) {
 					auto &f = m.FList[q];
@@ -636,13 +636,13 @@ void t3dFinalizeMaterialList(t3dBODY *b) {
 #endif
 	}
 
-	for (int i = 0; i < b->NumMaterials(); i++) {
+	for (uint32 i = 0; i < b->NumMaterials(); i++) {
 		auto &Mat = b->MatTable[i];
 		if (!Mat) {
 			warning("nullptr");
 		}
 		Mat->VBO = b->addVertexBuffer(); // t3dAddVertexBuffer(b, Mat->NumAllocatedVerts);
-		for (int j = 0; j < (uint32)Mat->NumAddictionalMaterial; j++)
+		for (int j = 0; j < Mat->NumAddictionalMaterial; j++)
 			Mat->AddictionalMaterial[j]->VBO = t3dAddVertexBuffer(b, Mat->AddictionalMaterial[j]->NumAllocatedVerts());
 	}
 }
diff --git a/engines/watchmaker/3d/render/opengl_3d.cpp b/engines/watchmaker/3d/render/opengl_3d.cpp
index 5898454e6e7..47b2f075a41 100644
--- a/engines/watchmaker/3d/render/opengl_3d.cpp
+++ b/engines/watchmaker/3d/render/opengl_3d.cpp
@@ -469,7 +469,6 @@ void gBuildAlternateName(char *AltName, char *Name) {
 
 //*********************************************************************************************
 gTexture *gUserTexture(Texture *texture, unsigned int dimx, unsigned int dimy) {
-	bool        AlreadyLoaded = FALSE, bAlpha = FALSE;
 	gTexture    *Texture;
 	int         pos;
 	//DDSURFACEDESC2    DDSurfDesc;
@@ -498,34 +497,44 @@ gTexture *gUserTexture(Texture *texture, unsigned int dimx, unsigned int dimy) {
 			DDSurfDesc.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE;
 		}
 #endif
-		if (dimx > 8)
-			if (dimx > 16)
-				if (dimx > 32)
-					if (dimx > 64)
-						if (dimx > 128)
+		if (dimx > 8) {
+			if (dimx > 16) {
+				if (dimx > 32) {
+					if (dimx > 64) {
+						if (dimx > 128) {
 							dimx = 256;
-						else
+						} else {
 							dimx = 128;
-					else
+						}
+					} else {
 						dimx = 64;
-				else
+					}
+				} else {
 					dimx = 32;
-			else
+				}
+			} else {
 				dimx = 16;
-		if (dimy > 8)
-			if (dimy > 16)
-				if (dimy > 32)
-					if (dimy > 64)
-						if (dimy > 128)
+			}
+		}
+		if (dimy > 8) {
+			if (dimy > 16) {
+				if (dimy > 32) {
+					if (dimy > 64) {
+						if (dimy > 128) {
 							dimy = 256;
-						else
+						} else {
 							dimy = 128;
-					else
+						}
+					} else {
 						dimy = 64;
-				else
+					}
+				} else {
 					dimy = 32;
-			else
+				}
+			} else {
 				dimy = 16;
+			}
+		}
 #if 0
 		DDSurfDesc.dwWidth = dimx;
 		DDSurfDesc.dwHeight = dimy;
diff --git a/engines/watchmaker/fonts.cpp b/engines/watchmaker/fonts.cpp
index 8d635574f6c..6095db428bb 100644
--- a/engines/watchmaker/fonts.cpp
+++ b/engines/watchmaker/fonts.cpp
@@ -86,6 +86,8 @@ SFont *Fonts::fontForKind(FontKind font) {
 		return &ComputerFont;
 	case FontKind::PDA:
 		return &PDAFont;
+	default:
+		return nullptr;
 	}
 }
 
diff --git a/engines/watchmaker/ll/ll_diary.cpp b/engines/watchmaker/ll/ll_diary.cpp
index df5eb125773..f25d104688a 100644
--- a/engines/watchmaker/ll/ll_diary.cpp
+++ b/engines/watchmaker/ll/ll_diary.cpp
@@ -265,16 +265,14 @@ void StopDiary(WGame &game, int32 room, int32 obj, uint8 only_overtime) {
  * --------------------------------------------------*/
 void ContinueDiary(WGame &game, int32 an) {
 	struct SDiary *d;
-	int32 i, ca, pos;
+	int32 i, ca;
 	Init &init = game.init;
 
 //	DebugLogFile( "Continuo Diario per anim %d", an );
 
-	pos = -1;
 	for (i = 0, d = &init.Diary[0]; i < MAX_DIARIES; i++, d++) {
 		if ((!d->item[d->cur].on) || (d->item[d->cur].anim[d->item[d->cur].cur] != an)) continue;
 
-		pos = init.Anim[an].pos;
 		d->item[d->cur].cur ++;
 		if (!(ca = d->item[d->cur].anim[d->item[d->cur].cur]) || init.Anim[ca].active) {
 			if ((!d->item[d->cur].loop) || !(ca = d->item[d->cur].anim[0]) || init.Anim[ca].active ||
diff --git a/engines/watchmaker/t2d/t2d.cpp b/engines/watchmaker/t2d/t2d.cpp
index a8130c65e90..eea8b2465a1 100644
--- a/engines/watchmaker/t2d/t2d.cpp
+++ b/engines/watchmaker/t2d/t2d.cpp
@@ -1545,9 +1545,6 @@ void doT2DMouse(WGame &game) {
 					//Suono
 					StartSound(game, wSCANPULSANTE);
 				} else if ((CurButton == T2D_BT_SCANNER_TOOLBAR_SCAN_OFF) && (TheMessage->event != ME_MOUSEUPDATE)) {
-					extern uint8 bWinLog;
-					//bWinLog=1;
-
 					w->bm[T2D_BM_SCANNER_TOOLBAR_SCAN_OFF].tnum |= T2D_BM_OFF;
 					w->bm[T2D_BM_SCANNER_TOOLBAR_SCAN_ON].tnum &= ~T2D_BM_OFF;
 					_vm->_messageSystem.doEvent(EventClass::MC_SYSTEM, ME_STARTEFFECT, MP_DEFAULT, T2D_SCANNER_BUTTON_DELAY, 0, EFFECT_WAIT,




More information about the Scummvm-git-logs mailing list