diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/blinds/blinds.c | 4 | ||||
-rw-r--r-- | src/modules/julia/julia.c | 2 | ||||
-rw-r--r-- | src/modules/montage/montage.c | 4 | ||||
-rw-r--r-- | src/modules/plasma/plasma.c | 2 | ||||
-rw-r--r-- | src/modules/roto/roto.c | 3 |
5 files changed, 7 insertions, 8 deletions
diff --git a/src/modules/blinds/blinds.c b/src/modules/blinds/blinds.c index c0ae079..9996d8a 100644 --- a/src/modules/blinds/blinds.c +++ b/src/modules/blinds/blinds.c @@ -67,7 +67,7 @@ static inline void draw_blind_horizontal(til_fb_fragment_t *fragment, unsigned r unsigned height = roundf(t * (float)row_height); for (unsigned y = 0; y < height; y++) - memset(fragment->buf + ((row * row_height) + y ) * (fragment->pitch >> 2), 0xff, fragment->width * 4); + memset(fragment->buf + ((row * row_height) + y ) * fragment->pitch, 0xff, fragment->width * 4); } @@ -78,7 +78,7 @@ static inline void draw_blind_vertical(til_fb_fragment_t *fragment, unsigned col unsigned width = roundf(t * (float)column_width); for (unsigned y = 0; y < fragment->height; y++) - memset(fragment->buf + y * (fragment->pitch >> 2) + column * column_width, 0xff, width * 4); + memset(fragment->buf + y * fragment->pitch + column * column_width, 0xff, width * 4); } diff --git a/src/modules/julia/julia.c b/src/modules/julia/julia.c index fb3bdae..4b3cd73 100644 --- a/src/modules/julia/julia.c +++ b/src/modules/julia/julia.c @@ -155,7 +155,7 @@ static void julia_render_fragment(void *context, unsigned ticks, unsigned cpu, t *buf = colors[julia_iter(real, imag, ctxt->creal, ctxt->cimag, sizeof(colors) / sizeof(*colors), ctxt->threshold)]; } - buf = ((void *)buf) + fragment->stride; + buf += fragment->stride; } } diff --git a/src/modules/montage/montage.c b/src/modules/montage/montage.c index 13c8a36..e6f6ef1 100644 --- a/src/modules/montage/montage.c +++ b/src/modules/montage/montage.c @@ -144,14 +144,14 @@ static int montage_fragment_tile(const til_fb_fragment_t *fragment, unsigned til xoff = x * tile_width; yoff = y * tile_height; - res_fragment->buf = (void *)fragment->buf + (yoff * fragment->pitch) + (xoff * 4); + res_fragment->buf = fragment->buf + (yoff * fragment->pitch) + xoff; res_fragment->x = 0; /* fragment is a new frame */ res_fragment->y = 0; /* fragment is a new frame */ res_fragment->width = MIN(fragment->width - xoff, tile_width); res_fragment->height = MIN(fragment->height - yoff, tile_height); res_fragment->frame_width = res_fragment->width; /* fragment is a new frame */ res_fragment->frame_height = res_fragment->height; /* fragment is a new frame */ - res_fragment->stride = fragment->stride + ((fragment->width - res_fragment->width) * 4); + res_fragment->stride = fragment->stride + (fragment->width - res_fragment->width); res_fragment->pitch = fragment->pitch; res_fragment->number = number; res_fragment->cleared = fragment->cleared; diff --git a/src/modules/plasma/plasma.c b/src/modules/plasma/plasma.c index 81540c5..0a6b1e5 100644 --- a/src/modules/plasma/plasma.c +++ b/src/modules/plasma/plasma.c @@ -156,7 +156,7 @@ static void plasma_render_fragment(void *context, unsigned ticks, unsigned cpu, *buf = color2pixel(&c); } - buf = ((void *)buf) + fragment->stride; + buf += fragment->stride; } } diff --git a/src/modules/roto/roto.c b/src/modules/roto/roto.c index 5409970..65b3400 100644 --- a/src/modules/roto/roto.c +++ b/src/modules/roto/roto.c @@ -240,11 +240,10 @@ static void roto_render_fragment(void *context, unsigned ticks, unsigned cpu, ti x_sin_r += sin_r; } - buf = ((void *)buf) + fragment->stride; + buf += fragment->stride; y_cos_r += cos_r; y_sin_r += sin_r; } - } |