version 1.18 | | version 1.19 |
---|
| | |
/* | | /* |
* static char *rcsid_random_map_c = | | * static char *rcsid_random_map_c = |
* "$Id: random_map.c,v 1.18 2001/04/23 08:01:19 mardahl Exp $"; | | * "$Id: random_map.c,v 1.19 2001/04/26 05:37:10 mardahl Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
#include <rproto.h> | | #include <rproto.h> |
#include <sproto.h> | | #include <sproto.h> |
| | |
| | void dump_layout(char **layout,RMParms *RP) { |
| | { int i,j; |
| | for(i=0;i<RP->Xsize;i++) { |
| | for(j=0;j<RP->Ysize;j++) { |
| | if(layout[i][j]==0) layout[i][j]=' '; |
| | printf("%c",layout[i][j]); |
| | if(layout[i][j]==' ') layout[i][j]=0; |
| | } |
| | printf("\n"); |
| | }} |
| | } |
EXTERN FILE *logfile; | | EXTERN FILE *logfile; |
mapstruct *generate_random_map(char *OutFileName, RMParms *RP) { | | mapstruct *generate_random_map(char *OutFileName, RMParms *RP) { |
char **layout; | | char **layout; |
| | |
/* rotate the layout randomly */ | | /* rotate the layout randomly */ |
layout=rotate_layout(layout,RANDOM()%4,RP); | | layout=rotate_layout(layout,RANDOM()%4,RP); |
#ifdef RMAP_DEBUG | | #ifdef RMAP_DEBUG |
{ int i,j; | | dump_layout(layout,RP); |
for(i=0;i<RP->Xsize;i++) { | | |
for(j=0;j<RP->Ysize;j++) { | | |
if(layout[i][j]==0) layout[i][j]=' '; | | |
printf("%c",layout[i][j]); | | |
if(layout[i][j]==' ') layout[i][j]=0; | | |
} | | |
printf("\n"); | | |
}} | | |
#endif | | #endif |
/* allocate the map and set the floor */ | | /* allocate the map and set the floor */ |
theMap = make_map_floor(layout,RP->floorstyle,RP); | | theMap = make_map_floor(layout,RP->floorstyle,RP); |