summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-07-24 03:10:51 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-07-24 04:25:33 -0700
commited889f0b2d7d831b5256789f382c2653806b0382 (patch)
treec9daa5a93671726eca48f677f44eafaefa41c2f5 /src/modules
parent3b6e34e70d2bf508156a03fb3e2357894f4f6ad9 (diff)
modules/spiro: fast and dirty frame clipping fixup
Sorry but more s/unchecked/checked/ and now this seems to not crash when used as a checkers fill_module.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/spiro/spiro.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/spiro/spiro.c b/src/modules/spiro/spiro.c
index 9da4686..30e5f06 100644
--- a/src/modules/spiro/spiro.c
+++ b/src/modules/spiro/spiro.c
@@ -57,7 +57,7 @@ static void spiro_render_fragment(til_module_context_t *context, unsigned ticks,
{
spiro_context_t *ctxt = (spiro_context_t *)context;
- int width = fragment->width, height = fragment->height;
+ int width = fragment->frame_width, height = fragment->frame_height;
int display_R, display_origin_x, display_origin_y;
@@ -85,7 +85,7 @@ static void spiro_render_fragment(til_module_context_t *context, unsigned ticks,
float my_y=((1.f-k)*sinf(t))-(l*k*sinf(((1.f-k)/k)*t));
int pos_x=display_origin_x+(my_x*display_R);
int pos_y=display_origin_y+(my_y*display_R);
- til_fb_fragment_put_pixel_unchecked(fragment, TIL_FB_DRAW_FLAG_TEXTURABLE, pos_x, pos_y,
+ til_fb_fragment_put_pixel_checked(fragment, TIL_FB_DRAW_FLAG_TEXTURABLE, pos_x, pos_y,
makergb(sinf(M_1_PI*t)*127+128,
sinf(M_1_PI*t+(2*M_PI*.333333333333f))*127+128,
sinf(M_1_PI*t+(4*M_PI*.333333333333f))*127+128,
@@ -94,31 +94,31 @@ static void spiro_render_fragment(til_module_context_t *context, unsigned ticks,
#ifdef DEBUG
/* plot the origin point */
- til_fb_fragment_put_pixel_unchecked(fragment, 0, display_origin_x, display_origin_y,
+ til_fb_fragment_put_pixel_checked(fragment, 0, display_origin_x, display_origin_y,
makergb(0xFF, 0xFF, 0x00, 1));
/* plot the fixed outer circle C0 */
for(float a=0.f; a<2*M_PI; a+= M_PI_2/display_R) {
int pos_x=display_origin_x+(cosf(a)*display_R);
int pos_y=display_origin_y+(sinf(a)*display_R);
- til_fb_fragment_put_pixel_unchecked(fragment, 0, pos_x, pos_y,
+ til_fb_fragment_put_pixel_checked(fragment, 0, pos_x, pos_y,
makergb(0xFF, 0xFF, 0x00, 1));
}
/* plot inner circle Ci */
- til_fb_fragment_put_pixel_unchecked(fragment, 0, display_origin_x+display_R-(ctxt->r*display_R),
+ til_fb_fragment_put_pixel_checked(fragment, 0, display_origin_x+display_R-(ctxt->r*display_R),
display_origin_y, makergb(0xFF, 0xFF, 0x00, 1));
for(float a=0.f; a<2*M_PI; a+= M_PI_2/display_R) {
int pos_x=display_origin_x+display_R-(ctxt->r*display_R)+
(cosf(a)*ctxt->r*display_R);
int pos_y=display_origin_y+(sinf(a)*ctxt->r*display_R);
- til_fb_fragment_put_pixel_unchecked(fragment, 0, pos_x, pos_y,
+ til_fb_fragment_put_pixel_checked(fragment, 0, pos_x, pos_y,
makergb(0xFF, 0xFF, 0x00, 1));
}
/* plot p */
- til_fb_fragment_put_pixel_unchecked(fragment, 0, display_origin_x+display_R-(ctxt->r*display_R)+
+ til_fb_fragment_put_pixel_checked(fragment, 0, display_origin_x+display_R-(ctxt->r*display_R)+
(ctxt->p*display_R), display_origin_y, makergb(0xFF, 0xFF, 0x00, 1));
#endif
© All Rights Reserved