src/sprite.h
branchgamebalance
changeset 9895 7bd07f43b0e3
parent 5919 2b58160d667d
child 6307 f40e88cff863
equal deleted inserted replaced
9894:70d78ac95d6c 9895:7bd07f43b0e3
     6 
     6 
     7 /* The following describes bunch of sprites to be drawn together in a single 3D
     7 /* The following describes bunch of sprites to be drawn together in a single 3D
     8  * bounding box. Used especially for various multi-sprite buildings (like
     8  * bounding box. Used especially for various multi-sprite buildings (like
     9  * depots or stations): */
     9  * depots or stations): */
    10 
    10 
    11 typedef struct DrawTileSeqStruct {
    11 struct DrawTileSeqStruct {
    12 	int8 delta_x; // 0x80 is sequence terminator
    12 	int8 delta_x; // 0x80 is sequence terminator
    13 	int8 delta_y;
    13 	int8 delta_y;
    14 	int8 delta_z;
    14 	int8 delta_z;
    15 	byte size_x;
    15 	byte size_x;
    16 	byte size_y;
    16 	byte size_y;
    17 	byte size_z;
    17 	byte size_z;
    18 	SpriteID image;
    18 	SpriteID image;
    19 	SpriteID pal;
    19 	SpriteID pal;
    20 } DrawTileSeqStruct;
    20 };
    21 
    21 
    22 typedef struct DrawTileSprites {
    22 struct DrawTileSprites {
    23 	SpriteID ground_sprite;
    23 	SpriteID ground_sprite;
    24 	SpriteID ground_pal;
    24 	SpriteID ground_pal;
    25 	const DrawTileSeqStruct* seq;
    25 	const DrawTileSeqStruct* seq;
    26 } DrawTileSprites;
    26 };
    27 
    27 
    28 /**
    28 /**
    29  * This structure is the same for both Industries and Houses.
    29  * This structure is the same for both Industries and Houses.
    30  * Buildings here reference a general type of construction
    30  * Buildings here reference a general type of construction
    31  */
    31  */
    32 typedef struct DrawBuildingsTileStruct {
    32 struct DrawBuildingsTileStruct {
    33 	PalSpriteID ground;
    33 	PalSpriteID ground;
    34 	PalSpriteID building;
    34 	PalSpriteID building;
    35 	byte subtile_x:4;
    35 	byte subtile_x:4;
    36 	byte subtile_y:4;
    36 	byte subtile_y:4;
    37 	byte width:4;
    37 	byte width:4;
    38 	byte height:4;
    38 	byte height:4;
    39 	byte dz;
    39 	byte dz;
    40 	byte draw_proc;  /* this allows to specify a special drawing procedure.*/
    40 	byte draw_proc;  /* this allows to specify a special drawing procedure.*/
    41 } DrawBuildingsTileStruct;
    41 };
    42 
    42 
    43 // Iterate through all DrawTileSeqStructs in DrawTileSprites.
    43 // Iterate through all DrawTileSeqStructs in DrawTileSprites.
    44 #define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++)
    44 #define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++)
    45 
    45 
    46 
    46