if (tileType & hextileBgSpecified)
bg = is->READ_PIXEL();
-#ifdef FAVOUR_FILL_RECT
- FILL_RECT(t, bg);
-#else
int len = t.area();
PIXEL_T* ptr = (PIXEL_T*)buf;
while (len-- > 0) *ptr++ = bg;
-#endif
if (tileType & hextileFgSpecified)
fg = is->READ_PIXEL();
int xy = is->readU8();
int wh = is->readU8();
-#ifdef FAVOUR_FILL_RECT
- Rect s;
- s.tl.x = t.tl.x + ((xy >> 4) & 15);
- s.tl.y = t.tl.y + (xy & 15);
- s.br.x = s.tl.x + ((wh >> 4) & 15) + 1;
- s.br.y = s.tl.y + (wh & 15) + 1;
- FILL_RECT(s, fg);
-#else
int x = ((xy >> 4) & 15);
int y = (xy & 15);
int w = ((wh >> 4) & 15) + 1;
while (len-- > 0) *ptr++ = fg;
ptr += rowAdd;
}
-#endif
}
}
-#ifndef FAVOUR_FILL_RECT
IMAGE_RECT(t, buf);
-#endif
}
}
}
}
}
-#ifdef FAVOUR_FILL_RECT
- //fprintf(stderr,"copying data to screen %dx%d at %d,%d\n",
- //t.width(),t.height(),t.tl.x,t.tl.y);
- IMAGE_RECT(t,buf);
-#endif
-
} else {
if (palSize == 0) {
throw Exception ("ZRLE decode error");
}
-#ifdef FAVOUR_FILL_RECT
- int i = ptr - buf;
- ptr += len;
-
- int runX = i % t.width();
- int runY = i / t.width();
-
- if (runX + len > t.width()) {
- if (runX != 0) {
- FILL_RECT(Rect(t.tl.x+runX, t.tl.y+runY, t.width()-runX, 1),
- pix);
- len -= t.width()-runX;
- runX = 0;
- runY++;
- }
-
- if (len > t.width()) {
- FILL_RECT(Rect(t.tl.x, t.tl.y+runY, t.width(), len/t.width()),
- pix);
- runY += len / t.width();
- len = len % t.width();
- }
- }
-
- if (len != 0) {
- FILL_RECT(Rect(t.tl.x+runX, t.tl.y+runY, len, 1), pix);
- }
-#else
while (len-- > 0) *ptr++ = pix;
-#endif
}
} else {
PIXEL_T pix = palette[index];
-#ifdef FAVOUR_FILL_RECT
- int i = ptr - buf;
- ptr += len;
-
- int runX = i % t.width();
- int runY = i / t.width();
-
- if (runX + len > t.width()) {
- if (runX != 0) {
- FILL_RECT(Rect(t.tl.x+runX, t.tl.y+runY, t.width()-runX, 1),
- pix);
- len -= t.width()-runX;
- runX = 0;
- runY++;
- }
-
- if (len > t.width()) {
- FILL_RECT(Rect(t.tl.x, t.tl.y+runY, t.width(), len/t.width()),
- pix);
- runY += len / t.width();
- len = len % t.width();
- }
- }
-
- if (len != 0) {
- FILL_RECT(Rect(t.tl.x+runX, t.tl.y+runY, len, 1), pix);
- }
-#else
while (len-- > 0) *ptr++ = pix;
-#endif
}
}
}
-#ifndef FAVOUR_FILL_RECT
//fprintf(stderr,"copying data to screen %dx%d at %d,%d\n",
//t.width(),t.height(),t.tl.x,t.tl.y);
IMAGE_RECT(t,buf);
-#endif
}
}