Difference for crossedit/xutil.c from version 1.3 to 1.4


version 1.3 version 1.4
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_xutil_c =   * static char *rcsid_xutil_c =
  *   "$Id: xutil.c,v 1.3 2000/05/13 23:44:43 cvs Exp $";   *   "$Id: xutil.c,v 1.4 2000/12/04 07:19:56 cvs Exp $";
  */   */
   
 /*  /*
Line 26
 
Line 26
     The author can be reached via e-mail to mwedel@scruz.net      The author can be reached via e-mail to mwedel@scruz.net
 */  */
   
   
   #include <autoconf.h>
   /* Stupid pngconf.h file has a check to see if _SETJMP_H is
    * already defined, and if so, it generates a compilation error.
    * I have no idea what they were thinking - wasn't th point of those
    * defines so that you didn't need to worry about order or including
    * the same file multiple times?
    */
   #ifdef HAVE_LIBPNG
   #include "png.c"
   #endif
   
 #include <global.h>  #include <global.h>
 #include <funcpoint.h>  #include <funcpoint.h>
 #include <loader.h>  #include <loader.h>
Line 74
 
Line 86
   
 int ReadImages(Display *gdisp, Pixmap **pixmaps, Pixmap **masks,  int ReadImages(Display *gdisp, Pixmap **pixmaps, Pixmap **masks,
     Colormap *cmap, enum DisplayMode type) {      Colormap *cmap, enum DisplayMode type) {
 #ifdef HAVE_LIBXPM  
   
     Window root = RootWindow (gdisp,DefaultScreen(gdisp));      Window root = RootWindow (gdisp,DefaultScreen(gdisp));
     XpmAttributes xpmatribs;      XpmAttributes xpmatribs;
Line 103
 
Line 114
      */       */
   
     *pixmaps = (Pixmap *) malloc(sizeof(Pixmap *) * nrofpixmaps);      *pixmaps = (Pixmap *) malloc(sizeof(Pixmap *) * nrofpixmaps);
     if (type==Dm_Pixmap)      if (type==Dm_Pixmap || type==Dm_Png)
  *masks = (Pixmap *) malloc(sizeof(Pixmap *) * nrofpixmaps);   *masks = (Pixmap *) malloc(sizeof(Pixmap *) * nrofpixmaps);
   
     for (i=0; i < nrofpixmaps; i++)      for (i=0; i < nrofpixmaps; i++)
Line 115
 
Line 126
  sprintf(filename,"%s/crossfire.xpm",settings.datadir);   sprintf(filename,"%s/crossfire.xpm",settings.datadir);
     else if (type==Dm_Bitmap)      else if (type==Dm_Bitmap)
  sprintf(filename,"%s/crossfire.xbm",settings.datadir);   sprintf(filename,"%s/crossfire.xbm",settings.datadir);
       else if (type==Dm_Png)
    sprintf(filename,"%s/crossfire.png",settings.datadir);
   
     if ((infile = open_and_uncompress(filename,0,&compressed))==NULL) {      if ((infile = open_and_uncompress(filename,0,&compressed))==NULL) {
         LOG(llevError,"Unable to open %s\n", filename);          LOG(llevError,"Unable to open %s\n", filename);
Line 149
 
Line 162
  i++;   i++;
  if (!(i % 100)) LOG(llevDebug,".");   if (!(i % 100)) LOG(llevDebug,".");
   
    if (type==Dm_Png) {
   #ifdef HAVE_LIBPNG
        unsigned long  x,y;
        if (png_to_xpixmap(gdisp, root, databuf, len,
       &(*pixmaps)[num], &(*masks)[num], *cmap, &x, &y)) {
   
    LOG(llevError,"Error loading png file.\n");
        }
   #endif
    }
  if (type==Dm_Pixmap) {   if (type==Dm_Pixmap) {
 again: error=XpmCreatePixmapFromBuffer(gdisp, root, databuf,  again: error=XpmCreatePixmapFromBuffer(gdisp, root, databuf,
        &(*pixmaps)[num], &(*masks)[num], &xpmatribs);         &(*pixmaps)[num], &(*masks)[num], &xpmatribs);
Line 189
 
Line 212
  }   }
     LOG(llevDebug,"done.\n");      LOG(llevDebug,"done.\n");
     return use_private_cmap;      return use_private_cmap;
 #else  
     return 0; /* Prevents some warning messages */      return 0; /* Prevents some warning messages */
 #endif  
 }  }
   
 /* This frees all the pixmaps.  This not only makes for better code,  /* This frees all the pixmaps.  This not only makes for better code,
Line 280
 
Line 301
   }    }
   return iscolor;    return iscolor;
 }  }
   
   


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 19:51