diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-04-25 15:41:04 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-04-25 15:41:04 -0700 |
commit | 7db08a73d497862ebd5c5cc5b209ff4e178fe805 (patch) | |
tree | 322f4dd1e5e5c068baf5e01a78197f3c499ae12b /src | |
parent | 55f56a823ea761f2e3e4ac11e6a5f7dbfed32339 (diff) |
modules/swarm: use put_pixel_checked() to stop segfaulting
During rtv runs we'd occasionally segfault in the unchecked line
drawing. This needs to be fixed, but for now just go slower.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/swarm/swarm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/modules/swarm/swarm.c b/src/modules/swarm/swarm.c index cc27c36..0271693 100644 --- a/src/modules/swarm/swarm.c +++ b/src/modules/swarm/swarm.c @@ -338,6 +338,7 @@ static void swarm_draw_as_points(swarm_context_t *ctxt, til_fb_fragment_t *fragm } +/* though this is called _unchecked(), it's temporarily _checked() due to random segfaults. */ static void draw_line_unchecked(til_fb_fragment_t *fragment, int x1, int y1, int x2, int y2, uint32_t color) { int x_delta = x2 - x1; @@ -355,8 +356,8 @@ static void draw_line_unchecked(til_fb_fragment_t *fragment, int x1, int y1, int y1 += sdy; minor -= x_delta; } - - til_fb_fragment_put_pixel_unchecked(fragment, x1, y1, color); + /* XXX FIXME: segfaults occasionally when _unchecked !!! */ + til_fb_fragment_put_pixel_checked(fragment, x1, y1, color); } } else { /* Y-major */ @@ -366,7 +367,8 @@ static void draw_line_unchecked(til_fb_fragment_t *fragment, int x1, int y1, int minor -= y_delta; } - til_fb_fragment_put_pixel_unchecked(fragment, x1, y1, color); + /* XXX FIXME: segfaults occasionally when _unchecked !!! */ + til_fb_fragment_put_pixel_checked(fragment, x1, y1, color); } } } |