1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#include "sprite.h"
static const Sprite sprites[] = {
/* sprite_player_bullet_left */
{
asset_id_bullet,
{ 9, 0, 9, 14 }
},
/* sprite_player_bullet_right */
{
asset_id_bullet,
{ 0, 0, 9, 14 }
},
/* sprite_player_bullet_up */
{
asset_id_bullet,
{ 0, 14, 14, 9 }
},
/* sprite_player_bullet_down */
{
asset_id_bullet,
{ 14, 14, 14, 9 }
},
/* sprite_skull_left */
{
asset_id_enemy,
{ 16, 0, 16, 16 }
},
/* sprite_skull_right */
{
asset_id_enemy,
{ 0, 0, 16, 16 }
},
/* sprite_skull_debris_1 */
{
asset_id_enemy,
{ 32, 0, 5, 8 }
},
/* sprite_skull_debris_2 */
{
asset_id_enemy,
{ 38, 0, 6, 6 }
},
/* sprite_skull_debris_3 */
{
asset_id_enemy,
{ 32, 8, 5, 8 }
},
/* sprite_skull_debris_4 */
{
asset_id_enemy,
{ 38, 11, 5, 5 }
},
/* sprite_skull_debris_5 */
{
asset_id_enemy,
{ 44, 10, 3, 6 }
},
/* sprite_enemy_bullet */
{
asset_id_bullet,
{ 18, 0, 5, 5 }
},
/* sprite_author */
{
asset_id_usr,
{ 0, 70, 70, 10 }
},
/* sprite_free */
{
asset_id_usr,
{ 0, 80, 171, 10 }
},
/* sprite_floor_tile */
{
asset_id_map,
{ 0, 0, 16, 16 }
},
/* sprite_bricks */
{
asset_id_map,
{ 16, 0, 16, 16 }
},
/* sprite_heart_empty */
{
asset_id_usr,
{ 90, 60, 7, 6 }
},
/* sprite_heart_full */
{
asset_id_usr,
{ 98, 60, 7, 6 }
},
/* sprite_ram_empty */
{
asset_id_usr,
{ 105, 60, 14, 14 }
},
/* sprite_ram_full */
{
asset_id_usr,
{ 119, 60, 14, 14 }
},
/* sprite_logo */
{
asset_id_usr,
{ 1, 94, 153, 16 }
}
};
void init_csprite(CSprite* sprite, Sprite_ID id) {
const Sprite* s;
s = &sprites[id];
sprite->id = s->bitmap;
sprite->rect = s->rect;
}
const Sprite* get_sprite(Sprite_ID id) {
return &sprites[id];
}
|