1 #ifndef SPRITE_H
2 #define SPRITE_H
3 
4 #define SPRITE_FLIPX					0x01
5 #define SPRITE_FLIPY					0x02
6 #define SPRITE_FLICKER					0x04
7 #define SPRITE_VISIBLE					0x08
8 #define SPRITE_TRANSPARENCY_THROUGH		0x10
9 #define SPRITE_SPECIAL					0x20
10 
11 #define SPRITE_SHADOW					0x40
12 #define SPRITE_PARTIAL_SHADOW			0x80
13 
14 #define SPRITE_TYPE_STACK 0
15 #define SPRITE_TYPE_UNPACK 1
16 #define SPRITE_TYPE_ZOOM 2
17 
18 #ifdef _MSC_VER
19 __declspec(align(32))
20 #endif
21 struct sprite {
22 	int priority, flags;
23 
24 	const UINT8 *pen_data;	/* points to top left corner of tile data */
25 	int line_offset;
26 
27 	const UINT16 *pal_data;
28 	UINT32 pen_usage;
29 
30 	int x_offset, y_offset;
31 	int tile_width, tile_height;
32 	int total_width, total_height;	/* in screen coordinates */
33 	int x, y;
34 
35 	int shadow_pen;
36 
37 	/* private */ const struct sprite *next;
38 	/* private */ long mask_offset;
39 }
40 #ifndef _MSC_VER
41 __attribute__ ((__aligned__ (32)))
42 #endif
43    ;
44 
45 /* sprite list flags */
46 #define SPRITE_LIST_BACK_TO_FRONT	0x0
47 #define SPRITE_LIST_FRONT_TO_BACK	0x1
48 #define SPRITE_LIST_RAW_DATA		0x2
49 #define SPRITE_LIST_FLIPX			0x4
50 #define SPRITE_LIST_FLIPY			0x8
51 
52 struct sprite_list {
53 	int sprite_type;
54 	int num_sprites;
55 	int flags;
56 	int max_priority;
57 	int transparent_pen;
58 	int special_pen;
59 
60 	struct sprite *sprite;
61 	struct sprite_list *next; /* resource tracking */
62 };
63 
64 void sprite_init( void );	/* called by core - don't call this in drivers */
65 void sprite_close( void );	/* called by core - don't call this in drivers */
66 
67 struct sprite_list *sprite_list_create( int num_sprites, int flags );
68 void sprite_update( void );
69 void sprite_draw( struct sprite_list *sprite_list, int priority );
70 
71 void sprite_set_shade_table(UINT16 *table);
72 
73 #endif
74