summaryrefslogtreecommitdiff
path: root/gfx.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2005-07-28 09:17:32 +0000
committercelestar <celestar@openttd.org>2005-07-28 09:17:32 +0000
commit04f4d8237b879e3bb7c61a84cfbb5146cd408111 (patch)
treee279dbeda45e111fee0148b401cba8615f3adaec /gfx.c
parent139f0c95ca77b7c28510e92c3230495f88806cd9 (diff)
downloadopenttd-04f4d8237b879e3bb7c61a84cfbb5146cd408111.tar.xz
(svn r2736) -Codechange: De-mystified GfxDrawFillRect a bit, and used enums from table/sprites.h. You can now change the number of bits used for sprites and switches in the SpriteSetup enum and the rest should work automagically. Can be used to increase the number of active sprites to 2^19 in case there are no colortables (recolor sprites) in any newgrf. We should possibly move the the colortables to an own list, but how to detect them in a newgrf.
Diffstat (limited to 'gfx.c')
-rw-r--r--gfx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gfx.c b/gfx.c
index c404c608a..5c0c9b7a3 100644
--- a/gfx.c
+++ b/gfx.c
@@ -139,15 +139,15 @@ void GfxFillRect(int left, int top, int right, int bottom, int color)
dst = dpi->dst_ptr + top * dpi->pitch + left;
- if (!(color & 0x8000)) {
- if (!(color & 0x4000)) {
+ if (!(color & PALETTE_MODIFIER_GREYOUT)) {
+ if (!(color & USE_COLORTABLE)) {
do {
memset(dst, color, right);
dst += dpi->pitch;
} while (--bottom);
} else {
/* use colortable mode */
- const byte* ctab = GetNonSprite(color & 0x3FFF) + 1;
+ const byte* ctab = GetNonSprite(color & COLORTABLE_MASK) + 1;
do {
int i;
@@ -567,7 +567,7 @@ void DrawFrameRect(int left, int top, int right, int bottom, int ctab, int flags
}
} else if (flags & 0x1) {
// transparency
- GfxFillRect(left, top, right, bottom, 0x4322);
+ GfxFillRect(left, top, right, bottom, 0x322 | USE_COLORTABLE);
} else {
GfxFillRect(left, top, right, bottom, color_interior);
}