version 1.4 | | version 1.5 |
---|
| | |
/* | | /* |
* static char *rcsid_door_c = | | * static char *rcsid_door_c = |
* "$Id: door.c,v 1.4 2000/05/26 09:50:47 jec Exp $"; | | * "$Id: door.c,v 1.5 2000/12/15 03:09:19 peterm Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
#include <global.h> | | #include <global.h> |
#include <random_map.h> | | #include <random_map.h> |
| | |
void put_doors(mapstruct *the_map,char **maze , char *doorstyle) { | | void put_doors(mapstruct *the_map,char **maze , char *doorstyle, RMParms *RP) { |
int i,j; | | int i,j; |
mapstruct *vdoors; | | mapstruct *vdoors; |
mapstruct *hdoors; | | mapstruct *hdoors; |
| | |
if(!vdoors) return; | | if(!vdoors) return; |
sprintf(doorpath,"/styles/doorstyles/hdoors%s",strrchr(vdoors->path,'/')); | | sprintf(doorpath,"/styles/doorstyles/hdoors%s",strrchr(vdoors->path,'/')); |
hdoors = find_style(doorpath,0,-1); | | hdoors = find_style(doorpath,0,-1); |
for(i=0;i<Xsize;i++) | | for(i=0;i<RP->Xsize;i++) |
for(j=0;j<Ysize;j++) { | | for(j=0;j<RP->Ysize;j++) { |
if(maze[i][j]=='*'||maze[i][j]=='d') { | | if(maze[i][j]=='*'||maze[i][j]=='d') { |
int sindex; | | int sindex; |
object *this_door,*new_door; | | object *this_door,*new_door; |
sindex = surround_flag2(maze,i,j); | | sindex = surround_flag2(maze,i,j,RP); |
if(sindex==3) | | if(sindex==3) |
this_door=pick_random_object(hdoors); | | this_door=pick_random_object(hdoors); |
else | | else |