summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-07-31 22:10:11 +1000
committerquou <quou@disroot.org>2024-07-31 22:10:11 +1000
commit78a0ff9e5993b4cd826684b52b79604bf02ece25 (patch)
tree15fd178b18f7f1ac6f6e7dd92618b8c5c76bbabf
parent84615bccdc0962ac7ecdac258a8006af7ebe1c9b (diff)
Reset clip function
-rw-r--r--render.c7
-rw-r--r--render.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/render.c b/render.c
index 348263d..023c33a 100644
--- a/render.c
+++ b/render.c
@@ -211,6 +211,13 @@ void ren_clip(Renderer* r, const Rect* c) {
r->clip[3] = c->y + c->h;
}
+void ren_clipr(Renderer* r) {
+ r->clip[0] = 0;
+ r->clip[1] = 0;
+ r->clip[2] = r->vp[0];
+ r->clip[3] = r->vp[1];
+}
+
void ren_point(Renderer* r, Colour c, int x, int y) {
if (x < r->clip[0]) return;
if (y < r->clip[1]) return;
diff --git a/render.h b/render.h
index 6c085cb..e655c52 100644
--- a/render.h
+++ b/render.h
@@ -70,6 +70,7 @@ void ren_clear(Renderer* r);
void ren_clearc(Renderer* r, Colour c);
void ren_cleard(Renderer* r, int depth);
void ren_clip(Renderer* r, const Rect* c);
+void ren_clipr(Renderer* r);
void ren_point(Renderer* r, Colour c, int x, int y);
void ren_rect(Renderer* r, Colour c, const Rect*);
void ren_char(