Browse Source

Increase size of header buffer to 64 bytes.

Fix XBM file loader.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2327 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
pull/168/head
Michael R Sweet 23 years ago
parent
commit
96094e5617
  1. 5
      CHANGES
  2. 6
      src/Fl_Shared_Image.cxx
  3. 11
      src/Fl_XBM_Image.cxx

5
CHANGES

@ -1,7 +1,8 @@
CHANGES IN FLTK 1.1.0 CHANGES IN FLTK 1.1.0
- Added Greg Ercolano's MacOS filedescriptor support. - Fl_XBM_Image didn't correctly load XBM files.
- Fixed text width bug. - MacOS: Added Greg Ercolano's file descriptor support.
- MacOS: Fixed text width bug.
- A change in fl_fix_focus() broken click-focus in FLWM. - A change in fl_fix_focus() broken click-focus in FLWM.
- Cygwin with -mnocygwin didn't like the FL/math.h - Cygwin with -mnocygwin didn't like the FL/math.h
header file. header file.

6
src/Fl_Shared_Image.cxx

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Shared_Image.cxx,v 1.23.2.12 2002/05/25 13:38:24 easysw Exp $" // "$Id: Fl_Shared_Image.cxx,v 1.23.2.13 2002/06/28 15:23:03 easysw Exp $"
// //
// Shared image code for the Fast Light Tool Kit (FLTK). // Shared image code for the Fast Light Tool Kit (FLTK).
// //
@ -210,7 +210,7 @@ Fl_Shared_Image::reload() {
// Load image from disk... // Load image from disk...
int i; // Looping var int i; // Looping var
FILE *fp; // File pointer FILE *fp; // File pointer
uchar header[16]; // Buffer for auto-detecting files uchar header[64]; // Buffer for auto-detecting files
Fl_Image *img; // New image Fl_Image *img; // New image
if (!name_) return; if (!name_) return;
@ -461,5 +461,5 @@ Fl_Shared_Image::remove_handler(Fl_Shared_Handler f) {
// //
// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.12 2002/05/25 13:38:24 easysw Exp $". // End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.13 2002/06/28 15:23:03 easysw Exp $".
// //

11
src/Fl_XBM_Image.cxx

@ -1,5 +1,5 @@
// //
// "$Id: Fl_XBM_Image.cxx,v 1.1.2.5 2002/05/25 13:38:24 easysw Exp $" // "$Id: Fl_XBM_Image.cxx,v 1.1.2.6 2002/06/28 15:23:03 easysw Exp $"
// //
// Fl_XBM_Image routines. // Fl_XBM_Image routines.
// //
@ -76,7 +76,7 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
h(wh[1]); h(wh[1]);
int n = ((wh[0]+7)/8)*wh[1]; int n = ((wh[0]+7)/8)*wh[1];
array = new uchar[((w() + 7) / 8) * h()]; array = new uchar[n];
// read the data: // read the data:
for (i = 0, data = (uchar *)array; i < n;) { for (i = 0, data = (uchar *)array; i < n;) {
@ -87,7 +87,10 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
const char *a = buffer; const char *a = buffer;
while (*a && i<n) { while (*a && i<n) {
int t; int t;
if (sscanf(a," 0x%x",&t)>0) *data++ = t; if (sscanf(a," 0x%x",&t)>0) {
*data++ = t;
i ++;
}
while (*a && *a++ != ','); while (*a && *a++ != ',');
} }
} }
@ -97,5 +100,5 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
// //
// End of "$Id: Fl_XBM_Image.cxx,v 1.1.2.5 2002/05/25 13:38:24 easysw Exp $". // End of "$Id: Fl_XBM_Image.cxx,v 1.1.2.6 2002/06/28 15:23:03 easysw Exp $".
// //

Loading…
Cancel
Save