mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 17:30:51 +00:00
- draw fullscreen blends with the 2D drawer.
Removing one special case of render setup. Now all 2D content is done by the same code.
This commit is contained in:
parent
cf6855904d
commit
40f085adea
1 changed files with 9 additions and 28 deletions
|
@ -231,38 +231,19 @@ extern PalEntry palfadergb;
|
||||||
|
|
||||||
void DrawFullscreenBlends()
|
void DrawFullscreenBlends()
|
||||||
{
|
{
|
||||||
GLInterface.SetIdentityMatrix(Matrix_Model);
|
// These get prepended to the 2D drawer so they must be submitted in reverse order of drawing.
|
||||||
|
|
||||||
GLInterface.EnableDepthTest(false);
|
|
||||||
GLInterface.EnableAlphaTest(false);
|
|
||||||
GLInterface.EnableBlend(true);
|
|
||||||
GLInterface.UseColorOnly(true);
|
|
||||||
|
|
||||||
renderBeginScene();
|
|
||||||
if (palfadergb.a > 0)
|
|
||||||
{
|
|
||||||
// Todo: reroute to the 2D drawer
|
|
||||||
GLInterface.SetRenderStyle(LegacyRenderStyles[STYLE_Translucent]);
|
|
||||||
GLInterface.SetColorub(palfadergb.r, palfadergb.g, palfadergb.b, palfadergb.a);
|
|
||||||
GLInterface.Draw(DT_TriangleStrip, FFlatVertexBuffer::PRESENT_INDEX, 4);
|
|
||||||
}
|
|
||||||
if (tint_blood_r | tint_blood_g | tint_blood_b)
|
if (tint_blood_r | tint_blood_g | tint_blood_b)
|
||||||
{
|
{
|
||||||
GLInterface.SetRenderStyle(LegacyRenderStyles[STYLE_Add]);
|
PalEntry color2(255, std::max(-tint_blood_r, 0), std::max(-tint_blood_g, 0), std::max(-tint_blood_b, 0));
|
||||||
|
twod->AddColorOnlyQuad(0, 0, twod->GetWidth(), twod->GetHeight(), color2, &LegacyRenderStyles[STYLE_Subtract], true);
|
||||||
GLInterface.SetColorub(max(tint_blood_r, 0), max(tint_blood_g, 0), max(tint_blood_b, 0), 255);
|
PalEntry color(255, std::max(tint_blood_r, 0), std::max(tint_blood_g, 0), std::max(tint_blood_b, 0));
|
||||||
GLInterface.Draw(DT_TriangleStrip, FFlatVertexBuffer::PRESENT_INDEX, 4);
|
twod->AddColorOnlyQuad(0, 0, twod->GetWidth(), twod->GetHeight(), color, &LegacyRenderStyles[STYLE_Add], true);
|
||||||
|
|
||||||
GLInterface.SetRenderStyle(LegacyRenderStyles[STYLE_Subtract]);
|
|
||||||
GLInterface.SetColorub(max(-tint_blood_r, 0), max(-tint_blood_g, 0), max(-tint_blood_b, 0), 255);
|
|
||||||
GLInterface.Draw(DT_TriangleStrip, FFlatVertexBuffer::PRESENT_INDEX, 4);
|
|
||||||
|
|
||||||
GLInterface.SetColorub(255, 255, 255, 255);
|
|
||||||
GLInterface.SetRenderStyle(LegacyRenderStyles[STYLE_Translucent]);
|
|
||||||
}
|
}
|
||||||
renderFinishScene();
|
|
||||||
GLInterface.UseColorOnly(false);
|
|
||||||
|
|
||||||
|
if (palfadergb.a > 0)
|
||||||
|
{
|
||||||
|
twod->AddColorOnlyQuad(0, 0, twod->GetWidth(), twod->GetHeight(), palfadergb, &LegacyRenderStyles[STYLE_Translucent], true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawRateStuff();
|
void DrawRateStuff();
|
||||||
|
|
Loading…
Reference in a new issue