rnd-19980820
[rocksndiamonds.git] / src / gfxloader.c
index c84a3cd711a00b8dd5176894fe907decbeb88cfd..9a28f43541d85a40420b30655833bf729c820dff 100644 (file)
 
 #include "gfxloader.h"
 
+
+
+
+
+
+extern Window                  window;
+extern void Delay(long);
+
+
+
+
+
+
 #ifdef DEBUG
 /*
 #define DEBUG_GIF
@@ -63,12 +76,22 @@ static int Read_GIF_to_Pixmap_or_Bitmap(Display *, char *, Pixmap *, int);
 
 int Read_GIF_to_Bitmap(Display *display, char *filename, Pixmap *pixmap)
 {
+  printf("Read_GIF_to_Bitmap\n");
+
+
+
+
   return(Read_GIF_to_Pixmap_or_Bitmap(display, filename,
                                      pixmap, READ_GIF_TO_BITMAP));
 }
 
 int Read_GIF_to_Pixmap(Display *display, char *filename, Pixmap *pixmap)
 {
+  printf("Read_GIF_to_Pixmap\n");
+
+
+
+
   return(Read_GIF_to_Pixmap_or_Bitmap(display, filename,
                                      pixmap, READ_GIF_TO_PIXMAP));
 }
@@ -141,6 +164,22 @@ int Read_GIF_to_Pixmap_or_Bitmap(Display *display, char *filename,
       gcv.background = WhitePixel(display,screen);
       gc = XCreateGC(display, root, GCForeground | GCBackground, &gcv);
       XPutImage(display,new_pixmap,gc,image,0,0,0,0,width,height);
+
+
+
+
+
+
+      Delay(1000000);
+
+      XPutImage(display,window,gc,image,0,0,0,0,width,height);
+
+      Delay(3000000);
+
+
+
+
+
       XFreeGC(display, gc);
     }
 
@@ -770,15 +809,42 @@ static int ConvertXImageDepth(Display *display, XImage **image)
   int screen = DefaultScreen(display);
   int depth = DefaultDepth(display, screen);
 
+
+
+
+
+
+  printf("ConvertXImageDepth:\n");
+  printf("(*image)->depth == %d\n",
+        (*image)->depth);
+  printf("DefaultDepth(display, screen) == %d\n",
+        DefaultDepth(display, screen));
+
+
+
+
   if ((*image)->depth != depth)
   {
     XImage *old_image, *new_image;
+    /*
     Visual *visual = DefaultVisual(display,screen);
+    */
     int width = (*image)->width;
     int height = (*image)->height;
     register int dwx, dwy;
     byte *data;
 
+
+
+
+
+    printf("ConvertXImageDepth: ---------> CONVERTING...\n");
+
+
+
+
+
+
     data = (byte *)malloc(width * height * depth);
     old_image = *image;
 
@@ -913,6 +979,15 @@ int Read_ILBM_to_Bitmap(Display *display, char *filename, Pixmap *pixmap)
   int bytes_per_line, bitmap_size;
   FILE *file;
 
+
+
+
+
+  printf("Read_ILBM_to_Bitmap\n");
+
+
+
+
   if (!(file = fopen(filename,"r")))
     return(ILBM_OpenFailed);