[Scummvm-git-logs] scummvm master -> 3f7927d32424fb08975e504f84d15e417faae475
digitall
noreply at scummvm.org
Mon May 1 19:49:28 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:
3f7927d324 WATCHMAKER: Further Fixes For GCC Compiler Warnings
Commit: 3f7927d32424fb08975e504f84d15e417faae475
https://github.com/scummvm/scummvm/commit/3f7927d32424fb08975e504f84d15e417faae475
Author: D G Turner (digitall at scummvm.org)
Date: 2023-05-01T20:49:12+01:00
Commit Message:
WATCHMAKER: Further Fixes For GCC Compiler Warnings
Changed paths:
engines/watchmaker/3d/material.cpp
engines/watchmaker/3d/material.h
engines/watchmaker/3d/movie.cpp
engines/watchmaker/3d/movie.h
engines/watchmaker/3d/render/opengl_3d.cpp
engines/watchmaker/3d/render/opengl_renderer.cpp
engines/watchmaker/3d/render/opengl_texture.cpp
engines/watchmaker/3d/t3d_body.cpp
engines/watchmaker/3d/t3d_mesh.cpp
engines/watchmaker/classes/do_action.cpp
diff --git a/engines/watchmaker/3d/material.cpp b/engines/watchmaker/3d/material.cpp
index 28ab82e5999..96563100683 100644
--- a/engines/watchmaker/3d/material.cpp
+++ b/engines/watchmaker/3d/material.cpp
@@ -185,12 +185,12 @@ Common::SharedPtr<gMaterial> rCopyMaterial(Common::SharedPtr<gMaterial> Mat1, Co
return Mat1;
}
-void rCopyMaterialList(MaterialTable &dst, MaterialTable &src, int count) {
+void rCopyMaterialList(MaterialTable &dst, MaterialTable &src, uint count) {
dst.resize(count);
if (count > src.size()) {
error("Copying more materials than there are in the src");
}
- for (int i = 0; i < count; i++) {
+ for (uint i = 0; i < count; i++) {
if (!dst[i]) {
dst[i] = Common::SharedPtr<gMaterial>(new gMaterial());
}
diff --git a/engines/watchmaker/3d/material.h b/engines/watchmaker/3d/material.h
index 51ade968fda..dc27dab0035 100644
--- a/engines/watchmaker/3d/material.h
+++ b/engines/watchmaker/3d/material.h
@@ -89,7 +89,7 @@ MaterialPtr rAddMaterial(MaterialTable &MList, const Common::String &TextName, i
MaterialPtr rAddMaterial(gMaterial &Material, const Common::String &TextName, int NumFaces, unsigned int LoaderFlags);
void rRemoveMaterial(MaterialPtr &m);
void rRemoveMaterials(MaterialTable &m);
-void rCopyMaterialList(MaterialTable &dst, MaterialTable &src, int count);
+void rCopyMaterialList(MaterialTable &dst, MaterialTable &src, uint count);
MaterialPtr rMergeMaterial(MaterialPtr Mat1, MaterialPtr Mat2);
void rAddToMaterialList(gMaterial &mat, signed short int ViewMatrixNum);
diff --git a/engines/watchmaker/3d/movie.cpp b/engines/watchmaker/3d/movie.cpp
index b551a495601..eb74e534498 100644
--- a/engines/watchmaker/3d/movie.cpp
+++ b/engines/watchmaker/3d/movie.cpp
@@ -76,21 +76,21 @@ Common::SharedPtr<gMovie> gLoadMovie(WorkDirs &workDirs, const char *TextName, T
return Movie;
}
-void gMovie::loadThisFrameData(uint32 frame) {
+void gMovie::loadThisFrameData(uint16 frame) {
_stream->seek(_frameOffsets[frame], SEEK_SET);
//read frame data
- int size = 0;
+ int32 size = 0;
if ((frame + 1) == _numFrames) {
size = _stream->size() - _frameOffsets[frame];
} else {
size = _frameOffsets[frame + 1] - _frameOffsets[frame];
}
- assert(size <= bufferSize());
+ assert(size <= (int32)bufferSize());
_stream->read(_buffer, size);
}
//build a new frame by difference from previous
-void gMovie::buildNewFrame(byte *surf, uint32 frame) {
+void gMovie::buildNewFrame(byte *surf, uint16 frame) {
loadThisFrameData(frame);
DWORD bitArraySize = _numBlocks >> 3;
@@ -109,11 +109,11 @@ void gMovie::buildNewFrame(byte *surf, uint32 frame) {
memcpy(&surf[curBlock << 3], buf, 8);
buf += 8;
}
- }//for j
- }//for
+ }
+ }
}
-bool gMovie::setFrame(uint32 newFrame) {
+bool gMovie::setFrame(uint16 newFrame) {
warning("Set Frame: %d\t%s", newFrame, _name.c_str());
if (_curFrame == newFrame)
return true;
@@ -138,15 +138,15 @@ bool gMovie::setFrame(uint32 newFrame) {
memcpy(_surfaceBuffer, _buffer, _header.dataSize());
} else {
if ((_curFrame + 1) != newFrame) { //we can't directly build this frame because the current frame is not his previous
- WORD startFrame;
- WORD prevKey = (newFrame / _keyFrame) * _keyFrame;
+ uint16 startFrame;
+ uint16 prevKey = (newFrame / _keyFrame) * _keyFrame;
if ((_curFrame > newFrame) || (_curFrame < prevKey)) {
loadThisFrameData(prevKey);
memcpy(_surfaceBuffer, _buffer, _header.dataSize());
startFrame = prevKey + 1;
} else startFrame = _curFrame + 1;
- for (WORD i = startFrame; i < newFrame; i++) {
+ for (uint16 i = startFrame; i < newFrame; i++) {
buildNewFrame(_surfaceBuffer, i);
}
}
diff --git a/engines/watchmaker/3d/movie.h b/engines/watchmaker/3d/movie.h
index 6cfa378d902..2661035bbb8 100644
--- a/engines/watchmaker/3d/movie.h
+++ b/engines/watchmaker/3d/movie.h
@@ -56,9 +56,9 @@ public:
gMovie(Common::SharedPtr<Common::SeekableReadStream> stream, Texture *texture, const Common::String &name);
- bool setFrame(uint32 newFrame);
- void loadThisFrameData(uint32 frame);
- void buildNewFrame(byte *surf, uint32 frame);
+ bool setFrame(uint16 newFrame);
+ void loadThisFrameData(uint16 frame);
+ void buildNewFrame(byte *surf, uint16 frame);
bool updateMovie();
~gMovie() {
diff --git a/engines/watchmaker/3d/render/opengl_3d.cpp b/engines/watchmaker/3d/render/opengl_3d.cpp
index 47b2f075a41..2f9f38c4fb3 100644
--- a/engines/watchmaker/3d/render/opengl_3d.cpp
+++ b/engines/watchmaker/3d/render/opengl_3d.cpp
@@ -44,22 +44,6 @@
namespace Watchmaker {
-// temp pixel format conversion info
-struct {
- float RedScale;
- float GreenScale;
- float BlueScale;
- float AlphaScale;
- unsigned int RedShift;
- unsigned int GreenShift;
- unsigned int BlueShift;
- unsigned int AlphaShift;
- unsigned int RedMask;
- unsigned int GreenMask;
- unsigned int BlueMask;
- unsigned int AlphaMask;
-} gTexturePixelConversion;
-
#define T3D_FASTFILE (1<<23) // fastfile
// Tecture formats
@@ -601,10 +585,10 @@ gTexture *gLoadTexture(WorkDirs &workDirs, const char *TextName, unsigned int Lo
//uint32 magic,retv;
unsigned long dwWidth = 0, dwHeight = 0;
//DDSURFACEDESC2 DDSurfDesc;
- Graphics::Surface *lpSSource = nullptr;
+ //Graphics::Surface *lpSSource = nullptr;
if (!TextName) return nullptr;
- lpSSource = nullptr;
+ //lpSSource = nullptr;
//warning("gLoadTexture(%s)", TextName);
// Check if already loaded
@@ -670,7 +654,7 @@ gTexture *gLoadTexture(WorkDirs &workDirs, const char *TextName, unsigned int Lo
texture->_texture->assignData(*ddsTextureData);
dwWidth = ddsTextureData->getWidth();
dwHeight = ddsTextureData->getHeight();
- lpSSource = nullptr;
+ //lpSSource = nullptr;
#if 0
if (gRenderFlags & gDXT1SUPPORTED) {
/* if( gRenderFlags & gAGPSUPPORTED )
@@ -829,8 +813,7 @@ gTexture *gLoadTexture(WorkDirs &workDirs, const char *TextName, unsigned int Lo
}
-bool Renderer::addMaterial(gMaterial &material, const Common::String &name, int NumFaces, unsigned int LoaderFlags) {
- bool AlreadyLoaded = FALSE;
+bool Renderer::addMaterial(gMaterial &material, const Common::String &name, int NumFaces, unsigned int _LoaderFlags) {
//warning("AddMaterial(%s)", name.c_str());
if (hasFileExtension(name, "avi")) {
auto tex = createGLTexture();
@@ -842,7 +825,7 @@ bool Renderer::addMaterial(gMaterial &material, const Common::String &name, int
return false;
material.addProperty(T3D_MATERIAL_MOVIE);
} else {
- if ((material.Texture = gLoadTexture(*_workDirs, name.c_str(), LoaderFlags)) == nullptr)
+ if ((material.Texture = gLoadTexture(*_workDirs, name.c_str(), _LoaderFlags)) == nullptr)
return false;
}
diff --git a/engines/watchmaker/3d/render/opengl_renderer.cpp b/engines/watchmaker/3d/render/opengl_renderer.cpp
index 8eaa5aaa5ba..fc8819f8e74 100644
--- a/engines/watchmaker/3d/render/opengl_renderer.cpp
+++ b/engines/watchmaker/3d/render/opengl_renderer.cpp
@@ -166,18 +166,25 @@ void setGlFeature(GLint feature, bool state) {
void OpenGLRenderer::setRenderState(RenderState state, int value) {
switch (state) {
- case RenderState::ZENABLE: {
+ case RenderState::ZENABLE:
glDepthFunc(GL_LEQUAL);
setGlFeature(GL_DEPTH_TEST, value);
break;
- }
- case RenderState::ALPHAREF: { // ALPHA-func is never changed.
+ case RenderState::ALPHAREF: // ALPHA-func is never changed.
glAlphaFunc(GL_ALWAYS, value);
- }
+ // fall through
+ // FIXME: Is this intended?
case RenderState::ALPHABLEND:
setGlFeature(GL_BLEND, value);
break; // TODO
+ case RenderState::LIGHT:
+ case RenderState::CLIP:
+ case RenderState::EXTENT:
+ case RenderState::ZWRITE_ENABLE:
+ case RenderState::TEXTUREFACTOR:
+ default:
+ break;
}
//warning("TODO: Implement setRenderState");
}
diff --git a/engines/watchmaker/3d/render/opengl_texture.cpp b/engines/watchmaker/3d/render/opengl_texture.cpp
index d30ff3d7f27..c99760c64d0 100644
--- a/engines/watchmaker/3d/render/opengl_texture.cpp
+++ b/engines/watchmaker/3d/render/opengl_texture.cpp
@@ -32,6 +32,7 @@ namespace Watchmaker {
GLuint dxtCompressionToTextureFormat(DxtCompression compression) {
switch (compression) {
case DxtCompression::UNCOMPRESSED:
+ default:
return GL_RGBA;
case DxtCompression::DXT1:
return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
diff --git a/engines/watchmaker/3d/t3d_body.cpp b/engines/watchmaker/3d/t3d_body.cpp
index 052668e0741..26af7c987b8 100644
--- a/engines/watchmaker/3d/t3d_body.cpp
+++ b/engines/watchmaker/3d/t3d_body.cpp
@@ -481,8 +481,8 @@ void LoadLightmaps(WGame &game, t3dBODY *b) {
/* -----------------10/06/99 16.04-------------------
* t3dLoadSingleRoom
* --------------------------------------------------*/
-t3dBODY *t3dBODY::loadFromStream(WGame &game, const Common::String &pname, Common::SeekableReadStream &stream, uint32 LoaderFlags) {
- //decodeLoaderFlags(LoaderFlags);
+t3dBODY *t3dBODY::loadFromStream(WGame &game, const Common::String &pname, Common::SeekableReadStream &stream, uint32 _LoaderFlags) {
+ //decodeLoaderFlags(_LoaderFlags);
//char /*t3dU8*/ Name[255];
uint16 light;
@@ -492,7 +492,7 @@ t3dBODY *t3dBODY::loadFromStream(WGame &game, const Common::String &pname, Commo
WorkDirs &workdirs = game.workDirs;
this->name = pname;
- auto name = constructPath(workdirs._t3dDir, pname);
+ auto _name = constructPath(workdirs._t3dDir, pname);
this->NumTotVerts = 0;
@@ -547,9 +547,9 @@ t3dBODY *t3dBODY::loadFromStream(WGame &game, const Common::String &pname, Commo
populatePortalLists();
- warning("LoaderFlags late = %08X", LoaderFlags);
- //decodeLoaderFlags(LoaderFlags);
- if (!(LoaderFlags & T3D_NOBOUNDS)) { // Carica Bounds
+ warning("LoaderFlags late = %08X", _LoaderFlags);
+ //decodeLoaderFlags(_LoaderFlags);
+ if (!(_LoaderFlags & T3D_NOBOUNDS)) { // Carica Bounds
auto bndName = workdirs.join(workdirs._bndDir, pname, "bnd");
/*
strcpy(Name, workdirs._bndDir.c_str());
@@ -561,23 +561,23 @@ t3dBODY *t3dBODY::loadFromStream(WGame &game, const Common::String &pname, Commo
*/
LoadBounds(game.workDirs, bndName.c_str(), this);
}
- if (!(LoaderFlags & T3D_NOCAMERAS)) { // Carica Camere
+ if (!(_LoaderFlags & T3D_NOCAMERAS)) { // Carica Camere
auto cameraName = constructPath(workdirs._camDir, pname, "cam");
LoadCameras(game.workDirs, cameraName.c_str(), this);
}
- if (!(LoaderFlags & T3D_NOLIGHTMAPS)) { // Carica le Lightmaps
+ if (!(_LoaderFlags & T3D_NOLIGHTMAPS)) { // Carica le Lightmaps
// TODO: This looks odd
if (!pname.equalsIgnoreCase("rxt.t3d") || !pname.equalsIgnoreCase("rxt-b.t3d") || !pname.equalsIgnoreCase("rxt-c.t3d") ||
!pname.equalsIgnoreCase("rxt-d.t3d") || !pname.equalsIgnoreCase("rxt-e.t3d") || !pname.equalsIgnoreCase("rxt.t3d-f"))
LoadLightmaps(game, this);
}
- if ((LoaderFlags & T3D_OUTDOORLIGHTS)) { // Carica le luci per l'esterno
+ if ((_LoaderFlags & T3D_OUTDOORLIGHTS)) { // Carica le luci per l'esterno
if (pname.equalsIgnoreCase("rxt.t3d")) {
auto outdoorLightsPath = constructPath(workdirs._lightmapsDir, pname);
t3dLoadOutdoorLights(outdoorLightsPath.c_str(), this, t3dCurTime);
}
}
- if (!(LoaderFlags & T3D_NOVOLUMETRICLIGHTS)) { // Carica le luci volumetriche
+ if (!(_LoaderFlags & T3D_NOVOLUMETRICLIGHTS)) { // Carica le luci volumetriche
auto volMapPath = constructPath(workdirs._lightmapsDir, pname, "vol");
LoadVolumetricMap(workdirs, volMapPath.c_str(), this);
}
diff --git a/engines/watchmaker/3d/t3d_mesh.cpp b/engines/watchmaker/3d/t3d_mesh.cpp
index c0217cc439f..e175f21e6b7 100644
--- a/engines/watchmaker/3d/t3d_mesh.cpp
+++ b/engines/watchmaker/3d/t3d_mesh.cpp
@@ -181,7 +181,7 @@ t3dMESH::t3dMESH(t3dBODY *b, Common::SeekableReadStream &stream, t3dMESH *&Recei
this->VertsInterpolants = t3dCalloc<t3dV3F>(this->NumVerts); // Crea spazio per interpolanti
this->ModVertices.reserve(numAniVerts);
- for (int i = 0; i < numAniVerts; i++) {
+ for (uint32 i = 0; i < numAniVerts; i++) {
this->ModVertices.push_back(t3dMODVERTS(stream));
}
}
diff --git a/engines/watchmaker/classes/do_action.cpp b/engines/watchmaker/classes/do_action.cpp
index b2247700f1c..fc5d9beb3a3 100644
--- a/engines/watchmaker/classes/do_action.cpp
+++ b/engines/watchmaker/classes/do_action.cpp
@@ -81,7 +81,7 @@ void doDoor(WGame &game, int32 obj) {
* --------------------------------------------------*/
void doTake(WGame &game, int32 obj) {
int32 anim = aNULL;
- uint8 del = TRUE;
+ //uint8 del = TRUE;
if (!obj) return;
@@ -93,7 +93,7 @@ void doTake(WGame &game, int32 obj) {
break;
default:
- del = TRUE;
+ //del = TRUE;
break;
}
More information about the Scummvm-git-logs
mailing list