From 8747ae1cabedcea27ad8982ae638f6a30f4e08da Mon Sep 17 00:00:00 2001 From: Matt Thorson Date: Sun, 13 Sep 2020 22:53:53 -0700 Subject: [PATCH] Batcher helpers --- src/PlatformLayer/Batcher.bf | 17 +++++++++++++++++ src/Struct/Point.bf | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/src/PlatformLayer/Batcher.bf b/src/PlatformLayer/Batcher.bf index 4fd570d..3e197dd 100644 --- a/src/PlatformLayer/Batcher.bf +++ b/src/PlatformLayer/Batcher.bf @@ -34,6 +34,23 @@ namespace Strawberry 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) { PushQuad(.TextureTint, texture, diff --git a/src/Struct/Point.bf b/src/Struct/Point.bf index 57b1929..71ebbe0 100644 --- a/src/Struct/Point.bf +++ b/src/Struct/Point.bf @@ -99,5 +99,10 @@ namespace Strawberry { 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); + } } }