Add stencil value to decal, particle, plane, port, sky, sprite, wall and wallsprite classes

This commit is contained in:
Magnus Norddahl 2016-11-24 08:23:50 +01:00
commit cff72fb072
14 changed files with 48 additions and 47 deletions

View file

@ -28,7 +28,7 @@
#include "r_poly_wallsprite.h"
#include "r_poly.h"
void RenderPolyWallSprite::Render(const TriMatrix &worldToClip, AActor *thing, subsector_t *sub, uint32_t subsectorDepth)
void RenderPolyWallSprite::Render(const TriMatrix &worldToClip, AActor *thing, subsector_t *sub, uint32_t subsectorDepth, uint32_t stencilValue)
{
if (RenderPolySprite::IsThingCulled(thing))
return;
@ -118,8 +118,8 @@ void RenderPolyWallSprite::Render(const TriMatrix &worldToClip, AActor *thing, s
args.vcount = 4;
args.mode = TriangleDrawMode::Fan;
args.ccw = true;
args.stenciltestvalue = 0;
args.stencilwritevalue = 1;
args.stenciltestvalue = stencilValue;
args.stencilwritevalue = stencilValue;
args.SetTexture(tex);
args.SetColormap(sub->sector->ColorMap);
PolyTriangleDrawer::draw(args, TriDrawVariant::DrawSubsector, TriBlendMode::AlphaBlend);