- hotfix for texture filter settings.

This needs to be done differently later to choose the proper clamp setting.
This commit is contained in:
Christoph Oelckers 2019-10-10 19:16:27 +02:00
parent 1fee7a5f01
commit c428e367a0
3 changed files with 9 additions and 4 deletions

View file

@ -34,10 +34,7 @@ static pthtyp *texcache_tryart(int32_t const dapicnum, int32_t const dapalnum, i
// load from art // load from art
for (pth=texcache.list[j]; pth; pth=pth->next) for (pth=texcache.list[j]; pth; pth=pth->next)
if (pth->picnum == dapicnum && if (pth->picnum == dapicnum && ((pth->flags & (PTH_INDEXED|PTH_HIGHTILE)) == PTH_INDEXED))
(pth->flags & PTH_INDEXED) &&
(pth->flags & (PTH_HIGHTILE)) == 0 &&
polymost_want_npotytex(dameth, tilesiz[dapicnum].y) == !!(pth->flags & PTH_NPOTWALL))
{ {
if (pth->flags & PTH_INVALIDATED) if (pth->flags & PTH_INVALIDATED)
{ {

View file

@ -33,6 +33,7 @@ public:
unsigned int GetTextureHandle(); unsigned int GetTextureHandle();
int GetSampler() { return mSampler; } int GetSampler() { return mSampler; }
void SetSampler(int sampler) { mSampler = sampler; } void SetSampler(int sampler) { mSampler = sampler; }
bool isIndexed() const { return glTextureBytes == 1; }
friend class FGameTexture; friend class FGameTexture;
}; };

View file

@ -209,14 +209,21 @@ FHardwareTexture* GLInstance::NewTexture()
return new FHardwareTexture; return new FHardwareTexture;
} }
FHardwareTexture* texv;
void GLInstance::BindTexture(int texunit, FHardwareTexture *tex, int sampler) void GLInstance::BindTexture(int texunit, FHardwareTexture *tex, int sampler)
{ {
if (!tex) return; if (!tex) return;
if (texunit != 0) glActiveTexture(GL_TEXTURE0 + texunit); if (texunit != 0) glActiveTexture(GL_TEXTURE0 + texunit);
glBindTexture(GL_TEXTURE_2D, tex->GetTextureHandle()); glBindTexture(GL_TEXTURE_2D, tex->GetTextureHandle());
if (tex->isIndexed() && sampler > NoSampler && sampler < Sampler2D)
{
sampler = sampler == SamplerRepeat ? SamplerNoFilter : Sampler2DNoFilter;
}
mSamplers->Bind(texunit, sampler == NoSampler? tex->GetSampler() : sampler, 0); mSamplers->Bind(texunit, sampler == NoSampler? tex->GetSampler() : sampler, 0);
if (texunit != 0) glActiveTexture(GL_TEXTURE0); if (texunit != 0) glActiveTexture(GL_TEXTURE0);
LastBoundTextures[texunit] = tex->GetTextureHandle(); LastBoundTextures[texunit] = tex->GetTextureHandle();
texv = tex;
} }
void GLInstance::UnbindTexture(int texunit) void GLInstance::UnbindTexture(int texunit)