summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-07-24 03:23:35 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-07-24 04:25:33 -0700
commit6e72b655cd44828ce15a84b1adb38f5b63634f3e (patch)
tree00903c953bb316b212a603061ef4e9c0d562c965
parented889f0b2d7d831b5256789f382c2653806b0382 (diff)
modules/stars: more fast and nasty fragment clip to frame fixes
s/unchecked/checked/ and use frame dimensions, probably more fixes needed but this prevents crashing as checkers fill_module= at least.
-rw-r--r--src/modules/stars/stars.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/stars/stars.c b/src/modules/stars/stars.c
index 665534a..3a3f90f 100644
--- a/src/modules/stars/stars.c
+++ b/src/modules/stars/stars.c
@@ -116,7 +116,7 @@ static void stars_render_fragment(til_module_context_t *context, unsigned ticks,
struct points* tmp_ptr;
struct points* last_ptr=NULL;
float x, y, pos_x, pos_y, rot_x, rot_y, opacity, x_mult, y_mult, max_radius;
- int width = fragment->width, height = fragment->height;
+ int width = fragment->frame_width, height = fragment->frame_height;
if(width>height) {
x_mult=1.f;
@@ -162,7 +162,7 @@ static void stars_render_fragment(til_module_context_t *context, unsigned ticks,
opacity = 1;
if (pos_x>0 && pos_x<width && pos_y>0 && pos_y<height)
- 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(0xFF, 0xFF, 0xFF, opacity));
for(int my_y=floorf(pos_y-max_radius); my_y<=(int)ceilf(pos_y+max_radius); my_y++)
@@ -177,7 +177,7 @@ static void stars_render_fragment(til_module_context_t *context, unsigned ticks,
continue;
- til_fb_fragment_put_pixel_unchecked(fragment, TIL_FB_DRAW_FLAG_TEXTURABLE, my_x, my_y,
+ til_fb_fragment_put_pixel_checked(fragment, TIL_FB_DRAW_FLAG_TEXTURABLE, my_x, my_y,
makergb(0xFF, 0xFF, 0xFF, opacity));
}
© All Rights Reserved