Difference for x11/xutil.c from version 1.21 to 1.22


version 1.21 version 1.22
Line 1
 
Line 1
 char *rcsid_x11_xutil_c =  char *rcsid_x11_xutil_c =
     "$Id: xutil.c,v 1.21 2005/08/31 21:57:23 akirschbaum Exp $";      "$Id: xutil.c,v 1.22 2006/01/31 14:22:28 cavesomething Exp $";
 /*  /*
     Crossfire client, a client program for the crossfire program.      Crossfire client, a client program for the crossfire program.
   
Line 54
 
Line 54
 "DodgerBlue",           /* 5  */  "DodgerBlue",           /* 5  */
 "DarkOrange2",          /* 6  */  "DarkOrange2",          /* 6  */
 "SeaGreen",             /* 7  */  "SeaGreen",             /* 7  */
 "DarkSeaGreen",         /* 8  */        /* Used for window background color */  "DarkSeaGreen",         /* 8  */
 "Grey50",               /* 9  */  "Grey80",               /* 9  */ /* Used for window background color */
 "Sienna",               /* 10 */  "Sienna",               /* 10 */
 "Gold",                 /* 11 */  "Gold",                 /* 11 */
 "Khaki"                 /* 12 */  "Khaki"                 /* 12 */
Line 171
 
Line 171
 /*#define CHECKSUM_DEBUG*/  /*#define CHECKSUM_DEBUG*/
   
   
 int allocate_colors(Display *disp, Window w, long screen_num,  void allocate_colors(Display *disp, Window w, long screen_num,
         Colormap *colormap, XColor discolor[16])          Colormap *colormap, XColor discolor[16]) {
 {    int i, tried = 0, depth=0;
   int i, tried = 0, depth=0, iscolor;  
   Status status;    Status status;
   Visual *vis;    Visual *vis;
   XColor exactcolor;    XColor exactcolor;
   
   iscolor = 1;  
   vis = DefaultVisual(disp,screen_num);    vis = DefaultVisual(disp,screen_num);
   if (vis->class >= StaticColor) {    if (vis->class >= StaticColor) {
     *colormap = DefaultColormap(disp,screen_num);      *colormap = DefaultColormap(disp,screen_num);
Line 187
 
Line 185
   }    }
   else {    else {
     *colormap = DefaultColormap(disp,screen_num);      *colormap = DefaultColormap(disp,screen_num);
     printf("Switching to black and white.\n");  
     printf("You have a black and white terminal.\n");      printf("You have a black and white terminal.\n");
     return 0;      printf("These are no longer supported by cfclient.\n");
       return;
   }    }
 try_private:  try_private:
   if (depth > 3 && iscolor) {    if (depth > 3) {
     unsigned long pixels[13];      unsigned long pixels[13];
     for (i=0; i<13; i++){      for (i=0; i<13; i++){
       status = XLookupColor(disp,*colormap, colorname[i],&exactcolor,        status = XLookupColor(disp,*colormap, colorname[i],&exactcolor,
                             &discolor[i]);                              &discolor[i]);
       if (!status){        if (!status){
         printf("Can't find colour %s.\n", colorname[i]);          printf("Can't find colour %s.\n", colorname[i]);
         printf("Switching to black and white.\n");  
         iscolor = 0;  
         break;          break;
       }        }
       status = XAllocColor(disp,*colormap,&discolor[i]);        status = XAllocColor(disp,*colormap,&discolor[i]);
Line 212
 
Line 208
           XSetWindowColormap(disp, w, *colormap);            XSetWindowColormap(disp, w, *colormap);
           tried = 1;            tried = 1;
           goto try_private;            goto try_private;
         } else {          } else break;
           printf( "Failed. Switching to black and white.\n");  
           iscolor = 0;  
           break;  
         }  
       }        }
       pixels[i] = discolor[i].pixel;        pixels[i] = discolor[i].pixel;
     }      }
   }    }
   return iscolor;  
 }  }
   
   
   
   
   
 /* Updates the keys array with the keybinding that is passed.  All the  /* Updates the keys array with the keybinding that is passed.  All the
  * arguments are pretty self explanatory.  flags is the various state   * arguments are pretty self explanatory.  flags is the various state
  * that the keyboard is in.   * that the keyboard is in.


Legend:
line(s) removed in v.1.21 
line(s) changed
 line(s) added in v.1.22

File made using version 1.96 of cvs2html by leaf at 2006-02-16 21:08