summaryrefslogtreecommitdiff
path: root/saedit/animation.h
blob: 6c4d05f105f52d7992c38609981894c364ba9045 (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
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
#ifndef ANIMATION_H
#define ANIMATION_H

#include <gdk/gdk.h>
#include <glib.h>
#include "common.h"
#include "xml.h"
#include "imageset.h"

typedef struct {
	gchar *direction;
	GList *elements;
} Animation;

Animation *
animation_new (
	const Imageset *imageset,
	const XMLNode *node,
	gint included_from
);

void
animation_free (Animation *animation);

gint
animation_compare_by_direction (
	const Animation *first,
	const Animation *second
);

gboolean
animation_direction_equals (
	const Animation *animation,
	const gchar *direction
);

enum {
	ELEMENT_END = 0,
	ELEMENT_FRAME,
	ELEMENT_JUMP,
	ELEMENT_GOTO,
	ELEMENT_PAUSE,
	ELEMENT_LABEL,
	ELEMENT_COUNT
};

typedef struct {
	gint   type;
	gint   delay;
	gint   offsetX, offsetY;
	gint   rand;
	gchar *str;
	gint   line_no;
	GdkPixbuf *sprite;
} AnimElement;

AnimElement *animation_element_new (void);

#endif