openbsd-ports/graphics/aalib/patches/patch-src_aafire_c
jasper 83f25165b1 - update aalib to 1.4. (the last release was 1.4rc5, but after 7 years of no
major release, it's safe to ship this as 1.4)

tested by brad@ and me@, from brad@
2008-04-03 12:42:45 +00:00

39 lines
1.2 KiB
Plaintext

$OpenBSD: patch-src_aafire_c,v 1.1 2008/04/03 12:42:45 jasper Exp $
--- src/aafire.c.orig Wed Apr 2 00:42:06 2008
+++ src/aafire.c Wed Apr 2 00:44:03 2008
@@ -48,6 +48,7 @@ static void
initialize (void)
{
int i;
+ srandomdev();
context = aa_autoinit (&aa_defparams);
if (context == NULL)
{
@@ -114,20 +115,20 @@ drawfire (void)
height++;
loop--;
if (loop < 0)
- loop = rand () % 3, sloop++;;
+ loop = random () % 3, sloop++;;
i1 = 1;
i2 = 4 * XSIZ + 1;
for (p = (char *) bitmap + XSIZ * (YSIZ + 0);
p < ((unsigned char *) bitmap + XSIZ * (YSIZ + 1));
p++, i1 += 4, i2 -= 4)
{
- last1 = rand () % min (i1, min (i2, height));
- i = rand () % 6;
+ last1 = random () % min (i1, min (i2, height));
+ i = random () % 6;
for (; p < (unsigned char *) bitmap + XSIZ * (YSIZ + 1) && i != 0;
p++, i--, i1 += 4, i2 -= 4)
- *p = last1, last1 += rand () % 6 - 2, *(p + XSIZ) = last1, last1 +=
- rand () % 6 - 2;
- *(p + 2 * XSIZ) = last1, last1 += rand () % 6 - 2;
+ *p = last1, last1 += random () % 6 - 2, *(p + XSIZ) = last1, last1 +=
+ random () % 6 - 2;
+ *(p + 2 * XSIZ) = last1, last1 += random () % 6 - 2;
}
i = 0;
firemain ();