mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 23:32:02 +00:00
- added a workaround to avoid sprite splitting when it may cause glitches for sprites that get rotated in the draw pass.
This commit is contained in:
parent
6b4aee28bc
commit
ceaa040750
2 changed files with 26 additions and 3 deletions
|
@ -497,6 +497,10 @@ void GLDrawList::SortWallIntoWall(SortNode * head,SortNode * sort)
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
EXTERN_CVAR(Int, gl_billboard_mode)
|
||||||
|
EXTERN_CVAR(Bool, gl_billboard_faces_camera)
|
||||||
|
EXTERN_CVAR(Bool, gl_billboard_particles)
|
||||||
|
|
||||||
void GLDrawList::SortSpriteIntoWall(SortNode * head,SortNode * sort)
|
void GLDrawList::SortSpriteIntoWall(SortNode * head,SortNode * sort)
|
||||||
{
|
{
|
||||||
GLWall * wh=&walls[drawitems[head->itemindex].index];
|
GLWall * wh=&walls[drawitems[head->itemindex].index];
|
||||||
|
@ -527,6 +531,27 @@ void GLDrawList::SortSpriteIntoWall(SortNode * head,SortNode * sort)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
const bool drawWithXYBillboard = ((ss->particle && gl_billboard_particles) || (!(ss->actor && ss->actor->renderflags & RF_FORCEYBILLBOARD)
|
||||||
|
&& (gl_billboard_mode == 1 || (ss->actor && ss->actor->renderflags & RF_FORCEXYBILLBOARD))));
|
||||||
|
|
||||||
|
const bool drawBillboardFacingCamera = gl_billboard_faces_camera;
|
||||||
|
// [Nash] has +ROLLSPRITE
|
||||||
|
const bool rotated = (ss->actor != nullptr && ss->actor->renderflags & RF_ROLLSPRITE | RF_WALLSPRITE | RF_FLATSPRITE);
|
||||||
|
|
||||||
|
// cannot sort them at the moment. This requires more complex splitting.
|
||||||
|
if (drawWithXYBillboard || drawBillboardFacingCamera || rotated)
|
||||||
|
{
|
||||||
|
float v1 = wh->PointOnSide(ss->x, ss->y);
|
||||||
|
if (v1 < 0)
|
||||||
|
{
|
||||||
|
head->AddToLeft(sort);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
head->AddToRight(sort);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
double r=ss->CalcIntersectionVertex(wh);
|
double r=ss->CalcIntersectionVertex(wh);
|
||||||
|
|
||||||
float ix=(float)(ss->x1 + r * (ss->x2-ss->x1));
|
float ix=(float)(ss->x1 + r * (ss->x2-ss->x1));
|
||||||
|
|
|
@ -923,7 +923,7 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal)
|
||||||
// This is a non-translucent sprite (i.e. STYLE_Normal or equivalent)
|
// This is a non-translucent sprite (i.e. STYLE_Normal or equivalent)
|
||||||
trans=1.f;
|
trans=1.f;
|
||||||
|
|
||||||
if (!gl_sprite_blend || modelframe || (thing->renderflags & RF_SPRITETYPEMASK) == RF_WALLSPRITE)
|
if (!gl_sprite_blend || modelframe || (thing->renderflags & (RF_FLATSPRITE|RF_WALLSPRITE)) || gl_billboard_faces_camera)
|
||||||
{
|
{
|
||||||
RenderStyle.SrcAlpha = STYLEALPHA_One;
|
RenderStyle.SrcAlpha = STYLEALPHA_One;
|
||||||
RenderStyle.DestAlpha = STYLEALPHA_Zero;
|
RenderStyle.DestAlpha = STYLEALPHA_Zero;
|
||||||
|
@ -934,8 +934,6 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal)
|
||||||
RenderStyle.SrcAlpha = STYLEALPHA_Src;
|
RenderStyle.SrcAlpha = STYLEALPHA_Src;
|
||||||
RenderStyle.DestAlpha = STYLEALPHA_InvSrc;
|
RenderStyle.DestAlpha = STYLEALPHA_InvSrc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if ((gltexture && gltexture->GetTransparent()) || (RenderStyle.Flags & STYLEF_RedIsAlpha))
|
if ((gltexture && gltexture->GetTransparent()) || (RenderStyle.Flags & STYLEF_RedIsAlpha))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue