Difference for random_maps/random_map.c from version 1.7 to 1.8


version 1.7 version 1.8
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_random_map_c =   * static char *rcsid_random_map_c =
  *   "$Id: random_map.c,v 1.7 2000/12/15 03:09:19 peterm Exp $";   *   "$Id: random_map.c,v 1.8 2000/12/15 10:06:06 peterm Exp $";
  */   */
   
 /*  /*
Line 80
 
Line 80
   
   /*  rotate the layout randomly */    /*  rotate the layout randomly */
   layout=rotate_layout(layout,RANDOM()%4,RP);    layout=rotate_layout(layout,RANDOM()%4,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]=' ';
         if(layout[i][j]=='*') layout[i][j]='D';
         printf("%c",layout[i][j]);
       }
       printf("\n");
     }}
   /* 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);
   
Line 109
 
Line 117
   if(RP->generate_treasure_now)    if(RP->generate_treasure_now)
     fix_auto_apply(theMap);      fix_auto_apply(theMap);
   
   /* print a schematic of the maze */  
   /*  for(i=0;i<Xsize;i++) {  
       for(j=0;j<Ysize;j++) {  
       if(layout[i][j]==0) layout[i][j]=' ';  
       if(layout[i][j]=='*') layout[i][j]='D';  
       printf("%c",layout[i][j]);  
       }  
       printf("\n");  
       }*/  
   
   fclose(InFile);    fclose(InFile);
   /*  fclose(OutFile); */    /*  fclose(OutFile); */
Line 163
 
Line 162
     if(!(RANDOM()%2)) doorify_layout(maze,RP);      if(!(RANDOM()%2)) doorify_layout(maze,RP);
   }    }
   
     if(strstr(RP->layoutstyle,"spiral")) {
       maze = map_gen_spiral(RP->Xsize,RP->Ysize,RP->layoutoptions1);
       RP->map_layout_style = SPIRAL_LAYOUT;
       if(!(RANDOM()%2)) doorify_layout(maze,RP);
     }
   
   if(maze == 0) /* unknown or unspecified layout type, pick one at random */    if(maze == 0) /* unknown or unspecified layout type, pick one at random */
     switch(RANDOM()%NROFLAYOUTS) {      switch(RANDOM()%NROFLAYOUTS) {
     case 0:      case 0:
       maze = maze_gen(RP->Xsize,RP->Ysize,RANDOM()%2,RP);        maze = maze_gen(RP->Xsize,RP->Ysize,RANDOM()%2,RP);
         RP->map_layout_style = MAZE_LAYOUT;
       if(!(RANDOM()%2)) doorify_layout(maze,RP);        if(!(RANDOM()%2)) doorify_layout(maze,RP);
       break;        break;
     case 1:      case 1:
       maze = map_gen_onion(RP->Xsize,RP->Ysize,RP->layoutoptions1,RP->layoutoptions2);        maze = map_gen_onion(RP->Xsize,RP->Ysize,RP->layoutoptions1,RP->layoutoptions2);
         RP->map_layout_style = ONION_LAYOUT;
       if(!(RANDOM()%3)&& !(RP->layoutoptions1 & OPT_WALLS_ONLY)) roomify_layout(maze,RP);        if(!(RANDOM()%3)&& !(RP->layoutoptions1 & OPT_WALLS_ONLY)) roomify_layout(maze,RP);
       case 2:
         maze = map_gen_spiral(RP->Xsize,RP->Ysize,RP->layoutoptions1);
         RP->map_layout_style = SPIRAL_LAYOUT;
         if(!(RANDOM()%2)) doorify_layout(maze,RP);
       break;        break;
     }      }
   
Line 228
 
Line 239
   for(i=0;i<Xsize_orig;i++)    for(i=0;i<Xsize_orig;i++)
     free(maze[i]);      free(maze[i]);
   free(maze);    free(maze);
     /* reconnected disjointed spirals */
     if(RP->map_layout_style==SPIRAL_LAYOUT)
       connect_spirals(RP->Xsize,RP->Ysize,sym,sym_maze);
   return sym_maze;    return sym_maze;
 }  }
   


Legend:
line(s) removed in v.1.7 
line(s) changed
 line(s) added in v.1.8

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:56