HPL1: Fix warnings

This commit is contained in:
Eugene Sandulenko 2022-08-06 21:06:22 +02:00
parent 5c90f1612f
commit 28746360b6
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
6 changed files with 15 additions and 12 deletions

View File

@ -28,6 +28,7 @@
#include "hpl1/engine/resources/low_level_resources.h" #include "hpl1/engine/resources/low_level_resources.h"
#include "hpl1/engine/impl/LowLevelSoundOpenAL.h" #include "hpl1/engine/impl/LowLevelSoundOpenAL.h"
#include "hpl1/engine/impl/MouseSDL.h" #include "hpl1/engine/impl/MouseSDL.h"
#include "hpl1/engine/haptic/LowLevelHaptic.h"
namespace hpl { namespace hpl {

View File

@ -377,7 +377,7 @@ void cGuiSet::DrawFont(const tWString &asText,
const cVector2f &avSize, const cColor &aColor, const cVector2f &avSize, const cColor &aColor,
eFontAlign aAlign, eGuiMaterial aMaterial) { eFontAlign aAlign, eGuiMaterial aMaterial) {
int lCount = 0; int lCount = 0;
float lXAdd = 0; //float lXAdd = 0;
cVector3f vPos = avPos; cVector3f vPos = avPos;
if (aAlign == eFontAlign_Center) { if (aAlign == eFontAlign_Center) {
@ -586,7 +586,7 @@ void cGuiSet::DestroyWidget(iWidget *apWidget) {
void cGuiSet::CreatePopUpMessageBox(const tWString &asLabel, const tWString &asText, void cGuiSet::CreatePopUpMessageBox(const tWString &asLabel, const tWString &asText,
const tWString &asButton1, const tWString &asButton2, const tWString &asButton1, const tWString &asButton2,
void *apCallbackObject, tGuiCallbackFunc apCallback) { void *apCallbackObject, tGuiCallbackFunc apCallback) {
cGuiPopUpMessageBox *pMessageBox = hplNew(cGuiPopUpMessageBox, (this, asLabel, asText, /* cGuiPopUpMessageBox *pMessageBox = */(void)hplNew(cGuiPopUpMessageBox, (this, asLabel, asText,
asButton1, asButton2, asButton1, asButton2,
apCallbackObject, apCallback)); apCallbackObject, apCallback));
} }
@ -835,7 +835,7 @@ void cGuiSet::RenderClipRegion() {
// Iterate for all with same texture and material // Iterate for all with same texture and material
do { do {
cGuiRenderObject object = *it; cGuiRenderObject object = *it;
cGuiGfxElement *pGfx = object.mpGfx; pGfx = object.mpGfx;
if (kLogRender) { if (kLogRender) {
if (pGfx->mvImages[0]) if (pGfx->mvImages[0])

View File

@ -62,8 +62,7 @@ cCollideShapeNewton::cCollideShapeNewton(eCollideShapeType aType, const cVector3
//////////////////////////////////////////// ////////////////////////////////////////////
// Create Newton collision // Create Newton collision
switch(aType) switch(aType) {
{
case eCollideShapeType_Null: mpNewtonCollision = NewtonCreateNull(apNewtonWorld); break; case eCollideShapeType_Null: mpNewtonCollision = NewtonCreateNull(apNewtonWorld); break;
case eCollideShapeType_Box: mpNewtonCollision = NewtonCreateBox(apNewtonWorld, case eCollideShapeType_Box: mpNewtonCollision = NewtonCreateBox(apNewtonWorld,
@ -81,6 +80,8 @@ cCollideShapeNewton::cCollideShapeNewton(eCollideShapeType aType, const cVector3
case eCollideShapeType_Capsule: mpNewtonCollision = NewtonCreateCapsule(apNewtonWorld, case eCollideShapeType_Capsule: mpNewtonCollision = NewtonCreateCapsule(apNewtonWorld,
mvSize.x, mvSize.y, mvSize.x, mvSize.y,
0, pMtx); break; 0, pMtx); break;
default:
break;
} }
//////////////////////////////////////////// ////////////////////////////////////////////

View File

@ -63,6 +63,7 @@ GLenum ColorFormatToGL(eColorDataFormat format) {
break; break;
} }
Hpl1::logError(Hpl1::kDebugOpenGL, "invalid color format (%d)", format); Hpl1::logError(Hpl1::kDebugOpenGL, "invalid color format (%d)", format);
return GL_RGB;
} }
GLenum TextureTargetToGL(eTextureTarget target) { GLenum TextureTargetToGL(eTextureTarget target) {
@ -81,6 +82,7 @@ GLenum TextureTargetToGL(eTextureTarget target) {
break; break;
} }
Hpl1::logError(Hpl1::kDebugOpenGL, "invalid texture target (%d)", target); Hpl1::logError(Hpl1::kDebugOpenGL, "invalid texture target (%d)", target);
return GL_TEXTURE_1D;
} }
cLowLevelGraphicsSDL::cLowLevelGraphicsSDL() { cLowLevelGraphicsSDL::cLowLevelGraphicsSDL() {
@ -863,7 +865,7 @@ void cLowLevelGraphicsSDL::SetStencilTwoSide(eStencilFunc aFrontFunc, eStencilFu
void cLowLevelGraphicsSDL::SetStencilTwoSide(bool abX) { void cLowLevelGraphicsSDL::SetStencilTwoSide(bool abX) {
if (GetCaps(eGraphicCaps_TwoSideStencil)) if (GetCaps(eGraphicCaps_TwoSideStencil))
Hpl1::logError(Hpl1::kDebugOpenGL, "call to setStencilTwoSide with two side stencil enabled"); Hpl1::logError(Hpl1::kDebugOpenGL, "call to setStencilTwoSide with two side stencil enabled%c", ".");
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------

View File

@ -245,7 +245,7 @@ private:
int mlBpp; int mlBpp;
// Gamma // Gamma
uint16 mvStartGammaArray[3][256]; //uint16 mvStartGammaArray[3][256];
float mfGammaCorrection; float mfGammaCorrection;
// Clipping // Clipping

View File

@ -1711,8 +1711,8 @@ void cMeshLoaderCollada::AddSceneObjects(cColladaNode *apNode, cWorld3D *apWorld
// If no entity was loaded, try old style. // If no entity was loaded, try old style.
if (pEntity == NULL) { if (pEntity == NULL) {
tString sName = vParams[1]; sName = vParams[1];
tString sFile = cString::Sub(apNode->msName, 5 + (int)+sName.size() + 1); sFile = cString::Sub(apNode->msName, 5 + (int)+sName.size() + 1);
sFile = cString::SetFileExt(sFile, "ent"); sFile = cString::SetFileExt(sFile, "ent");
apWorld->CreateEntity(sName, apNode->m_mtxWorldTransform, sFile, true); apWorld->CreateEntity(sName, apNode->m_mtxWorldTransform, sFile, true);
@ -1827,7 +1827,7 @@ void cMeshLoaderCollada::AddSceneObjects(cColladaNode *apNode, cWorld3D *apWorld
Error("Too few params in billboard entity entity '%s'\n", apNode->msName.c_str()); Error("Too few params in billboard entity entity '%s'\n", apNode->msName.c_str());
} else { } else {
tString sName = vParams[vParams.size() - 1]; tString sName = vParams[vParams.size() - 1];
tString sType = ""; sType = "";
for (size_t i = 1; i < vParams.size() - 1; ++i) { for (size_t i = 1; i < vParams.size() - 1; ++i) {
sType += vParams[i]; sType += vParams[i];
if (i != vParams.size() - 2) if (i != vParams.size() - 2)
@ -1840,7 +1840,7 @@ void cMeshLoaderCollada::AddSceneObjects(cColladaNode *apNode, cWorld3D *apWorld
if (pPS == NULL) { if (pPS == NULL) {
sName = vParams[1]; sName = vParams[1];
sType = cString::Sub(apNode->msName, 4 + (int)sName.size() + 1); sType = cString::Sub(apNode->msName, 4 + (int)sName.size() + 1);
cParticleSystem3D *pPS = apWorld->CreateParticleSystem(sName, sType, apNode->mvScale, pPS = apWorld->CreateParticleSystem(sName, sType, apNode->mvScale,
apNode->m_mtxWorldTransform); apNode->m_mtxWorldTransform);
if (pPS == NULL) { if (pPS == NULL) {
@ -1872,7 +1872,6 @@ void cMeshLoaderCollada::AddSceneObjects(cColladaNode *apNode, cWorld3D *apWorld
TempBV.AddArrayPoints(&vVertexVec[0], (int)vArray.size()); TempBV.AddArrayPoints(&vVertexVec[0], (int)vArray.size());
TempBV.CreateFromPoints(3); TempBV.CreateFromPoints(3);
tString sType;
tString sName; tString sName;
if (vParams.size() < 3 || (mFlags & eWorldLoadFlag_NoGameEntities)) { if (vParams.size() < 3 || (mFlags & eWorldLoadFlag_NoGameEntities)) {
sType = ""; sType = "";