Difference for random_maps/decor.c from version 1.4 to 1.5


version 1.4 version 1.5
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_decor_ =   * static char *rcsid_decor_ =
  *   "$Id: decor.c,v 1.4 2000/06/19 01:34:31 cvs Exp $";   *   "$Id: decor.c,v 1.5 2000/12/15 03:09:19 peterm Exp $";
  */   */
   
 /*  /*
Line 28
 
Line 28
   
 #include <global.h>  #include <global.h>
 #include <random_map.h>  #include <random_map.h>
   #include <rproto.h>
   
 #define NR_DECOR_OPTIONS 1  #define NR_DECOR_OPTIONS 1
   
Line 42
 
Line 43
 }  }
 /* put the decor into the map.  Right now, it's very primitive. */  /* put the decor into the map.  Right now, it's very primitive. */
   
 void put_decor(mapstruct *map,char **maze,char *decorstyle,int decor_option) {  void put_decor(mapstruct *map,char **maze,char *decorstyle,int decor_option,RMParms *RP) {
   mapstruct *decor_map;    mapstruct *decor_map;
   char style_name[256];    char style_name[256];
   
Line 58
 
Line 59
   case 0: break;    case 0: break;
   case 1:  /* random placement of decor objects. */    case 1:  /* random placement of decor objects. */
     {      {
       int number_to_place = RANDOM() % ( (Xsize *Ysize) / 5);        int number_to_place = RANDOM() % ( (RP->Xsize *RP->Ysize) / 5);
       int failures=0;        int failures=0;
       object *new_decor_object;        object *new_decor_object;
       while(failures < 100 && number_to_place  > 0) {        while(failures < 100 && number_to_place  > 0) {
    int x,y;     int x,y;
    x = RANDOM() % (Xsize-2) +1;     x = RANDOM() % (RP->Xsize-2) +1;
    y = RANDOM() % (Ysize-2) +1;     y = RANDOM() % (RP->Ysize-2) +1;
    if(maze[x][y]==0 && obj_count_in_map(map,x,y)<2) /* empty */     if(maze[x][y]==0 && obj_count_in_map(map,x,y)<2) /* empty */
  {    {
  object *this_object;   object *this_object;
Line 84
 
Line 85
  default:  /* place decor objects everywhere: tile the map. */   default:  /* place decor objects everywhere: tile the map. */
  {   {
    int i,j;     int i,j;
    for(i=1;i<Xsize-1;i++) for(j=1;j<Ysize-1;j++) {     for(i=1;i<RP->Xsize-1;i++) for(j=1;j<RP->Ysize-1;j++) {
  if(maze[i][j]==0) {   if(maze[i][j]==0) {
  object *new_decor_object, *this_object;   object *new_decor_object, *this_object;
    


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

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