Difference for random_maps/rogue_layout.c from version 1.3 to 1.4


version 1.3 version 1.4
Line 18
 
Line 18
 static void roguelike_make_rooms(Room *Rooms,char **maze, int options);  static void roguelike_make_rooms(Room *Rooms,char **maze, int options);
 static void roguelike_link_rooms(Room *Rooms,char **maze,int xsize,int ysize);  static void roguelike_link_rooms(Room *Rooms,char **maze,int xsize,int ysize);
   
   
   int surround_check(char **layout,int i,int j,int Xsize, int Ysize){
     /* 1 = wall to left,
      2 = wall to right,
      4 = wall above
      8 = wall below */
     int surround_index = 0;
     if((i > 0) && layout[i-1][j]!=0) surround_index |=1;
     if((i < Xsize-1) && layout[i+1][j]!=0) surround_index |=2;
     if((j > 0) && layout[i][j-1]!=0) surround_index |=4;
     if((j < Ysize-1) && layout[i][j+1]!=0) surround_index |=8;
     return surround_index;
   }
   
   
 /* actually make the layout:  we work by a reduction process:  /* actually make the layout:  we work by a reduction process:
    first we make everything a well, then we remove areas to make rooms */     first we make everything a well, then we remove areas to make rooms */
   
Line 85
 
Line 100
   maze[walk->x][walk->y] = '>';    maze[walk->x][walk->y] = '>';
   
   /* convert all the '.' to 0, we're through witht he '.' */    /* convert all the '.' to 0, we're through witht he '.' */
     /* also, fix any 'dangling doors' */
   for(i=0;i<xsize;i++)    for(i=0;i<xsize;i++)
     for(j=0;j<ysize;j++)      for(j=0;j<ysize;j++) {
       if(maze[i][j]=='.') maze[i][j]=0;        if(maze[i][j]=='.') maze[i][j]=0;
           if(maze[i][j]=='D') {  /* remove bad door. */
           int si = surround_check(maze,i,j,xsize,ysize);
           if(si!=3 && si!=12) maze[i][j]=0;
         }
       }
   
   return maze;    return maze;
 }  }


Legend:
line(s) removed in v.1.3 
line(s) changed
 line(s) added in v.1.4

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