Mercurial > hg > early-roguelike
comparison srogue/main.c @ 121:e6c8652473fe
srogue: more compatibility improvements.
Randomness now uses mdport, and xcrypt.c has been replaced with the
rogue5 version.
Super-Rogue now builds on MinGW.
author | John "Elwin" Edwards |
---|---|
date | Sat, 03 May 2014 10:31:30 -0700 |
parents | d6b7c3fb37ea |
children | 78fa1d0e5d25 |
comparison
equal
deleted
inserted
replaced
120:d6b7c3fb37ea | 121:e6c8652473fe |
---|---|
171 else | 171 else |
172 printf("Hello %s, One moment while I open the door to the dungeon...\n", whoami); | 172 printf("Hello %s, One moment while I open the door to the dungeon...\n", whoami); |
173 | 173 |
174 fflush(stdout); | 174 fflush(stdout); |
175 seed = dnum; | 175 seed = dnum; |
176 srandom(seed); /* init rnd number gen */ | 176 md_srandom(seed); /* init rnd number gen */ |
177 | 177 |
178 md_onsignal_exit(); /* just in case */ | 178 md_onsignal_exit(); /* just in case */ |
179 | 179 |
180 init_everything(); | 180 init_everything(); |
181 | 181 |
352 reg int wh; | 352 reg int wh; |
353 | 353 |
354 if (range == 0) | 354 if (range == 0) |
355 wh = 0; | 355 wh = 0; |
356 else { | 356 else { |
357 wh = random() % range; | 357 wh = md_random() % range; |
358 wh &= 0x7FFFFFFF; | 358 wh &= 0x7FFFFFFF; |
359 } | 359 } |
360 return wh; | 360 return wh; |
361 } | 361 } |
362 | 362 |