# sprite.h

Go to the documentation of this file.

    00001 /* $Id: sprite.h 15428 2009-02-09 02:57:15Z rubidium $ */
    00002
    00005 #ifndef SPRITE_H
    00006 #define SPRITE_H
    00007
    00008 #include "gfx_type.h"
    00009
    00010 #define GENERAL_SPRITE_COLOUR(colour) ((colour) + PALETTE_RECOLOUR_START)
    00011 #define COMPANY_SPRITE_COLOUR(owner) (GENERAL_SPRITE_COLOUR(_company_colours[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
    00027 struct DrawTileSeqStruct {
    00028   int8 delta_x;
    00029   int8 delta_y;
    00030   int8 delta_z;
    00031   byte size_x;
    00032   byte size_y;
    00033   byte size_z;
    00034   PalSpriteID image;
    00035 };
    00036
    00038 struct DrawTileSprites {
    00039   PalSpriteID ground;
    00040   const DrawTileSeqStruct *seq;
    00041 };
    00042
    00047 struct DrawBuildingsTileStruct {
    00048   PalSpriteID ground;
    00049   PalSpriteID building;
    00050   byte subtile_x;
    00051   byte subtile_y;
    00052   byte width;
    00053   byte height;
    00054   byte dz;
    00055   byte draw_proc;  /* this allows to specify a special drawing procedure.*/
    00056 };
    00057
    00059 #define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++)
    00060
    00061 void SkipSpriteData(byte type, uint16 num);
    00062
    00063 #endif /* SPRITE_H */