mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-21 11:31:41 +00:00
- fixed a few warnings and changed the return type of FGLTexture::Bind, because no caller needs the hardware texture.
This commit is contained in:
parent
0affc119fd
commit
59a08ce0df
3 changed files with 12 additions and 13 deletions
|
@ -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;
|
int usebright = false;
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla
|
||||||
{
|
{
|
||||||
// could not create texture
|
// could not create texture
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
return NULL;
|
return false;
|
||||||
}
|
}
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
}
|
}
|
||||||
|
@ -225,9 +225,9 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla
|
||||||
if (lastSampler != clampmode)
|
if (lastSampler != clampmode)
|
||||||
lastSampler = GLRenderer->mSamplerManager->Bind(texunit, clampmode, lastSampler);
|
lastSampler = GLRenderer->mSamplerManager->Bind(texunit, clampmode, lastSampler);
|
||||||
lastTranslation = translation;
|
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.
|
// 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;
|
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 (mBaseLayer->Bind(0, clampmode, translation, flags))
|
||||||
if (gltexture != NULL)
|
|
||||||
{
|
{
|
||||||
for(unsigned i=0;i<mTextureLayers.Size();i++)
|
for(unsigned i=0;i<mTextureLayers.Size();i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,7 +64,7 @@ private:
|
||||||
|
|
||||||
FHardwareTexture *CreateHwTexture();
|
FHardwareTexture *CreateHwTexture();
|
||||||
|
|
||||||
const FHardwareTexture *Bind(int texunit, int clamp, int translation, int flags);
|
bool Bind(int texunit, int clamp, int translation, int flags);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FGLTexture(FTexture * tx, bool expandpatches);
|
FGLTexture(FTexture * tx, bool expandpatches);
|
||||||
|
|
|
@ -90,11 +90,11 @@ void FFlatVertexGenerator::OutputResized(int width, int height)
|
||||||
|
|
||||||
void FFlatVertex::SetFlatVertex(vertex_t *vt, const secplane_t & plane)
|
void FFlatVertex::SetFlatVertex(vertex_t *vt, const secplane_t & plane)
|
||||||
{
|
{
|
||||||
x = vt->fX();
|
x = (float)vt->fX();
|
||||||
y = vt->fY();
|
y = (float)vt->fY();
|
||||||
z = plane.ZatPoint(vt);
|
z = (float)plane.ZatPoint(vt);
|
||||||
u = vt->fX()/64.f;
|
u = (float)vt->fX()/64.f;
|
||||||
v = -vt->fY()/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];
|
FFlatVertex *mapvt = &map[startvt];
|
||||||
for(int i=0; i<countvt; i++, vt++, mapvt++)
|
for(int i=0; i<countvt; i++, vt++, mapvt++)
|
||||||
{
|
{
|
||||||
vt->z = 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;
|
if (plane == sector_t::floor && sec->transdoor) vt->z -= 1;
|
||||||
mapvt->z = vt->z;
|
mapvt->z = vt->z;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue