From 04f4d8237b879e3bb7c61a84cfbb5146cd408111 Mon Sep 17 00:00:00 2001 From: celestar Date: Thu, 28 Jul 2005 09:17:32 +0000 Subject: (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. --- table/sprites.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'table/sprites.h') diff --git a/table/sprites.h b/table/sprites.h index 421ad74ce..82426efcb 100644 --- a/table/sprites.h +++ b/table/sprites.h @@ -984,6 +984,12 @@ enum Modifiers { PALETTE_MODIFIER_TRANSPARENT = 1 << TRANSPARENT_BIT, ///this bit is set when a recoloring process is in action PALETTE_MODIFIER_COLOR = 1 << RECOLOR_BIT, + + //This is used for the GfxFillRect function + ///Used to draw a "grey out" rectangle. @see GfxFillRect + PALETTE_MODIFIER_GREYOUT = 1 << TRANSPARENT_BIT, + ///Set when a colortable mode is used. @see GfxFillRect + USE_COLORTABLE = 1 << RECOLOR_BIT, }; /** Masks needed for sprite operations. @@ -997,6 +1003,8 @@ enum SpriteMasks { SPRITE_MASK = MAX_SPRITES, ///The mask for the auxiliary sprite (the one that takes care of recoloring) PALETTE_SPRITE_MASK = ((1 << PALETTE_SPRITE_WIDTH) - 1) << PALETTE_SPRITE_START, + ///Mask for the auxiliary sprites if it is locate in the LSBs + COLORTABLE_MASK = (1 << PALETTE_SPRITE_WIDTH) - 1 }; assert_compile( (1 << TRANSPARENT_BIT & SPRITE_MASK) == 0 ); -- cgit v1.2.3-54-g00ecf