changeset 1699:df7ca5c4fa5b

Removed some code to workaround a buggy version of GBM on OS/2. Moved the GBM debug messages into #ifdef DEBUG The version of GBM that comes with my version of eCS is very buggy. It fails to load most PNG images and once it fails to load a PNG other types start failing as well. Installing the latest version into c:\OS2\DLL corrects the issues and PNG/JPG files work fine.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 03 May 2012 09:04:13 +0000
parents e31c7e389b2f
children 4487f6bc9e8b
files os2/dw.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/os2/dw.c	Thu May 03 08:31:22 2012 +0000
+++ b/os2/dw.c	Thu May 03 09:04:13 2012 +0000
@@ -6770,14 +6770,16 @@
         for(z=0;z<ft;z++)
         {
             /* Read the file header */
-            if((err = _gbm_read_header(file, fd, z, &gbm, "")) == 0 && gbm.bpp > 1)
+            if((err = _gbm_read_header(file, fd, z, &gbm, "")) == 0)
                 break;
         }
 
         /* If we failed to load the header */
         if(err)
         {
+#ifdef DEBUG
             dw_debug("GBM: Read header type %d \"%s\" %d %s\n", z, file, err, _gbm_err(err));
+#endif
             _gbm_io_close(fd);
             return 0;
         }
@@ -6789,7 +6791,9 @@
             /* Read the palette from the file */
             if((err = _gbm_read_palette(fd, z, &gbm, gbmrgb)) != 0)
             {
+#ifdef DEBUG
                 dw_debug("GBM: Read palette type %d \"%s\" %d %s\n", z, file, err, _gbm_err(err));
+#endif
                 _gbm_io_close(fd);
                 return 0;
             }
@@ -6801,7 +6805,6 @@
         *width = gbm.w;
         *height = gbm.h;
         byteswidth = (((gbm.w*gbm.bpp + 31)/32)*4);
-        /*dw_debug("Read header %dx%d bpp %d bytes wide %d bytes total %d \"%s\"\n", *width, *height, gbm.bpp, byteswidth, byteswidth * gbm.h, file);*/
 
         /* Allocate a buffer to store the image */
         DosAllocMem((PPVOID)&BitmapFileBegin, (ULONG)byteswidth * gbm.h,
@@ -6810,7 +6813,9 @@
         /* Read the data into our buffer */
         if((err = _gbm_read_data(fd, z, &gbm, BitmapFileBegin)) != 0)
         {
+#ifdef DEBUG
             dw_debug("GBM: Read data type %d \"%s\" %d %s\n", z, file, err, _gbm_err(err));
+#endif
             _gbm_io_close(fd);
             DosFreeMem(BitmapFileBegin);
             return 0;