# sprite.h

Go to the documentation of this file.

    00001 /* $Id: sprite.h 14268 2008-09-07 22:04:39Z rubidium $ */
    00002
    00005 #ifndef SPRITE_H
    00006 #define SPRITE_H
    00007
    00008 #include "gfx_type.h"
    00009
    00010 #define GENERAL_SPRITE_COLOR(color) ((color) + PALETTE_RECOLOR_START)
    00011 #define PLAYER_SPRITE_COLOR(owner) (GENERAL_SPRITE_COLOR(_player_colors[owner]))
    00012
    00020 #define IS_CUSTOM_SPRITE(sprite) ((sprite) >= SPR_SIGNALS_BASE)
    00021
    00022 /* The following describes bunch of sprites to be drawn together in a single 3D
    00023  * bounding box. Used especially for various multi-sprite buildings (like
    00024  * depots or stations): */
    00025
    00026 struct DrawTileSeqStruct {
    00027   int8 delta_x; // 0x80 is sequence terminator
    00028   int8 delta_y;
    00029   int8 delta_z;
    00030   byte size_x;
    00031   byte size_y;
    00032   byte size_z;
    00033   PalSpriteID image;
    00034 };
    00035
    00036 struct DrawTileSprites {
    00037   PalSpriteID ground;
    00038   const DrawTileSeqStruct *seq;
    00039 };
    00040
    00045 struct DrawBuildingsTileStruct {
    00046   PalSpriteID ground;
    00047   PalSpriteID building;
    00048   byte subtile_x;
    00049   byte subtile_y;
    00050   byte width;
    00051   byte height;
    00052   byte dz;
    00053   byte draw_proc;  /* this allows to specify a special drawing procedure.*/
    00054 };
    00055
    00057 #define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++)
    00058
    00059 void SkipSpriteData(byte type, uint16 num);
    00060
    00061 #endif /* SPRITE_H */