aboutsummaryrefslogtreecommitdiff
path: root/sprite.c
blob: 8289fd23fe5e61f891bf0d515507dbeaa5b77f73 (plain) (blame)
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
#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 }
	}
};

void init_csprite(CSprite* sprite, Sprite_ID id) {
	const Sprite* s;

	s = &sprites[id];
	sprite->id   = s->bitmap;
	sprite->rect = s->rect;
}