Mercurial > hg > dmlib
annotate dmtimeline.h @ 360:d5a90ba09dc4
Fix to match with resource management changes.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 16 Oct 2012 21:28:56 +0300 |
parents | 834f3b686ad3 |
children |
rev | line source |
---|---|
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 #ifndef DMTIMELINE_H |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2 #define DMTIMELINE_H |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
4 #include "dmlib.h" |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
5 #include "dmres.h" |
346
882503ef7ab8
More work on timeline saving and loading.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
6 #include "dmvecmat.h" |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
7 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
8 #ifdef __cplusplus |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
9 extern "C" { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
10 #endif |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
11 |
327
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
12 #define DT_MAGIC_ID "SDMETLNE" |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 #define DT_MAX_EFFECT_PARAMS 16 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
14 #define DT_MAX_NAME_LENGTH 32 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
15 #define DT_FLOAT_STORE_SIZE 16 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
16 |
324
f2b65aa474c9
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
320
diff
changeset
|
17 |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
18 enum |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
19 { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
20 EFIT_SET, // No interpolation, just "set" the value |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
21 EFIT_LINEAR, // Linear interpolation |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
22 EFIT_SMOOTH, // Smoothstep interpolation |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
23 }; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
24 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
25 enum |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
26 { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
27 EFPT_INT, |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
28 EFPT_FLOAT, |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
29 EFPT_STRING, |
346
882503ef7ab8
More work on timeline saving and loading.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
30 EFPT_VECTOR, |
882503ef7ab8
More work on timeline saving and loading.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
31 EFPT_MATRIX, |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
32 }; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
33 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
34 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
35 typedef struct |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
36 { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
37 int type; // Interpolation type (EFIT_*) between this and next point |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
38 int time; // Offsets to event start, -1 == attach to event start, -2 = event end (if event) |
346
882503ef7ab8
More work on timeline saving and loading.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
39 |
882503ef7ab8
More work on timeline saving and loading.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
40 int vint; |
882503ef7ab8
More work on timeline saving and loading.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
41 DMFloat vfloat; |
882503ef7ab8
More work on timeline saving and loading.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
42 DMVector vector; |
882503ef7ab8
More work on timeline saving and loading.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
43 DMMatrix matrix; |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
44 } DMTimelinePoint; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
45 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
46 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
47 typedef struct |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
48 { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
49 int npoints, nallocated; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
50 DMTimelinePoint *points; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
51 } DMTimelinePoints; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
52 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
53 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
54 typedef struct |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
55 { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
56 char *name; // Name / description of the parameter |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
57 int type; // Type (EFPT_*) |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
58 |
347 | 59 DMTimelinePoints pts; |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
60 char *vstr; |
347 | 61 |
62 // Current values (interpolated) | |
63 int vint; | |
64 DMFloat vfloat; | |
65 DMVector vvector; | |
66 DMMatrix vmatrix; | |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
67 } DMTimelineEventParam; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
68 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
69 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
70 typedef struct |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
71 { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
72 char name[DT_MAX_NAME_LENGTH]; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
73 Uint32 type; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
74 } DMFTimelineEventParam; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
75 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
76 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
77 typedef struct |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
78 { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
79 char * name; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
80 int type; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
81 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
82 int (*init)(void **data); |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
83 void (*shutdown)(void *data); |
349
65b19a8cc84f
Add event time parameter to effect rendering function.
Matti Hamalainen <ccr@tnsp.org>
parents:
347
diff
changeset
|
84 int (*render)(SDL_Surface *screen, void *data, const DMTimelineEventParam *params, const int time); |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
85 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
86 int nparams; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
87 DMTimelineEventParam params[DT_MAX_EFFECT_PARAMS]; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
88 } DMEffect; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
89 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
90 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
91 typedef struct |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
92 { |
327
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
93 Uint32 start, duration; |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
94 char effectName[DT_MAX_NAME_LENGTH]; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
95 Uint32 nparams; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
96 } DMFTimelineEvent; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
97 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
98 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
99 typedef struct |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
100 { |
327
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
101 int start, duration; |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
102 DMEffect *effect; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
103 int nparams; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
104 DMTimelineEventParam *params; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
105 } DMTimelineEvent; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
106 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
107 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
108 typedef struct |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
109 { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
110 BOOL enabled; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
111 DMTimelinePoints points; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
112 } DMTimelineCurve; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
113 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
114 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
115 typedef struct |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
116 { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
117 char name[DT_MAX_NAME_LENGTH]; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
118 Uint8 enabled; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
119 Uint32 nevents; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
120 } DMFTimelineTrack; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
121 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
122 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
123 typedef struct |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
124 { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
125 char *name; // Name of the timeline track |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
126 BOOL enabled; // Enabled? |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
127 |
327
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
128 int nevents, nallocated; // Number of events |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
129 DMTimelineEvent **events; // Events |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
130 |
327
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
131 DMTimelineCurve composite; // Composite curve (transparency of the "layer") |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
132 } DMTimelineTrack; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
133 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
134 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
135 typedef struct |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
136 { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
137 char magic[8]; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
138 char name[DT_MAX_NAME_LENGTH]; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
139 Uint32 ntracks; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
140 Uint32 duration; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
141 } DMFTimeline; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
142 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
143 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
144 typedef struct |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
145 { |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
146 char *name; |
327
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
147 int ntracks, nallocated, duration; |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
148 DMTimelineTrack **tracks; |
330 | 149 } DMTimeline; |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
150 |
330 | 151 |
152 typedef struct | |
153 { | |
154 DMTimelineTrack *track; | |
155 DMTimelineEvent *event; | |
156 } DMPreparedEvent; | |
157 | |
158 | |
159 typedef struct _DMPreparedEventGroup | |
160 { | |
161 int start, end, nevents, nallocated; | |
162 DMPreparedEvent *events; | |
163 | |
164 struct _DMPreparedEventGroup *next, *prev; | |
165 } DMPreparedEventGroup; | |
166 | |
167 | |
168 typedef struct | |
169 { | |
170 int duration, ngroups, pos; | |
171 DMPreparedEventGroup **groups; | |
172 } DMPreparedTimeline; | |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
173 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
174 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
175 extern DMEffect *dmEffects; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
176 extern int ndmEffects, ndmEffectsAlloc; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
177 extern void **dmEffectData; |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
178 |
339 | 179 // Effect registration |
180 int dmRegisterEffect(const DMEffect *ef); | |
181 int dmInitializeEffects(); | |
182 void dmShutdownEffects(); | |
327
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
183 DMEffect *dmFindEffect(const char *name, const int nparams); |
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
184 DMEffect *dmFindEffectByName(const char *name); |
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
185 |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
186 |
339 | 187 // Basic timeline handling |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
188 int dmLoadTimeline(DMResource *res, DMTimeline **tl); |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
189 void dmFreeTimeline(DMTimeline *tl); |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
190 |
350
834f3b686ad3
More work on timeline stuff.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
191 void dmFreeTimelinePoints(DMTimelinePoints *points); |
834f3b686ad3
More work on timeline stuff.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
192 void dmFreeTimelineEventParam(DMTimelineEventParam *param); |
834f3b686ad3
More work on timeline stuff.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
193 void dmFreeTimelineEvent(DMTimelineEvent *event); |
834f3b686ad3
More work on timeline stuff.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
194 void dmFreeTimelineTrack(DMTimelineTrack *track); |
834f3b686ad3
More work on timeline stuff.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
195 |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
196 |
327
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
197 // Execution related |
330 | 198 int dmPrepareTimeline(DMTimeline *tl, DMPreparedTimeline *ptl); |
350
834f3b686ad3
More work on timeline stuff.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
199 void dmFreePreparedTimelineData(DMPreparedTimeline *ptl); |
834f3b686ad3
More work on timeline stuff.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
200 |
330 | 201 int dmSeekTimeline(DMPreparedTimeline *tl, int time); |
202 int dmExecuteTimeline(DMPreparedTimeline *tl, SDL_Surface *screen, int time); | |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
203 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
204 |
327
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
205 // Editing/saving related functions |
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
206 int dmSaveTimeline(DMResource *res, DMTimeline *tl); |
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
207 |
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
208 int dmTimelineNew(DMTimeline **tl, const char *name); |
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
209 int dmTimelineAddTrack(DMTimeline *tl, DMTimelineTrack **track, const char *name); |
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
210 int dmTimelineTrackAddEvent(DMTimelineTrack *track, int start, int duration, DMTimelineEvent **pev); |
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
211 int dmTimelineEventSetEffect(DMTimelineEvent *event, const char *name); |
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
212 |
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
213 DMTimelineEvent *dmTimelineGetEventAt(DMTimelineTrack *track, int time); |
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
214 |
2964947674d1
More work on the timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
215 |
320
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
216 #ifdef __cplusplus |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
217 } |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
218 #endif |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
219 |
fc79b57d4646
Add in unfinished timeline code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
220 #endif // DMTIMELINE_H |