Skip to content

Commit

Permalink
- fixed: glPolygonOffset was not called for flat sprites.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Oelckers committed Dec 6, 2016
1 parent c115c0a commit a3ae052
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/gl/scene/gl_sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ void GLSprite::CalculateVertices(FVector3 *v)
v[1] = mat * FVector3(x1, z, y2);
v[2] = mat * FVector3(x2, z, y1);
v[3] = mat * FVector3(x1, z, y1);

glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-1.0f, -128.0f);
return;
}

Expand Down Expand Up @@ -445,6 +448,11 @@ void GLSprite::Draw(int pass)
gl_RenderState.BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
gl_RenderState.BlendEquation(GL_FUNC_ADD);
gl_RenderState.SetTextureMode(TM_MODULATE);
if (actor != nullptr && (actor->renderflags & RF_SPRITETYPEMASK) == RF_FLATSPRITE)
{
glPolygonOffset(0.0f, 0.0f);
glDisable(GL_POLYGON_OFFSET_FILL);
}
}
else if (modelframe == nullptr)
{
Expand Down

0 comments on commit a3ae052

Please sign in to comment.