diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-02-21 19:29:02 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-02-21 19:29:02 -0800 |
commit | 71e0b6365481415c212bb81cf93acc3dac50781b (patch) | |
tree | 72c77e0885608ef680f517d8769aefca8d671573 /src/modules/snow | |
parent | 1e664661cf35d22641521a1c4c22db1d071323aa (diff) |
modules/snow: use rand() on WIN32
My current version of mingw in debian 9.11 doesn't seem to have
rand_r(), so let's just use plain rand() and lose the improved
parallelization on win builds.
Diffstat (limited to 'src/modules/snow')
-rw-r--r-- | src/modules/snow/snow.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/modules/snow/snow.c b/src/modules/snow/snow.c index af96285..d1f3758 100644 --- a/src/modules/snow/snow.c +++ b/src/modules/snow/snow.c @@ -64,7 +64,11 @@ static void snow_render_fragment(void *context, unsigned ticks, unsigned cpu, fb for (unsigned y = fragment->y; y < fragment->y + fragment->height; y++) { for (unsigned x = fragment->x; x < fragment->x + fragment->width; x++) { +#ifdef __WIN32__ + uint32_t pixel = rand(); +#else uint32_t pixel = rand_r(seed) % 256; +#endif fb_fragment_put_pixel_unchecked(fragment, x, y, pixel << 16 | pixel << 8 | pixel); } |