summaryrefslogtreecommitdiffstats
path: root/src/render/Sprite2d.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-12 19:31:23 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-12 19:31:23 +0200
commitdc444b9ca06efd32eb624e5da063cfec309a086a (patch)
tree0d39d226b09d29ffabc1c8ba37573198772a2646 /src/render/Sprite2d.cpp
parentfix garages (diff)
parentCClouds; disabled object clipping for SA cam (diff)
downloadre3-dc444b9ca06efd32eb624e5da063cfec309a086a.tar
re3-dc444b9ca06efd32eb624e5da063cfec309a086a.tar.gz
re3-dc444b9ca06efd32eb624e5da063cfec309a086a.tar.bz2
re3-dc444b9ca06efd32eb624e5da063cfec309a086a.tar.lz
re3-dc444b9ca06efd32eb624e5da063cfec309a086a.tar.xz
re3-dc444b9ca06efd32eb624e5da063cfec309a086a.tar.zst
re3-dc444b9ca06efd32eb624e5da063cfec309a086a.zip
Diffstat (limited to 'src/render/Sprite2d.cpp')
-rw-r--r--src/render/Sprite2d.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/render/Sprite2d.cpp b/src/render/Sprite2d.cpp
index 52b85018..189c9797 100644
--- a/src/render/Sprite2d.cpp
+++ b/src/render/Sprite2d.cpp
@@ -151,7 +151,6 @@ CSprite2d::Draw(float x1, float y1, float x2, float y2, float x3, float y3, floa
RwIm2DRenderPrimitive(rwPRIMTYPETRIFAN, CSprite2d::maVertices, 4);
}
-
// Arguments:
// 2---3
// | |
@@ -461,6 +460,22 @@ CSprite2d::DrawRectXLU(const CRect &r, const CRGBA &c0, const CRGBA &c1, const C
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
}
+void
+CSprite2d::DrawAnyRect(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4,
+ const CRGBA &c0, const CRGBA &c1, const CRGBA &c2, const CRGBA &c3)
+{
+ SetVertices(x1, y1, x2, y2, x3, y3, x4, y4, c0, c1, c2, c3);
+ RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil);
+ RwRenderStateSet(rwRENDERSTATESHADEMODE, (void*)rwSHADEMODEGOURAUD);
+ RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
+ RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
+ RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)(c0.alpha != 255 || c1.alpha != 255 || c2.alpha != 255 || c3.alpha != 255));
+ RwIm2DRenderPrimitive(rwPRIMTYPETRIFAN, CSprite2d::maVertices, 4);
+ RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
+ RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
+ RwRenderStateSet(rwRENDERSTATESHADEMODE, (void*)rwSHADEMODEGOURAUD);
+}
+
void CSprite2d::Draw2DPolygon(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, const CRGBA &color)
{
SetVertices(x1, y1, x2, y2, x3, y3, x4, y4, color, color, color, color);