sprite.h
changeset 405 6830ae7a0d5d
child 406 29f813f556a6
equal deleted inserted replaced
404:7fc41d0ad34f 405:6830ae7a0d5d
       
     1 #ifndef SPRITE_H
       
     2 #define SPRITE_H
       
     3 
       
     4 
       
     5 /* The following describes bunch of sprites to be drawn together in a single 3D
       
     6  * bounding box. Used especially for various multi-sprite buildings (like
       
     7  * depots or stations): */
       
     8 
       
     9 typedef struct DrawTileSeqStruct {
       
    10 	int8 delta_x;
       
    11 	int8 delta_y;
       
    12 	int8 delta_z;
       
    13 	byte width,height;
       
    14 	byte unk; // 'depth', just z-size; TODO: rename
       
    15 	uint32 image;
       
    16 } DrawTileSeqStruct;
       
    17 
       
    18 typedef struct DrawTileSprites {
       
    19 	SpriteID ground_sprite;
       
    20 	DrawTileSeqStruct const *seq;
       
    21 } DrawTileSprites;
       
    22 
       
    23 #define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++)
       
    24 
       
    25 
       
    26 /* This is for custom sprites: */
       
    27 
       
    28 struct SpriteGroup {
       
    29 	// XXX: Would anyone ever need more than 16 spritesets? Maybe we should
       
    30 	// use even less, now we take whole 8kb for custom sprites table, oh my!
       
    31 	byte sprites_per_set; // means number of directions - 4 or 8
       
    32 
       
    33 	// Loaded = in motion, loading = not moving
       
    34 	// Each group contains several spritesets, for various loading stages
       
    35 
       
    36 	// XXX: For stations the meaning is different - loaded is for stations
       
    37 	// with small amount of cargo whilst loading is for stations with a lot
       
    38 	// of da stuff.
       
    39 
       
    40 	byte loaded_count;
       
    41 	uint16 loaded[16]; // sprite ids
       
    42 	byte loading_count;
       
    43 	uint16 loading[16]; // sprite ids
       
    44 };
       
    45 
       
    46 #endif