mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 20:20:40 +00:00
- simplified the texture sampler setup.
DAMETH_CLAMPED was redundant and only causig problems.
This commit is contained in:
parent
1b12c08c66
commit
7638ead1c8
6 changed files with 8 additions and 9 deletions
|
@ -1730,7 +1730,7 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr)
|
|||
}
|
||||
#endif
|
||||
int palid = TRANSLATION(Translation_Remap + curbasepal, globalpal);
|
||||
GLInterface.SetTexture(-1, tex, palid, 0, CLAMP_XY);
|
||||
GLInterface.SetTexture(-1, tex, palid, CLAMP_XY);
|
||||
|
||||
if (tspr->clipdist & TSPR_FLAGS_MDHACK)
|
||||
{
|
||||
|
|
|
@ -402,7 +402,7 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
|
|||
|
||||
|
||||
int palid = TRANSLATION(Translation_Remap + curbasepal, globalpal);
|
||||
bool success = GLInterface.SetTexture(globalpicnum, tileGetTexture(globalpicnum), palid, method, sampleroverride);
|
||||
bool success = GLInterface.SetTexture(globalpicnum, tileGetTexture(globalpicnum), palid, sampleroverride);
|
||||
if (!success)
|
||||
{
|
||||
tsiz.x = tsiz.y = 1;
|
||||
|
@ -4352,7 +4352,7 @@ static void polymost_precache(int32_t dapicnum, int32_t dapalnum, int32_t datype
|
|||
//Printf("precached %d %d type %d\n", dapicnum, dapalnum, datype);
|
||||
hicprecaching = 1;
|
||||
int palid = TRANSLATION(Translation_Remap + curbasepal, dapalnum);
|
||||
GLInterface.SetTexture(dapicnum, tileGetTexture(dapicnum), palid, 0, -1);
|
||||
GLInterface.SetTexture(dapicnum, tileGetTexture(dapicnum), palid, CLAMP_NONE);
|
||||
hicprecaching = 0;
|
||||
|
||||
if (datype == 0 || !hw_models) return;
|
||||
|
@ -4367,7 +4367,7 @@ static void polymost_precache(int32_t dapicnum, int32_t dapalnum, int32_t datype
|
|||
{
|
||||
auto tex = mdloadskin((md2model_t *)models[mid], 0, dapalnum, i, nullptr);
|
||||
int palid = TRANSLATION(Translation_Remap + curbasepal, dapalnum);
|
||||
if (tex) GLInterface.SetTexture(-1, tex, palid, 0, -1);
|
||||
if (tex) GLInterface.SetTexture(-1, tex, palid, CLAMP_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1154,7 +1154,7 @@ int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr)
|
|||
|
||||
GLInterface.SetPalswap(globalpal);
|
||||
// The texture here is already translated.
|
||||
GLInterface.SetTexture(-1, htex, 0/*TRANSLATION(Translation_Remap + curbasepal, globalpal)*/, 0, CLAMP_NOFILTER_XY);
|
||||
GLInterface.SetTexture(-1, htex, 0/*TRANSLATION(Translation_Remap + curbasepal, globalpal)*/, CLAMP_NOFILTER_XY);
|
||||
|
||||
// This must be done after setting up the texture.
|
||||
auto& h = lookups.tables[globalpal];
|
||||
|
|
|
@ -61,13 +61,12 @@ OpenGLRenderer::FHardwareTexture* GLInstance::LoadTexture(FTexture *tex, int tex
|
|||
return hwtex;
|
||||
}
|
||||
|
||||
bool GLInstance::SetTexture(int picnum, FGameTexture* tex, int paletteid, int method, int sampleroverride)
|
||||
bool GLInstance::SetTexture(int picnum, FGameTexture* tex, int paletteid, int sampler)
|
||||
{
|
||||
TexturePick texpick;
|
||||
if (!PickTexture(picnum, tex, paletteid, texpick)) return false;
|
||||
|
||||
int TextureType = (texpick.translation & 0x80000000) ? TT_INDEXED : TT_TRUECOLOR;
|
||||
auto sampler = (method & DAMETH_CLAMPED) ? (sampleroverride != -1 ? sampleroverride : SamplerClampXY) : SamplerRepeat;
|
||||
if (TextureType == TT_INDEXED)
|
||||
{
|
||||
sampler = sampler + SamplerNoFilterRepeat - SamplerRepeat;
|
||||
|
|
|
@ -499,7 +499,7 @@ public:
|
|||
renderState.LookupTexture = tex;
|
||||
}
|
||||
|
||||
bool SetTexture(int globalpicnum, FGameTexture* tex, int palette, int method, int sampleroverride);
|
||||
bool SetTexture(int globalpicnum, FGameTexture* tex, int palette, int sampleroverride);
|
||||
};
|
||||
|
||||
extern GLInstance GLInterface;
|
||||
|
|
|
@ -170,7 +170,7 @@ void GLInstance::Draw2D(F2DDrawer *drawer)
|
|||
SetFadeDisable(true);
|
||||
SetShade(0, numshades);
|
||||
|
||||
SetTexture(TileFiles.GetTileIndex(tex), tex, cmd.mTranslationId, 0, cmd.mFlags & F2DDrawer::DTF_Wrap ? CLAMP_NONE : CLAMP_XY);
|
||||
SetTexture(TileFiles.GetTileIndex(tex), tex, cmd.mTranslationId, cmd.mFlags & F2DDrawer::DTF_Wrap ? CLAMP_NONE : CLAMP_XY);
|
||||
EnableBlend(!(cmd.mRenderStyle.Flags & STYLEF_Alpha1));
|
||||
UseColorOnly(false);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue