<wip> emscripten dev.
[sdk] / ecere / src / gfx / bitmaps / PNGFormat.ec
index 46b1bd7..ea450fa 100644 (file)
@@ -50,7 +50,7 @@ static void WriteData(png_structp png, png_bytep bytes, png_size_t size)
    f.Write(bytes, 1, (uint)size);
 }
 
-static char * extensions[] = { "png", null };
+static const char * extensions[] = { "png", null };
 
 class PNGFormat : BitmapFormat
 {
@@ -59,6 +59,9 @@ class PNGFormat : BitmapFormat
    bool Load(Bitmap bitmap, File f)
    {
       bool result = false;
+#if defined(__EMSCRIPTEN__)
+      PrintLn("  -------------------------------------  getting in here  -------------------------------------  ");
+#endif
 
       png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, null, null, null);
 
@@ -82,7 +85,7 @@ class PNGFormat : BitmapFormat
                png_read_info(png_ptr, info_ptr);
                channels = png_get_channels(png_ptr, info_ptr);
                if(channels == 3 || channels == 4 || channels == 1 || channels == 2)
-               {            
+               {
                   png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
                       &interlace_type, null, null);
                   numPasses = png_set_interlace_handling(png_ptr);
@@ -245,7 +248,7 @@ class PNGFormat : BitmapFormat
       return result;
    }
 
-   bool Save(Bitmap bitmap, char *filename, void * options)
+   bool Save(Bitmap bitmap, const char *filename, void * options)
    {
       bool result = false;
       Bitmap tempBitmap = null;
@@ -261,7 +264,7 @@ class PNGFormat : BitmapFormat
       if(bitmap)
       {
          File f = FileOpen(filename, write);
-         if(f) 
+         if(f)
          {
             png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, null, null, null);
             if(png_ptr)
@@ -301,7 +304,7 @@ class PNGFormat : BitmapFormat
       return result;
    }
 
-   ColorAlpha * LoadPalette(char * fileName, char * type)
+   ColorAlpha * LoadPalette(const char * fileName, const char * type)
    {
       ColorAlpha * result = null;
       return result;