From a0e68bab9130a83cc090c9a690c883188c5b7188 Mon Sep 17 00:00:00 2001 From: Marrub Date: Mon, 17 Oct 2016 19:10:24 -0400 Subject: [PATCH] Draw: Add Lth_DrawRectAndClip --- lithos_c/inc/Lth_control.h | 1 + lithos_c/src/draw.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lithos_c/inc/Lth_control.h b/lithos_c/inc/Lth_control.h index 7ded7de..dfaffbe 100644 --- a/lithos_c/inc/Lth_control.h +++ b/lithos_c/inc/Lth_control.h @@ -128,6 +128,7 @@ void Lth_ContextRun(Lth_Context *ctx); void Lth_ContextClipPush(Lth_Context *ctx, int x, int y, int w, int h); void Lth_ContextClipPop(Lth_Context *ctx); +void Lth_DrawRectAndClip(Lth_Context *ctx, int x, int y, int w, int h, __fixed alpha); void Lth_DrawRect(Lth_Context *ctx, int x, int y, int w, int h, __fixed alpha); void Lth_ControlRun(Lth_Context *ctx, void *control_); diff --git a/lithos_c/src/draw.c b/lithos_c/src/draw.c index 6494131..bd73333 100644 --- a/lithos_c/src/draw.c +++ b/lithos_c/src/draw.c @@ -17,7 +17,11 @@ // Extern Functions | // -void Lth_DrawRect(Lth_Context *ctx, int x, int y, int w, int h, __fixed alpha) +// +// Lth_DrawRectAndClip +// +void Lth_DrawRectAndClip(Lth_Context *ctx, int x, int y, int w, int h, + __fixed alpha) { Lth_assert(ctx != NULL); @@ -27,7 +31,14 @@ void Lth_DrawRect(Lth_Context *ctx, int x, int y, int w, int h, __fixed alpha) for(int iy = 0; iy < h; iy += 128) Lth_DrawSpriteAlpha(s"lithos_gfx/Base/Black128.png", ctx->hid.cur--, x + ix, y + iy, alpha); +} +// +// Lth_DrawRect +// +void Lth_DrawRect(Lth_Context *ctx, int x, int y, int w, int h, __fixed alpha) +{ + Lth_DrawRectAndClip(ctx, x, y, w, h, alpha); Lth_ContextClipPop(ctx); }