From 362be65060f5aa5d8c51137cf92593250b90e12a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 28 May 2020 21:45:33 +0200 Subject: [PATCH] - removed FHardwareTexture's mSampler member. This was a mostly unused relic of early development, the few places using it were static sampler settings. --- source/build/src/voxmodel.cpp | 1 - source/glbackend/gl_hwtexture.h | 3 --- source/glbackend/gl_palmanager.cpp | 6 ++---- source/glbackend/glbackend.h | 4 ++-- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/source/build/src/voxmodel.cpp b/source/build/src/voxmodel.cpp index 8cdced01f..6221ba0cb 100644 --- a/source/build/src/voxmodel.cpp +++ b/source/build/src/voxmodel.cpp @@ -67,7 +67,6 @@ static FHardwareTexture *gloadtex(const int32_t *picbuf, int32_t xsiz, int32_t y auto tex = GLInterface.NewTexture(); tex->CreateTexture(xsiz, ysiz, FHardwareTexture::TrueColor, false); tex->LoadTexture((uint8_t*)pic2); - tex->SetSampler(SamplerNoFilterClampXY); Xfree(pic2); return tex; diff --git a/source/glbackend/gl_hwtexture.h b/source/glbackend/gl_hwtexture.h index 4abb812c5..b2cb6051e 100644 --- a/source/glbackend/gl_hwtexture.h +++ b/source/glbackend/gl_hwtexture.h @@ -18,7 +18,6 @@ public: private: - int mSampler = 0; unsigned int glTexID = 0; unsigned int glDepthID = 0; // only used by camera textures unsigned int glBufferID = 0; @@ -47,8 +46,6 @@ public: unsigned int LoadTexturePart(const unsigned char* buffer, int x, int y, int w, int h); unsigned int LoadTexture(FBitmap &bmp); unsigned int GetTextureHandle(); - int GetSampler() { return mSampler; } - void SetSampler(int sampler) { mSampler = sampler; } bool isIndexed() const { return internalType == Indexed; } void BindToFrameBuffer(int w, int h); diff --git a/source/glbackend/gl_palmanager.cpp b/source/glbackend/gl_palmanager.cpp index a37f56499..d4115174d 100644 --- a/source/glbackend/gl_palmanager.cpp +++ b/source/glbackend/gl_palmanager.cpp @@ -103,10 +103,9 @@ void PaletteManager::BindPalette(int index) auto p = GLInterface.NewTexture(); p->CreateTexture(256, 1, FHardwareTexture::TrueColor, false); p->LoadTexture((uint8_t*)palettedata->Palette); - p->SetSampler(SamplerNoFilterClampXY); palettetextures[index] = p; } - inst->BindTexture(2, palettetextures[index]); + inst->BindTexture(2, palettetextures[index], SamplerNoFilterClampXY); } } @@ -141,10 +140,9 @@ void PaletteManager::BindPalswap(int index) p[0] = 0; } p->LoadTexture(lookup.Data()); - p->SetSampler(SamplerNoFilterClampXY); palswaptextures[index] = p; } - inst->BindTexture(1, palswaptextures[index]); + inst->BindTexture(1, palswaptextures[index], SamplerNoFilterClampXY); inst->SetFadeColor(lookups.getFade(index)); } } diff --git a/source/glbackend/glbackend.h b/source/glbackend/glbackend.h index cb462d9c8..05be4e1da 100644 --- a/source/glbackend/glbackend.h +++ b/source/glbackend/glbackend.h @@ -350,7 +350,7 @@ public: SetColor(r * (1 / 255.f), g * (1 / 255.f), b * (1 / 255.f), a * (1 / 255.f)); } - void BindTexture(int texunit, FHardwareTexture* tex, int sampler = NoSampler) + void BindTexture(int texunit, FHardwareTexture* tex, int sampler) { if (!tex) return; if (texunit == 0) @@ -359,7 +359,7 @@ public: else renderState.Flags &= ~RF_UsePalette; } renderState.texIds[texunit] = tex->GetTextureHandle(); - renderState.samplerIds[texunit] = sampler == NoSampler ? tex->GetSampler() : sampler; + renderState.samplerIds[texunit] = sampler; } void UnbindTexture(int texunit)