From 59a08ce0df35d14d9bc5d23a95964fc9bff99dc4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 14 Apr 2018 12:24:04 +0200 Subject: [PATCH] - fixed a few warnings and changed the return type of FGLTexture::Bind, because no caller needs the hardware texture. --- src/gl/textures/gl_material.cpp | 11 +++++------ src/gl/textures/gl_material.h | 2 +- src/hwrenderer/data/flatvertices.cpp | 12 ++++++------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/gl/textures/gl_material.cpp b/src/gl/textures/gl_material.cpp index 99a6f133a..ed1c86e46 100644 --- a/src/gl/textures/gl_material.cpp +++ b/src/gl/textures/gl_material.cpp @@ -157,7 +157,7 @@ FHardwareTexture *FGLTexture::CreateHwTexture() // //=========================================================================== -const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int translation, int flags) +bool FGLTexture::Bind(int texunit, int clampmode, int translation, int flags) { int usebright = false; @@ -216,7 +216,7 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla { // could not create texture delete[] buffer; - return NULL; + return false; } delete[] buffer; } @@ -225,9 +225,9 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla if (lastSampler != clampmode) lastSampler = GLRenderer->mSamplerManager->Bind(texunit, clampmode, lastSampler); lastTranslation = translation; - return hwtex; + return true; } - return NULL; + return false; } //=========================================================================== @@ -636,8 +636,7 @@ void FMaterial::Bind(int clampmode, int translation) // Textures that are already scaled in the texture lump will not get replaced by hires textures. int flags = mExpanded? CTF_Expand : (gl_texture_usehires && tex->Scale.X == 1 && tex->Scale.Y == 1 && clampmode <= CLAMP_XY)? CTF_CheckHires : 0; - const FHardwareTexture *gltexture = mBaseLayer->Bind(0, clampmode, translation, flags); - if (gltexture != NULL) + if (mBaseLayer->Bind(0, clampmode, translation, flags)) { for(unsigned i=0;ifX(); - y = vt->fY(); - z = plane.ZatPoint(vt); - u = vt->fX()/64.f; - v = -vt->fY()/64.f; + x = (float)vt->fX(); + y = (float)vt->fY(); + z = (float)plane.ZatPoint(vt); + u = (float)vt->fX()/64.f; + v = -(float)vt->fY()/64.f; } //========================================================================== @@ -243,7 +243,7 @@ void FFlatVertexGenerator::UpdatePlaneVertices(sector_t *sec, int plane, FFlatVe FFlatVertex *mapvt = &map[startvt]; for(int i=0; iz = splane.ZatPoint(vt->x, vt->y); + vt->z = (float)splane.ZatPoint(vt->x, vt->y); if (plane == sector_t::floor && sec->transdoor) vt->z -= 1; mapvt->z = vt->z; }