|
@@ -132,52 +132,52 @@ struct ChildScreenSpriteToDraw {
|
|
|
const SubSprite *sub; ///< only draw a rectangular part of the sprite
|
|
|
int32 x;
|
|
|
int32 y;
|
|
|
int next; ///< next child to draw (-1 at the end)
|
|
|
};
|
|
|
|
|
|
/** Enumeration of multi-part foundations */
|
|
|
enum FoundationPart {
|
|
|
FOUNDATION_PART_NONE = 0xFF, ///< Neither foundation nor groundsprite drawn yet.
|
|
|
FOUNDATION_PART_NORMAL = 0, ///< First part (normal foundation or no foundation)
|
|
|
FOUNDATION_PART_HALFTILE = 1, ///< Second part (halftile foundation)
|
|
|
FOUNDATION_PART_END
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* Mode of "sprite combining"
|
|
|
* @see StartSpriteCombine
|
|
|
*/
|
|
|
enum SpriteCombineMode {
|
|
|
SPRITE_COMBINE_NONE, ///< Every #AddSortableSpriteToDraw start its own bounding box
|
|
|
SPRITE_COMBINE_PENDING, ///< %Sprite combining will start with the next unclipped sprite.
|
|
|
SPRITE_COMBINE_ACTIVE, ///< %Sprite combining is active. #AddSortableSpriteToDraw outputs child sprites.
|
|
|
};
|
|
|
|
|
|
typedef SmallVector<TileSpriteToDraw, 64> TileSpriteToDrawVector;
|
|
|
typedef SmallVector<StringSpriteToDraw, 4> StringSpriteToDrawVector;
|
|
|
typedef SmallVector<ParentSpriteToDraw, 64> ParentSpriteToDrawVector;
|
|
|
typedef SmallVector<ChildScreenSpriteToDraw, 16> ChildScreenSpriteToDrawVector;
|
|
|
typedef std::vector<TileSpriteToDraw> TileSpriteToDrawVector;
|
|
|
typedef std::vector<StringSpriteToDraw> StringSpriteToDrawVector;
|
|
|
typedef std::vector<ParentSpriteToDraw> ParentSpriteToDrawVector;
|
|
|
typedef std::vector<ChildScreenSpriteToDraw> ChildScreenSpriteToDrawVector;
|
|
|
|
|
|
/** Data structure storing rendering information */
|
|
|
struct ViewportDrawer {
|
|
|
DrawPixelInfo dpi;
|
|
|
|
|
|
StringSpriteToDrawVector string_sprites_to_draw;
|
|
|
TileSpriteToDrawVector tile_sprites_to_draw;
|
|
|
ParentSpriteToDrawVector parent_sprites_to_draw;
|
|
|
ParentSpriteToSortVector parent_sprites_to_sort; ///< Parent sprite pointer array used for sorting
|
|
|
ChildScreenSpriteToDrawVector child_screen_sprites_to_draw;
|
|
|
|
|
|
int *last_child;
|
|
|
|
|
|
SpriteCombineMode combine_sprites; ///< Current mode of "sprite combining". @see StartSpriteCombine
|
|
|
|
|
|
int foundation[FOUNDATION_PART_END]; ///< Foundation sprites (index into parent_sprites_to_draw).
|
|
|
FoundationPart foundation_part; ///< Currently active foundation for ground sprite drawing.
|
|
|
int *last_foundation_child[FOUNDATION_PART_END]; ///< Tail of ChildSprite list of the foundations. (index into child_screen_sprites_to_draw)
|
|
|
Point foundation_offset[FOUNDATION_PART_END]; ///< Pixel offset for ground sprites on the foundations.
|
|
|
};
|
|
|
|
|
|
static void MarkViewportDirty(const ViewPort *vp, int left, int top, int right, int bottom);
|
|
|
|
|
|
static ViewportDrawer _vd;
|