version 1.14 | | version 1.15 |
---|
| | |
/* | | /* |
* static char *rcsid_random_map_c = | | * static char *rcsid_random_map_c = |
* "$Id: random_map.c,v 1.14 2001/01/16 08:20:53 peterm Exp $"; | | * "$Id: random_map.c,v 1.15 2001/01/31 07:54:51 cvs Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
#include <rproto.h> | | #include <rproto.h> |
#include <sproto.h> | | #include <sproto.h> |
| | |
#define LO_NEWFILE 2 | | |
| | |
| | |
| | |
| | |
EXTERN FILE *logfile; | | EXTERN FILE *logfile; |
mapstruct *generate_random_map(char *InFileName,char *OutFileName) { | | mapstruct *generate_random_map(char *OutFileName, RMParms *RP) { |
FILE *InFile; | | |
char **layout; | | char **layout; |
mapstruct *theMap; | | mapstruct *theMap; |
RMParms *RP; | | |
RP = (RMParms *) calloc(1,sizeof(RMParms)); | | |
| | |
/* set up the random numbers */ | | |
| | |
RP->Xsize=-1; | | |
RP->Ysize=-1; | | |
| | |
RP->generate_treasure_now=1; | | |
| | |
if((InFile=fopen(InFileName,"r"))==NULL) { | | |
printf("\nError: can't open %s\n",InFileName); | | |
return(0); | | |
} | | |
| | |
load_parameters(InFile,LO_NEWFILE,RP); | | |
| | |
/* pick a random seed, or use the one from the input file */ | | /* pick a random seed, or use the one from the input file */ |
if(RP->random_seed == 0) SRANDOM(time(0)); | | if(RP->random_seed == 0) SRANDOM(time(0)); |
| | |
if(RP->generate_treasure_now) | | if(RP->generate_treasure_now) |
fix_auto_apply(theMap); | | fix_auto_apply(theMap); |
| | |
| | |
fclose(InFile); | | |
/* fclose(OutFile); */ | | /* fclose(OutFile); */ |
/*new_save_map(theMap,1);*/ | | /*new_save_map(theMap,1);*/ |
return theMap; | | return theMap; |