summaryrefslogtreecommitdiff
path: root/src/modules/plasma
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-06-14 02:28:36 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-08-07 06:51:36 -0700
commit5a0776f1fdc6b7780cd21d568150e804347a6f8a (patch)
tree646f1c6e73cd9d7cb63306a840879a0a64aebbed /src/modules/plasma
parent4eb5f55bb0087769e47d0dc745a831440c5041fe (diff)
til: til_fb_fragment_t **fragment_ptr all the things
Preparatory commit for enabling cloneable/swappable fragments There's an outstanding issue with the til_fb_page_t submission, see comments. Doesn't matter for now since cloning doesn't happen yet, but will need to be addressed before they do.
Diffstat (limited to 'src/modules/plasma')
-rw-r--r--src/modules/plasma/plasma.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/modules/plasma/plasma.c b/src/modules/plasma/plasma.c
index 8cc4fda..b58e34f 100644
--- a/src/modules/plasma/plasma.c
+++ b/src/modules/plasma/plasma.c
@@ -75,7 +75,7 @@ static til_module_context_t * plasma_create_context(unsigned seed, unsigned tick
/* Prepare a frame for concurrent drawing of fragment using multiple fragments */
-static void plasma_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t *fragment, til_frame_plan_t *res_frame_plan)
+static void plasma_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
plasma_context_t *ctxt = (plasma_context_t *)context;
@@ -85,17 +85,19 @@ static void plasma_prepare_frame(til_module_context_t *context, unsigned ticks,
/* Draw a plasma effect */
-static void plasma_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t *fragment)
+static void plasma_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
plasma_context_t *ctxt = (plasma_context_t *)context;
- int xstep = PLASMA_WIDTH / fragment->frame_width;
- int ystep = PLASMA_HEIGHT / fragment->frame_height;
- unsigned width = fragment->width * xstep, height = fragment->height * ystep;
- int fw2 = FIXED_NEW(width / 2), fh2 = FIXED_NEW(height / 2);
- int x, y, cx, cy, dx2, dy2;
- uint32_t *buf = fragment->buf;
- color_t c = { .r = 0, .g = 0, .b = 0 }, cscale;
- unsigned rr2, rr6, rr8, rr16, rr20, rr12;
+ til_fb_fragment_t *fragment = *fragment_ptr;
+
+ int xstep = PLASMA_WIDTH / fragment->frame_width;
+ int ystep = PLASMA_HEIGHT / fragment->frame_height;
+ unsigned width = fragment->width * xstep, height = fragment->height * ystep;
+ int fw2 = FIXED_NEW(width / 2), fh2 = FIXED_NEW(height / 2);
+ int x, y, cx, cy, dx2, dy2;
+ uint32_t *buf = fragment->buf;
+ color_t c = { .r = 0, .g = 0, .b = 0 }, cscale;
+ unsigned rr2, rr6, rr8, rr16, rr20, rr12;
rr2 = ctxt->rr * 2;
rr6 = ctxt->rr * 6;
© All Rights Reserved