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
This commit is contained in:
parent
cb49cb970e
commit
96094e5617
5
CHANGES
5
CHANGES
@ -1,7 +1,8 @@
|
||||
CHANGES IN FLTK 1.1.0
|
||||
|
||||
- Added Greg Ercolano's MacOS filedescriptor support.
|
||||
- Fixed text width bug.
|
||||
- Fl_XBM_Image didn't correctly load XBM files.
|
||||
- MacOS: Added Greg Ercolano's file descriptor support.
|
||||
- MacOS: Fixed text width bug.
|
||||
- A change in fl_fix_focus() broken click-focus in FLWM.
|
||||
- Cygwin with -mnocygwin didn't like the FL/math.h
|
||||
header file.
|
||||
|
@ -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).
|
||||
//
|
||||
@ -210,7 +210,7 @@ Fl_Shared_Image::reload() {
|
||||
// Load image from disk...
|
||||
int i; // Looping var
|
||||
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
|
||||
|
||||
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 $".
|
||||
//
|
||||
|
@ -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.
|
||||
//
|
||||
@ -76,7 +76,7 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
|
||||
h(wh[1]);
|
||||
|
||||
int n = ((wh[0]+7)/8)*wh[1];
|
||||
array = new uchar[((w() + 7) / 8) * h()];
|
||||
array = new uchar[n];
|
||||
|
||||
// read the data:
|
||||
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;
|
||||
while (*a && i<n) {
|
||||
int t;
|
||||
if (sscanf(a," 0x%x",&t)>0) *data++ = t;
|
||||
if (sscanf(a," 0x%x",&t)>0) {
|
||||
*data++ = t;
|
||||
i ++;
|
||||
}
|
||||
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…
Reference in New Issue
Block a user