summaryrefslogtreecommitdiff
path: root/src/Fl_BMP_Image.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-08-30 16:58:16 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-08-30 16:58:16 +0000
commitec494401c1dc11b3d8adbbd8134ec497b4bff922 (patch)
tree2d64ead928f3ad3f4dca4de60ad4594b3f882076 /src/Fl_BMP_Image.cxx
parent047c32c334ae7b2534959a9dac8cc31647d1d630 (diff)
Make sure all strings can be localized in the dialogs.
Move the "preview" button over so there is room for localization. Fix the order of buttons in convenience dialogs. Update "ask" to use the fl_input function. Fix 4-bit BMP file loading. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2608 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_BMP_Image.cxx')
-rw-r--r--src/Fl_BMP_Image.cxx29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/Fl_BMP_Image.cxx b/src/Fl_BMP_Image.cxx
index dc5e1f485..e10450a00 100644
--- a/src/Fl_BMP_Image.cxx
+++ b/src/Fl_BMP_Image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_BMP_Image.cxx,v 1.1.2.9 2002/08/09 01:09:48 easysw Exp $"
+// "$Id: Fl_BMP_Image.cxx,v 1.1.2.10 2002/08/30 16:58:16 easysw Exp $"
//
// Fl_BMP_Image routines.
//
@@ -239,24 +239,27 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
// Get a new color as needed...
repcount --;
- // Get the next color byte as needed...
- if (color < 0) color = getc(fp);
-
// Extract the next pixel...
if (bit == 0xf0) {
- temp = (color >> 4) & 15;
+ // Get the next color byte as needed...
+ if (color < 0) temp = getc(fp);
+ else temp = color;
+
+ // Copy the color value...
+ *ptr++ = colormap[(temp >> 4) & 15][2];
+ *ptr++ = colormap[(temp >> 4) & 15][1];
+ *ptr++ = colormap[(temp >> 4) & 15][0];
+
bit = 0x0f;
} else {
- temp = color & 15;
bit = 0xf0;
- }
-// printf("temp = %d\n", temp);
+ // Copy the color value...
+ *ptr++ = colormap[temp & 15][2];
+ *ptr++ = colormap[temp & 15][1];
+ *ptr++ = colormap[temp & 15][0];
+ }
- // Copy the color value...
- *ptr++ = colormap[temp][2];
- *ptr++ = colormap[temp][1];
- *ptr++ = colormap[temp][0];
}
if (!compression) {
@@ -393,5 +396,5 @@ read_long(FILE *fp) { // I - File to read from
//
-// End of "$Id: Fl_BMP_Image.cxx,v 1.1.2.9 2002/08/09 01:09:48 easysw Exp $".
+// End of "$Id: Fl_BMP_Image.cxx,v 1.1.2.10 2002/08/30 16:58:16 easysw Exp $".
//