Batcher helpers

This commit is contained in:
Matt Thorson 2020-09-13 22:53:53 -07:00
parent ce684b1d16
commit 8747ae1cab
2 changed files with 22 additions and 0 deletions

View File

@ -34,6 +34,23 @@ namespace Strawberry
Rect(rect.X, rect.Y, rect.Width, rect.Height, color); Rect(rect.X, rect.Y, rect.Width, rect.Height, color);
} }
public void Tri(Vector a, Vector b, Vector c, Color color)
{
PushTri(.Shape, null,
.Shape(a, color),
.Shape(b, color),
.Shape(c, color));
}
public void Quad(Vector a, Vector b, Vector c, Vector d, Color color)
{
PushQuad(.Shape, null,
.Shape(a, color),
.Shape(b, color),
.Shape(c, color),
.Shape(d, color));
}
public void Tex(Texture texture, float x, float y) public void Tex(Texture texture, float x, float y)
{ {
PushQuad(.TextureTint, texture, PushQuad(.TextureTint, texture,

View File

@ -99,5 +99,10 @@ namespace Strawberry
{ {
return Point(a.X / b.X, a.Y / b.Y); return Point(a.X / b.X, a.Y / b.Y);
} }
static public Point operator*(Point a, Facings f)
{
return .(a.X * (int)f, a.Y);
}
} }
} }