mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-02 00:43:43 +00:00
Fix decal vertical position being wrong
This commit is contained in:
parent
bd9ec843dd
commit
ebd810d843
1 changed files with 11 additions and 3 deletions
|
@ -118,7 +118,7 @@ void RenderPolyDecal::Render(const TriMatrix &worldToClip, DBaseDecal *decal, co
|
||||||
|
|
||||||
vertices[i].x = (float)p.X;
|
vertices[i].x = (float)p.X;
|
||||||
vertices[i].y = (float)p.Y;
|
vertices[i].y = (float)p.Y;
|
||||||
vertices[i].z = (float)(zpos + spriteHeight * offsets[i].second);
|
vertices[i].z = (float)(zpos + spriteHeight * offsets[i].second - spriteHeight * 0.5);
|
||||||
vertices[i].w = 1.0f;
|
vertices[i].w = 1.0f;
|
||||||
vertices[i].varying[0] = (float)(offsets[i].first * tex->Scale.X);
|
vertices[i].varying[0] = (float)(offsets[i].first * tex->Scale.X);
|
||||||
vertices[i].varying[1] = (float)((1.0f - offsets[i].second) * tex->Scale.Y);
|
vertices[i].varying[1] = (float)((1.0f - offsets[i].second) * tex->Scale.Y);
|
||||||
|
@ -140,7 +140,15 @@ void RenderPolyDecal::Render(const TriMatrix &worldToClip, DBaseDecal *decal, co
|
||||||
uniforms.flags = 0;
|
uniforms.flags = 0;
|
||||||
}
|
}
|
||||||
uniforms.subsectorDepth = subsectorDepth;
|
uniforms.subsectorDepth = subsectorDepth;
|
||||||
uniforms.color = decal->AlphaColor;
|
|
||||||
|
if (r_swtruecolor)
|
||||||
|
{
|
||||||
|
uniforms.color = 0xff000000 | decal->AlphaColor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uniforms.color = ((uint32_t)decal->AlphaColor) >> 24;
|
||||||
|
}
|
||||||
|
|
||||||
PolyDrawArgs args;
|
PolyDrawArgs args;
|
||||||
args.uniforms = uniforms;
|
args.uniforms = uniforms;
|
||||||
|
@ -152,7 +160,7 @@ void RenderPolyDecal::Render(const TriMatrix &worldToClip, DBaseDecal *decal, co
|
||||||
args.stenciltestvalue = 0;
|
args.stenciltestvalue = 0;
|
||||||
args.stencilwritevalue = 1;
|
args.stencilwritevalue = 1;
|
||||||
args.SetTexture(tex);
|
args.SetTexture(tex);
|
||||||
args.SetColormap(line->frontsector->ColorMap);
|
args.SetColormap(front->ColorMap);
|
||||||
//mode = R_SetPatchStyle (decal->RenderStyle, (float)decal->Alpha, decal->Translation, decal->AlphaColor);
|
//mode = R_SetPatchStyle (decal->RenderStyle, (float)decal->Alpha, decal->Translation, decal->AlphaColor);
|
||||||
PolyTriangleDrawer::draw(args, TriDrawVariant::DrawSubsector, TriBlendMode::Shaded);
|
PolyTriangleDrawer::draw(args, TriDrawVariant::DrawSubsector, TriBlendMode::Shaded);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue