diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-11-22 15:35:02 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-11-22 15:35:02 +0000 |
| commit | f5258404959cff3a299c796676b553b843a94355 (patch) | |
| tree | f6820c57e99b0038b9bc734d7123d536a33af267 /src/Fl_GIF_Image.cxx | |
| parent | 4323f46e2c31bc070036a9923711293f169ffb85 (diff) | |
Fix all references to '.C' files (now .cxx)
Update Fl_Image() class to track depth and data, so FLUID will be
able to use it as the base class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1712 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_GIF_Image.cxx')
| -rw-r--r-- | src/Fl_GIF_Image.cxx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/Fl_GIF_Image.cxx b/src/Fl_GIF_Image.cxx index ce4580e74..36022cc72 100644 --- a/src/Fl_GIF_Image.cxx +++ b/src/Fl_GIF_Image.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_GIF_Image.cxx,v 1.1.2.2 2001/11/20 05:13:23 easysw Exp $" +// "$Id: Fl_GIF_Image.cxx,v 1.1.2.3 2001/11/22 15:35:01 easysw Exp $" // // Fl_GIF_Image routines. // @@ -79,7 +79,8 @@ typedef unsigned char uchar; #define GETSHORT(var) var = NEXTBYTE; var += NEXTBYTE << 8 Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) { - FILE *GifFile; // file to read + FILE *GifFile; // File to read + char **new_data; // Data array if ((GifFile = fopen(infname, "rb")) == NULL) { Fl::error("Unable to open %s!", infname); @@ -291,8 +292,8 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) { // allocate line pointer arrays: w(Width); h(Height); - alloc_data = 1; - data = new char*[Height+2]; + d(1); + new_data = new char*[Height+2]; // transparent pixel must be zero, swap if it isn't: if (has_transparent && transparent_pixel != 0) { @@ -334,11 +335,11 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) { // write the first line of xpm data (use suffix as temp array): int length = sprintf((char*)(Suffix), "%d %d %d %d",Width,Height,-numcolors,1); - ((char **)data)[0] = new char[length+1]; - strcpy(((char **)data)[0], (char*)Suffix); + new_data[0] = new char[length+1]; + strcpy(new_data[0], (char*)Suffix); // write the colormap - ((char **)data)[1] = (char*)(p = new uchar[4*numcolors]); + new_data[1] = (char*)(p = new uchar[4*numcolors]); for (i = 0; i < ColorMapSize; i++) if (used[i]) { *p++ = remap[i]; *p++ = Red[i]; @@ -352,14 +353,17 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) { // split the image data into lines: for (i=0; i<Height; i++) { - ((char **)data)[i+2] = new char[Width]; - memcpy(((char **)data)[i + 2], (char*)(Image + i*Width), Width); + new_data[i+2] = new char[Width]; + memcpy(new_data[i + 2], (char*)(Image + i*Width), Width); } + data(new_data, Height + 2); + alloc_data = 1; + delete[] Image; } // -// End of "$Id: Fl_GIF_Image.cxx,v 1.1.2.2 2001/11/20 05:13:23 easysw Exp $". +// End of "$Id: Fl_GIF_Image.cxx,v 1.1.2.3 2001/11/22 15:35:01 easysw Exp $". // |
