(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.

This commit is contained in:
celestar
2005-07-28 09:17:32 +00:00
parent 139f0c95ca
commit 04f4d8237b
7 changed files with 28 additions and 17 deletions

View File

@@ -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 );