summaryrefslogtreecommitdiff
path: root/src/fl_draw_pixmap.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/fl_draw_pixmap.cxx')
-rw-r--r--src/fl_draw_pixmap.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/fl_draw_pixmap.cxx b/src/fl_draw_pixmap.cxx
index 923186889..d24dd8b47 100644
--- a/src/fl_draw_pixmap.cxx
+++ b/src/fl_draw_pixmap.cxx
@@ -101,7 +101,8 @@ int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg) {
ncolors--;
}
// read all the rest of the colors:
- for (int i=0; i < ncolors; i++) {
+ int i;
+ for (i =0; i < ncolors; i++) {
uchar* c = colors[*p++];
if (Fl_Graphics_Driver::need_pixmap_bg_color) {
used_colors[color_count].r = *(p+0);
@@ -115,7 +116,8 @@ int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg) {
*c = 255;
}
} else { // normal XPM colormap with names
- for (int i=0; i<ncolors; i++) {
+ int i;
+ for (i =0; i<ncolors; i++) {
const uchar *p = *data++;
// the first 1 or 2 characters are the color index:
int ind = *p++;
@@ -164,13 +166,14 @@ int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg) {
}
U32 *q = (U32*)out;
- for (int Y = 0; Y < h; Y++) {
+ int Y, X;
+ for (Y = 0; Y < h; Y++) {
const uchar* p = data[Y];
if (chars_per_pixel <= 1) {
- for (int X = 0; X < w; X++)
+ for (X = 0; X < w; X++)
memcpy(q++, colors[*p++], 4);
} else {
- for (int X = 0; X < w; X++) {
+ for (X = 0; X < w; X++) {
int ind = (*p++)<<8;
ind |= *p++;
memcpy(q++, colors[ind], 4);
@@ -202,9 +205,10 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
*p = bitmap;
const uchar *alphaPtr = &buffer[3];
uchar b = 0;
- for (int Y = 0; Y < h; Y++) {
+ int Y, X, bit;
+ for (Y = 0; Y < h; Y++) {
b = 0;
- for (int X = 0, bit = 1; X < w; X++, alphaPtr += 4) {
+ for (X = 0, bit = 1; X < w; X++, alphaPtr += 4) {
if (*alphaPtr > 127)
b |= bit;
bit <<= 1;