diff --git a/engines/watchmaker/3d/animation.cpp b/engines/watchmaker/3d/animation.cpp index 80e773a8278..b4f3b9feaef 100644 --- a/engines/watchmaker/3d/animation.cpp +++ b/engines/watchmaker/3d/animation.cpp @@ -156,7 +156,7 @@ uint8 GetLightDirection(t3dV3F *dest, uint8 pos) { * t3dLoadAnimation * --------------------------------------------------*/ int8 t3dLoadAnimation(WGame &game, const char *s, t3dMESH *mesh, uint16 Flag) { - uint32 nf, nb, i, j, k, h, older, len, ScaleAnim, CurPreloadedAnim; + uint32 nf, nb, i, j, k, h, older, ScaleAnim, CurPreloadedAnim; t3dLOADANIM *p; t3dLOADBONE *bone; t3dBONEANIM *db; @@ -560,7 +560,7 @@ t3dBODY *LoadShadowMeshes(WGame &game, const char *pname, t3dBODY *Body) { t3dCHARACTER *t3dLoadCharacter(WGame &game, const char *pname, uint16 num) { warning("LoadCharacter(%s)", pname); uint8 Mirror = 1; - uint16 n = 0, f, i; + uint16 n = 0, f; t3dV3F tmp; // gVertex *v; @@ -657,8 +657,6 @@ t3dCHARACTER *t3dLoadCharacter(WGame &game, const char *pname, uint16 num) { * GetFullLightPosition * --------------------------------------------------*/ uint8 GetFullLightDirection(t3dV3F *dest, uint8 pos) { - uint8 a; - if (!pos) return 0; auto pLights = t3dCurRoom->getPositionalLight(pos); @@ -697,7 +695,6 @@ void ReleasePreloadedAnims() { uint8 CompareLightPosition(char *roomname, uint8 pos1, t3dV3F *pos2, t3dF32 acceptable_dist) { t3dV3F p1; t3dBODY *t; - int32 i; if ((pos1 <= 0) || (pos2 == nullptr)) return FALSE; diff --git a/engines/watchmaker/3d/geometry.cpp b/engines/watchmaker/3d/geometry.cpp index c33e847328d..aef3cfd22bf 100644 --- a/engines/watchmaker/3d/geometry.cpp +++ b/engines/watchmaker/3d/geometry.cpp @@ -2305,7 +2305,6 @@ void t3dSetFaceVisibility(t3dMESH *mesh, t3dCAMERA *cam) { T1 = T2 = -1; MaterialPtr target = nullptr; - int targetIndex = 0; for (uint32 i = 0; i < mesh->NumFaces(); i++) { t3dFACE &f = mesh->FList[i]; @@ -2722,7 +2721,7 @@ void t3dRaiseSmoke(t3dV3F *pos, t3dParticle *p) { * --------------------------------------------------*/ void t3dAnimLights(t3dBODY *b) { // t3dU8 exist=0; - gVertex **vlist, *vv; + gVertex *vv; int32 rr, gg, bb, aa; uint8 bProcessLights; @@ -2734,10 +2733,10 @@ void t3dAnimLights(t3dBODY *b) { t3dCalcHalos(b); //Calculate flare/halos for lights - int i = 0; + int k = 0; bProcessLights = 0; - while ((i < b->NumLights())) { - t3dLIGHT &l = b->LightTable[i]; + while ((k < b->NumLights())) { + t3dLIGHT &l = b->LightTable[k]; if (l.Type & T3D_LIGHT_CANDLESMOKE) t3dRaiseSmoke(&l.Source, l.Particle.get()); else if (l.Type & T3D_LIGHT_PULSE) { @@ -2747,12 +2746,12 @@ void t3dAnimLights(t3dBODY *b) { l.LightRandomizer = -rand() % ((int32)(l.Color.x + l.Color.y + l.Color.z) / 12); #endif } - i++; + k++; } if (bProcessLights) { //lock all vertexbuffers - for (int i = 0; i < b->NumMeshes(); i++) { + for (uint i = 0; i < b->NumMeshes(); i++) { t3dMESH &m = b->MeshTable[i]; m.VBptr = m.VertexBuffer; m.Flags |= T3D_MESH_UPDATEVB; @@ -2786,7 +2785,7 @@ void t3dAnimLights(t3dBODY *b) { l.FlickerDelay++; } //lock all vertexbuffers - for (i = 0; i < b->NumMeshes(); i++) { + for (uint i = 0; i < b->NumMeshes(); i++) { b->MeshTable[i].VBptr = nullptr; } } @@ -2810,14 +2809,13 @@ void t3dCheckMaterialVB(MaterialPtr mat) { //warning("TODO: Implement t3dCheckMaterialVB"); // gv = rLockVertexPtr(mat->VB, DDLOCK_WRITEONLY | DDLOCK_NOSYSLOCK); mat->VBO->_buffer.clear(); - for (int i = 0; i < mat->NumAllocatedVerts(); i++) { + for (i = 0; i < mat->NumAllocatedVerts(); i++) { auto vert = *mat->VertsList[i]; mat->VBO->_buffer.push_back(vert); //memcpy(gv, mat->VertsList[i], sizeof(gVertex)); } // rUnlockVertexPtr(mat->VB); - } /* -----------------10/06/99 15.49------------------- diff --git a/engines/watchmaker/3d/math/llmath.h b/engines/watchmaker/3d/math/llmath.h index b4877c98316..336ce2ffe8d 100644 --- a/engines/watchmaker/3d/math/llmath.h +++ b/engines/watchmaker/3d/math/llmath.h @@ -36,7 +36,6 @@ void t3dMatMul(t3dM3X3F *Dest, t3dM3X3F *a, t3dM3X3F *b); void t3dMatRotAxis(t3dM3X3F *m, t3dF32 x, t3dF32 y, t3dF32 z, t3dF32 rad); void t3dMatRot(t3dM3X3F *matrix, t3dF32 x, t3dF32 y, t3dF32 z); void t3dMatReflect(t3dM3X3F *Matrix, t3dV3F *mirrorpos, t3dNORMAL *n); -void t3dMatCopy(t3dM3X3F *d, t3dM3X3F *s); void t3dMatView(t3dM3X3F *dest, t3dV3F *eye, t3dV3F *center); void t3dVectTransform(t3dV3F *d, t3dV3F *s, t3dM3X3F *mat); void t3dVectTransformInv(t3dV3F *d, t3dV3F *s, t3dM3X3F *mat); @@ -45,7 +44,6 @@ void t3dVectCross(t3dV3F *d, t3dV3F *v2, t3dV3F *v3); void t3dVectSub(t3dV3F *d, t3dV3F *a, t3dV3F *b); // d = a - b void t3dVectAdd(t3dV3F *d, t3dV3F *a, t3dV3F *b); // d = a - b void t3dVectFill(t3dV3F *d, t3dF32 a); -void t3dVectInit(t3dV3F *d, t3dF32 a1, t3dF32 a2, t3dF32 a3); void t3dVectCopy(t3dV3F *d, t3dV3F *s); t3dF32 t3dVectMod(t3dV3F *c); t3dF32 t3dVectDistance(t3dV3F *a, t3dV3F *b); diff --git a/engines/watchmaker/3d/t3d_body.h b/engines/watchmaker/3d/t3d_body.h index d606c571878..5d8352e7c65 100644 --- a/engines/watchmaker/3d/t3d_body.h +++ b/engines/watchmaker/3d/t3d_body.h @@ -72,7 +72,7 @@ public: return VBTable.back(); } void clearVBTable() { - for (int i = 0; i < VBTable.size(); i++) { + for (uint i = 0; i < VBTable.size(); i++) { rDeleteVertexBuffer(*VBTable[i]); } VBTable.clear(); diff --git a/engines/watchmaker/ll/ll_mesh.cpp b/engines/watchmaker/ll/ll_mesh.cpp index 182aaa324de..b48fd401eef 100644 --- a/engines/watchmaker/ll/ll_mesh.cpp +++ b/engines/watchmaker/ll/ll_mesh.cpp @@ -501,7 +501,6 @@ void SMeshModifier::modifyMesh(WGame &game, t3dMESH *mesh) { * --------------------------------------------------*/ void MeshModifiers::addMeshModifier(const Common::String &name, int16 com, void *p) { struct SMeshModifier *mm; - uint32 Flags; int16 i; warning("Not sure this is right"); // Used to check for nullptr, not 0 length. diff --git a/engines/watchmaker/ll/ll_mouse.cpp b/engines/watchmaker/ll/ll_mouse.cpp index 2683e79b077..98322a46cb2 100644 --- a/engines/watchmaker/ll/ll_mouse.cpp +++ b/engines/watchmaker/ll/ll_mouse.cpp @@ -146,7 +146,6 @@ void ProcessMouse(WGame &game) { void HandleMouseChanges() { // Mouse movement will have been accumulated prior to calling this function. // Button flags may also have been changed, this function then applies the button changes. - int curX, curY; //warning("L: %d %d R: %d %d", bLPressed, bLPressedPrev, bRPressed, bRPressedPrev); // Button 0 pressed or released diff --git a/engines/watchmaker/ll/ll_regen.cpp b/engines/watchmaker/ll/ll_regen.cpp index f4038bc8f22..a37d72be465 100644 --- a/engines/watchmaker/ll/ll_regen.cpp +++ b/engines/watchmaker/ll/ll_regen.cpp @@ -355,7 +355,6 @@ void Add3DStuff(WGame &game) { if (LoaderFlags & T3D_DEBUGMODE) { extern uint8 t3dCurCameraIndex; - extern int ci; auto windowInfo = game._renderer->getScreenInfos(); if (CurFps > 100.0f) CurFps = 100.0f; if (AvgFps > 100.0f) AvgFps = 100.0f; @@ -407,10 +406,10 @@ void Add3DStuff(WGame &game) { // if( CurFps > hi ) hi = CurFps; // if( CurFps < lo ) lo = CurFps; // DebugVideo(1,y+=16,"mHide %d",mHide); -// DebugVideo(1,1,"FPS: %3d TRI: %d VERT: %d",(int)AvgFps,StatNumTris,StatNumVerts); +// DebugVideo(1,1,"FPS: %3d TRI: %d VERT: %d",(int)AvgFps,StatNumTris,StatNumVerts); // DebugVideo(1,y+=16,"CurTime %d CurCamera %d",t3dCurTime,t3dCurCameraIndex+1); // DebugVideo(1,y+=16,"CurDialog %d, obj %d",CurDialog,Dialog[CurDialog].obj); -// DebugVideo(1,y+=16,"%d,%d: %s (%d %d) %X",CurRoom,CurObj,ObjectUnderCursor,NextPortalObj,NextPortalAnim,Obj[CurObj].flags); //_remove +// DebugVideo(1,y+=16,"%d,%d: %s (%d %d) %X",CurRoom,CurObj,ObjectUnderCursor,NextPortalObj,NextPortalAnim,Obj[CurObj].flags); //_remove } } // Aggiunge i rettangoli D3D diff --git a/engines/watchmaker/ll/ll_util.cpp b/engines/watchmaker/ll/ll_util.cpp index 319c631744f..0776d6ce366 100644 --- a/engines/watchmaker/ll/ll_util.cpp +++ b/engines/watchmaker/ll/ll_util.cpp @@ -422,10 +422,7 @@ void UpdateRoomVisibility(WGame &game) { * SetBndLevel * --------------------------------------------------*/ bool SetBndLevel(WGame &game, const char *roomname, int32 lev) { - t3dBODY *t; - int32 i; - - t = nullptr; + t3dBODY *t = nullptr; if (roomname && (roomname[0] != '\0')) { _vm->_roomManager->getRoomIfLoaded(roomname); } else t = t3dCurRoom; @@ -566,10 +563,7 @@ void ChangeRoom(WGame &game, Common::String n, uint8 pos, int32 an) { * GetBndLevel * --------------------------------------------------*/ int32 GetBndLevel(char *roomname) { - t3dBODY *t; - int32 i; - - t = nullptr; + t3dBODY *t = nullptr; if (roomname && (roomname[0] != '\0')) { t = _vm->_roomManager->getRoomIfLoaded(roomname); } else t = t3dCurRoom; diff --git a/engines/watchmaker/main.cpp b/engines/watchmaker/main.cpp index 34d754e32b5..b3099b7791b 100644 --- a/engines/watchmaker/main.cpp +++ b/engines/watchmaker/main.cpp @@ -50,8 +50,7 @@ int WMakerMain() { warning("The Watchmaker"); //CreateWindow() - int loaderFlags = 0; - //loaderFlags = ParseCommandLine() + //int loaderFlags = ParseCommandLine() WGame *game = new WGame; diff --git a/engines/watchmaker/render.cpp b/engines/watchmaker/render.cpp index 79eb1955f35..ddca011e452 100644 --- a/engines/watchmaker/render.cpp +++ b/engines/watchmaker/render.cpp @@ -93,7 +93,7 @@ bool rClearBuffers(char flags) { checkGlError("Entering rClearBuffers"); bool clearStencil = rGetStencilBitDepth() != 0; bool clearDepth = flags & rCLEARZBUFFER; - bool clearBack = flags & rCLEARBACKBUFFER; + //bool clearBack = flags & rCLEARBACKBUFFER; bool clearScreen = flags & rCLEARSCREENBUFFER; // Picking green to make the clear color easy to spot. diff --git a/engines/watchmaker/renderer.cpp b/engines/watchmaker/renderer.cpp index 028ac16a0ea..4c411dc2acf 100644 --- a/engines/watchmaker/renderer.cpp +++ b/engines/watchmaker/renderer.cpp @@ -197,10 +197,7 @@ void Renderer::printText(const char *s, unsigned int dst, FontKind font, FontCol auto f = _fonts->fontForKind(font); uint32 src = f->color[color]; - if (dst == 0) - gPrintText(*_game, s, NULL, src, f->table, x, y); - else - gPrintText(*_game, s, dst, src, f->table, x, y); + gPrintText(*_game, s, dst, src, f->table, x, y); } bool Renderer::setProjectionMatrix(float width, float height, float fAspect, float fNearPlane, float fFarPlane) { diff --git a/engines/watchmaker/t2d/t2d.cpp b/engines/watchmaker/t2d/t2d.cpp index 79d0903d0a4..edad9b45519 100644 --- a/engines/watchmaker/t2d/t2d.cpp +++ b/engines/watchmaker/t2d/t2d.cpp @@ -5443,13 +5443,13 @@ void doT2D(WGame &game) { } void CaricaSaves(WGame &game) { + warning("STUBBED: CaricaSaves"); +#if 0 int i, j; char DataFile[MAX_PATH]; char GfxFile[MAX_PATH]; char Temp[10]; char Data[T3D_NAMELEN + 8]; - warning("STUBBED: CaricaSaves"); -#if 0 FILE *file; NSaves = 0; diff --git a/engines/watchmaker/work_dirs.cpp b/engines/watchmaker/work_dirs.cpp index 3d5807ead7e..5f84145529e 100644 --- a/engines/watchmaker/work_dirs.cpp +++ b/engines/watchmaker/work_dirs.cpp @@ -28,7 +28,7 @@ namespace Watchmaker { Common::SharedPtr WorkDirs::resolveFile(const Common::String &path, bool noFastFile) { Common::String converted = path; - for (int i = 0; i < path.size(); i++) { + for (uint i = 0; i < path.size(); i++) { if (converted[i] == '\\') { converted.setChar('/', i); }