-
Notifications
You must be signed in to change notification settings - Fork 0
/
sprite_animation.h
49 lines (38 loc) · 1.13 KB
/
sprite_animation.h
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
#ifndef SPRITE_ANIMATION
#define SPRITE_ANIMATION
#include <array>
#include "tiled_image.h"
#define DEBUG
#ifdef DEBUG
#include "natfeats.h"
#define dbg(format, arg...) do { nf_printf("DEBUG: (%s):" format, __FUNCTION__, ##arg); } while (0)
#define out(format, arg...) do { nf_printf("" format, ##arg); } while (0)
#else
#define dbg(format, arg...) do { ; } while (0)
#endif /* DEBUG */
namespace AtariGraphics {
struct Coord {
uint16_t x;
uint16_t y;
};
struct AnimationPath {
const std::array<Coord, 4>& nodes;
AnimationPath(const std::array<Coord, 4>& c) : nodes(c)
{
}
};
struct SpriteAnimation {
const TiledImage image;
const AnimationPath path;
SpriteAnimation(const TiledImage& img, const AnimationPath& p) : image(img),
path(p)
{
int n = 0;
for (const auto& node : path.nodes) {
// sprite[n].undraw();
dbg("node = (%d, %d)\r\n", node.x, node.y);
}
}
};
}
#endif // SPRITE_ANIMATION