mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 07:57:58 +00:00
- fixed: translucency detection in multipatch textures did not work.
- fixed: The flat drawer never checked if a texture had translucent parts.
This commit is contained in:
parent
5a64307ad1
commit
b9ca3c85f8
3 changed files with 22 additions and 4 deletions
|
@ -419,15 +419,17 @@ void GLFlat::Draw(int pass, bool trans) // trans only has meaning for GLPASS_LIG
|
||||||
if (renderstyle==STYLE_Add) gl_RenderState.BlendFunc(GL_SRC_ALPHA, GL_ONE);
|
if (renderstyle==STYLE_Add) gl_RenderState.BlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||||
gl_SetColor(lightlevel, rel, Colormap, alpha);
|
gl_SetColor(lightlevel, rel, Colormap, alpha);
|
||||||
gl_SetFog(lightlevel, rel, &Colormap, false);
|
gl_SetFog(lightlevel, rel, &Colormap, false);
|
||||||
gl_RenderState.AlphaFunc(GL_GEQUAL, gl_mask_threshold);
|
|
||||||
if (!gltexture)
|
if (!gltexture)
|
||||||
{
|
{
|
||||||
|
gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f);
|
||||||
gl_RenderState.EnableTexture(false);
|
gl_RenderState.EnableTexture(false);
|
||||||
DrawSubsectors(pass, false, true);
|
DrawSubsectors(pass, false, true);
|
||||||
gl_RenderState.EnableTexture(true);
|
gl_RenderState.EnableTexture(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (!gltexture->GetTransparent()) gl_RenderState.AlphaFunc(GL_GEQUAL, gl_mask_threshold);
|
||||||
|
else gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f);
|
||||||
gl_RenderState.SetMaterial(gltexture, CLAMP_NONE, 0, -1, false);
|
gl_RenderState.SetMaterial(gltexture, CLAMP_NONE, 0, -1, false);
|
||||||
gl_SetPlaneTextureRotation(&plane, gltexture);
|
gl_SetPlaneTextureRotation(&plane, gltexture);
|
||||||
DrawSubsectors(pass, !gl.legacyMode, true);
|
DrawSubsectors(pass, !gl.legacyMode, true);
|
||||||
|
@ -477,6 +479,21 @@ inline void GLFlat::PutFlat(bool fog)
|
||||||
// translucent 3D floors go into the regular translucent list, translucent portals go into the translucent border list.
|
// translucent 3D floors go into the regular translucent list, translucent portals go into the translucent border list.
|
||||||
list = (renderflags&SSRF_RENDER3DPLANES) ? GLDL_TRANSLUCENT : GLDL_TRANSLUCENTBORDER;
|
list = (renderflags&SSRF_RENDER3DPLANES) ? GLDL_TRANSLUCENT : GLDL_TRANSLUCENTBORDER;
|
||||||
}
|
}
|
||||||
|
else if (gltexture->GetTransparent())
|
||||||
|
{
|
||||||
|
if (stack)
|
||||||
|
{
|
||||||
|
list = GLDL_TRANSLUCENTBORDER;
|
||||||
|
}
|
||||||
|
else if ((renderflags&SSRF_RENDER3DPLANES) && !plane.plane.isSlope())
|
||||||
|
{
|
||||||
|
list = GLDL_TRANSLUCENT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
list = GLDL_PLAINFLATS;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool masked = gltexture->isMasked() && ((renderflags&SSRF_RENDER3DPLANES) || stack);
|
bool masked = gltexture->isMasked() && ((renderflags&SSRF_RENDER3DPLANES) || stack);
|
||||||
|
|
|
@ -628,8 +628,9 @@ int FMultiPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rota
|
||||||
{
|
{
|
||||||
ret = Parts[i].Texture->CopyTrueColorPixels(bmp, x+Parts[i].OriginX, y+Parts[i].OriginY, Parts[i].Rotate, &info);
|
ret = Parts[i].Texture->CopyTrueColorPixels(bmp, x+Parts[i].OriginX, y+Parts[i].OriginY, Parts[i].Rotate, &info);
|
||||||
}
|
}
|
||||||
|
// treat -1 (i.e. unknown) as absolute. We have no idea if this may have overwritten previous info so a real check needs to be done.
|
||||||
if (ret > retv) retv = ret;
|
if (ret == -1) retv = ret;
|
||||||
|
else if (retv != -1 && ret > retv) retv = ret;
|
||||||
}
|
}
|
||||||
// Restore previous clipping rectangle.
|
// Restore previous clipping rectangle.
|
||||||
bmp->SetClipRect(saved_cr);
|
bmp->SetClipRect(saved_cr);
|
||||||
|
|
Loading…
Reference in a new issue