mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- hotfix for texture filter settings.
This needs to be done differently later to choose the proper clamp setting.
This commit is contained in:
parent
1fee7a5f01
commit
c428e367a0
3 changed files with 9 additions and 4 deletions
|
@ -34,10 +34,7 @@ static pthtyp *texcache_tryart(int32_t const dapicnum, int32_t const dapalnum, i
|
|||
|
||||
// load from art
|
||||
for (pth=texcache.list[j]; pth; pth=pth->next)
|
||||
if (pth->picnum == dapicnum &&
|
||||
(pth->flags & PTH_INDEXED) &&
|
||||
(pth->flags & (PTH_HIGHTILE)) == 0 &&
|
||||
polymost_want_npotytex(dameth, tilesiz[dapicnum].y) == !!(pth->flags & PTH_NPOTWALL))
|
||||
if (pth->picnum == dapicnum && ((pth->flags & (PTH_INDEXED|PTH_HIGHTILE)) == PTH_INDEXED))
|
||||
{
|
||||
if (pth->flags & PTH_INVALIDATED)
|
||||
{
|
||||
|
|
|
@ -33,6 +33,7 @@ public:
|
|||
unsigned int GetTextureHandle();
|
||||
int GetSampler() { return mSampler; }
|
||||
void SetSampler(int sampler) { mSampler = sampler; }
|
||||
bool isIndexed() const { return glTextureBytes == 1; }
|
||||
|
||||
friend class FGameTexture;
|
||||
};
|
||||
|
|
|
@ -209,14 +209,21 @@ FHardwareTexture* GLInstance::NewTexture()
|
|||
return new FHardwareTexture;
|
||||
}
|
||||
|
||||
FHardwareTexture* texv;
|
||||
|
||||
void GLInstance::BindTexture(int texunit, FHardwareTexture *tex, int sampler)
|
||||
{
|
||||
if (!tex) return;
|
||||
if (texunit != 0) glActiveTexture(GL_TEXTURE0 + texunit);
|
||||
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);
|
||||
if (texunit != 0) glActiveTexture(GL_TEXTURE0);
|
||||
LastBoundTextures[texunit] = tex->GetTextureHandle();
|
||||
texv = tex;
|
||||
}
|
||||
|
||||
void GLInstance::UnbindTexture(int texunit)
|
||||
|
|
Loading…
Reference in a new issue