Mercurial > hg > dmlib
annotate dmengine.h @ 622:8ba49471c143
Remove some constants.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 13 Apr 2013 06:23:54 +0300 |
parents | 5fda51e99fe5 |
children | dfdff30ad363 |
rev | line source |
---|---|
372 | 1 #ifndef DMENGINE_H |
2 #define DMENGINE_H | |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3 |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
4 #include "dmlib.h" |
310
713c8018c3ce
Fix includes in the dmsimple engine.
Matti Hamalainen <ccr@tnsp.org>
parents:
288
diff
changeset
|
5 #include <SDL_events.h> |
713c8018c3ce
Fix includes in the dmsimple engine.
Matti Hamalainen <ccr@tnsp.org>
parents:
288
diff
changeset
|
6 #include <SDL_audio.h> |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
7 #include "dmres.h" |
368 | 8 #include "dmvecmat.h" |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
9 |
105
d5d27f262227
Beging merging of dmsimple2-fork into the main "engine".
Matti Hamalainen <ccr@tnsp.org>
parents:
94
diff
changeset
|
10 #ifdef DM_USE_JSS |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
11 #include "jss.h" |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
12 #include "jssmod.h" |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 #include "jssmix.h" |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
14 #include "jssplr.h" |
105
d5d27f262227
Beging merging of dmsimple2-fork into the main "engine".
Matti Hamalainen <ccr@tnsp.org>
parents:
94
diff
changeset
|
15 #endif |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
16 |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
17 |
317 | 18 #ifdef __cplusplus |
19 extern "C" { | |
20 #endif | |
21 | |
593 | 22 // Video setup screen / window size |
620 | 23 #define DM_VSETUP_WIDTH 640 |
24 #define DM_VSETUP_HEIGHT 480 | |
593 | 25 |
597
8a9361179a1a
More work on the video setup screen.
Matti Hamalainen <ccr@tnsp.org>
parents:
593
diff
changeset
|
26 |
593 | 27 // Video setup type |
620 | 28 #define DM_VSETUP_NONE 0x00 // No video setup, just set window/screen to what demo specifies |
29 #define DM_VSETUP_ASPECT 0x01 // Only modes that match the optVidAspect aspect ratio are ok | |
30 #define DM_VSETUP_ANY 0x02 // Any available mode is okay, the code can adapt | |
593 | 31 |
32 | |
317 | 33 |
368 | 34 #define DT_MAGIC_ID "SDMETLNE" |
35 #define DT_MAX_EFFECT_PARAMS 16 | |
36 #define DT_MAX_NAME_LENGTH 32 | |
37 #define DT_FLOAT_STORE_SIZE 16 | |
38 | |
39 | |
40 enum | |
41 { | |
42 EFIT_SET, // No interpolation, just "set" the value | |
43 EFIT_LINEAR, // Linear interpolation | |
44 EFIT_SMOOTH, // Smoothstep interpolation | |
45 }; | |
46 | |
47 enum | |
48 { | |
49 EFPT_INT, | |
50 EFPT_FLOAT, | |
51 EFPT_STRING, | |
52 EFPT_VECTOR, | |
53 EFPT_MATRIX, | |
54 }; | |
55 | |
56 | |
57 typedef struct | |
58 { | |
59 int type; // Interpolation type (EFIT_*) between this and next point | |
60 int time; // Offsets to event start, -1 == attach to event start, -2 = event end (if event) | |
61 | |
62 int vint; | |
63 DMFloat vfloat; | |
64 DMVector vector; | |
65 DMMatrix matrix; | |
66 } DMTimelinePoint; | |
67 | |
68 | |
69 typedef struct | |
70 { | |
71 int npoints, nallocated; | |
72 DMTimelinePoint *points; | |
73 } DMTimelinePoints; | |
74 | |
75 | |
76 typedef struct | |
77 { | |
78 char *name; // Name / description of the parameter | |
79 int type; // Type (EFPT_*) | |
80 | |
81 DMTimelinePoints pts; | |
82 char *vstr; | |
83 | |
84 // Current values (interpolated) | |
85 int vint; | |
86 DMFloat vfloat; | |
87 DMVector vvector; | |
88 DMMatrix vmatrix; | |
89 } DMTimelineEventParam; | |
90 | |
91 | |
92 typedef struct | |
93 { | |
94 char name[DT_MAX_NAME_LENGTH]; | |
95 Uint32 type; | |
96 } DMFTimelineEventParam; | |
97 | |
98 | |
99 struct DMEngineData; | |
100 | |
101 | |
102 typedef struct | |
103 { | |
104 char * name; | |
105 int type; | |
106 | |
107 int (*init)(struct DMEngineData *, void **data); | |
108 void (*shutdown)(struct DMEngineData *, void *data); | |
109 int (*render)(SDL_Surface *screen, void *data, const DMTimelineEventParam *params, const int time); | |
110 | |
111 int nparams; | |
112 DMTimelineEventParam params[DT_MAX_EFFECT_PARAMS]; | |
113 } DMEffect; | |
114 | |
115 | |
573
14640d0688d3
Make timeline stuff optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
564
diff
changeset
|
116 #ifdef DM_USE_TIMELINE |
14640d0688d3
Make timeline stuff optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
564
diff
changeset
|
117 |
14640d0688d3
Make timeline stuff optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
564
diff
changeset
|
118 |
368 | 119 typedef struct |
120 { | |
121 Uint32 start, duration; | |
122 char effectName[DT_MAX_NAME_LENGTH]; | |
123 Uint32 nparams; | |
124 } DMFTimelineEvent; | |
125 | |
126 | |
127 typedef struct | |
128 { | |
129 int start, duration; | |
130 DMEffect *effect; | |
131 int nparams; | |
132 DMTimelineEventParam *params; | |
133 } DMTimelineEvent; | |
134 | |
135 | |
136 typedef struct | |
137 { | |
138 BOOL enabled; | |
139 DMTimelinePoints points; | |
140 } DMTimelineCurve; | |
141 | |
142 | |
143 typedef struct | |
144 { | |
145 char name[DT_MAX_NAME_LENGTH]; | |
146 Uint8 enabled; | |
147 Uint32 nevents; | |
148 } DMFTimelineTrack; | |
149 | |
150 | |
151 typedef struct | |
152 { | |
153 char *name; // Name of the timeline track | |
154 BOOL enabled; // Enabled? | |
155 | |
156 int nevents, nallocated; // Number of events | |
157 DMTimelineEvent **events; // Events | |
158 | |
159 DMTimelineCurve composite; // Composite curve (transparency of the "layer") | |
160 } DMTimelineTrack; | |
161 | |
162 | |
163 typedef struct | |
164 { | |
165 char magic[8]; | |
166 char name[DT_MAX_NAME_LENGTH]; | |
167 Uint32 ntracks; | |
168 Uint32 duration; | |
169 } DMFTimeline; | |
170 | |
171 | |
172 typedef struct | |
173 { | |
174 char *name; | |
175 int ntracks, nallocated, duration; | |
176 DMTimelineTrack **tracks; | |
177 } DMTimeline; | |
178 | |
179 | |
180 typedef struct | |
181 { | |
182 DMTimelineTrack *track; | |
183 DMTimelineEvent *event; | |
184 } DMPreparedEvent; | |
185 | |
186 | |
187 typedef struct _DMPreparedEventGroup | |
188 { | |
189 int start, end, nevents, nallocated; | |
190 DMPreparedEvent *events; | |
191 | |
192 struct _DMPreparedEventGroup *next, *prev; | |
193 } DMPreparedEventGroup; | |
194 | |
195 | |
196 typedef struct | |
197 { | |
198 int duration, ngroups, pos; | |
199 DMPreparedEventGroup **groups; | |
200 } DMPreparedTimeline; | |
201 | |
573
14640d0688d3
Make timeline stuff optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
564
diff
changeset
|
202 #endif |
14640d0688d3
Make timeline stuff optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
564
diff
changeset
|
203 |
368 | 204 |
367 | 205 typedef struct DMEngineData |
359
59045853853d
Make resource management re-entrant.
Matti Hamalainen <ccr@tnsp.org>
parents:
354
diff
changeset
|
206 { |
59045853853d
Make resource management re-entrant.
Matti Hamalainen <ccr@tnsp.org>
parents:
354
diff
changeset
|
207 DMResourceLib *resources; |
368 | 208 void **effectData; |
359
59045853853d
Make resource management re-entrant.
Matti Hamalainen <ccr@tnsp.org>
parents:
354
diff
changeset
|
209 |
573
14640d0688d3
Make timeline stuff optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
564
diff
changeset
|
210 #ifdef DM_USE_TIMELINE |
354 | 211 DMResource *timeline; |
345
cac13f180169
Work towards timeline support.
Matti Hamalainen <ccr@tnsp.org>
parents:
342
diff
changeset
|
212 DMTimeline *tl; |
cac13f180169
Work towards timeline support.
Matti Hamalainen <ccr@tnsp.org>
parents:
342
diff
changeset
|
213 DMPreparedTimeline *ptl; |
573
14640d0688d3
Make timeline stuff optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
564
diff
changeset
|
214 #endif |
345
cac13f180169
Work towards timeline support.
Matti Hamalainen <ccr@tnsp.org>
parents:
342
diff
changeset
|
215 |
361 | 216 int frameTime, frameCount, |
217 startTime, endTime, | |
390
a7ee3567f718
Remove adjustTime variable, it is not needed anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
382
diff
changeset
|
218 pauseTime; |
93
15fdd5573344
Add simple (and buggy / not really working) debug mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
32
diff
changeset
|
219 |
15fdd5573344
Add simple (and buggy / not really working) debug mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
32
diff
changeset
|
220 BOOL pauseFlag, paused, exitFlag; |
361 | 221 |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
222 SDL_Surface *screen; |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
223 SDL_Event event; |
105
d5d27f262227
Beging merging of dmsimple2-fork into the main "engine".
Matti Hamalainen <ccr@tnsp.org>
parents:
94
diff
changeset
|
224 SDL_AudioSpec optAfmt; |
578
cf5d44b36851
Add some initial code for video setup screen.
Matti Hamalainen <ccr@tnsp.org>
parents:
573
diff
changeset
|
225 |
593 | 226 int optVidWidth, optVidHeight, |
227 optVidDepth, optVFlags, | |
228 optVidAspect, optVidSetup; | |
578
cf5d44b36851
Add some initial code for video setup screen.
Matti Hamalainen <ccr@tnsp.org>
parents:
573
diff
changeset
|
229 |
cf5d44b36851
Add some initial code for video setup screen.
Matti Hamalainen <ccr@tnsp.org>
parents:
573
diff
changeset
|
230 int optResFlags; |
105
d5d27f262227
Beging merging of dmsimple2-fork into the main "engine".
Matti Hamalainen <ccr@tnsp.org>
parents:
94
diff
changeset
|
231 char *optDataPath, *optPackFilename; |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
232 |
105
d5d27f262227
Beging merging of dmsimple2-fork into the main "engine".
Matti Hamalainen <ccr@tnsp.org>
parents:
94
diff
changeset
|
233 #ifdef DM_USE_JSS |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
234 JSSMixer *dev; |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
235 JSSPlayer *plr; |
110
8db49a23b393
Fixes to make the JSS audio subsystem support work again in the engine framework.
Matti Hamalainen <ccr@tnsp.org>
parents:
105
diff
changeset
|
236 int jss_format; |
105
d5d27f262227
Beging merging of dmsimple2-fork into the main "engine".
Matti Hamalainen <ccr@tnsp.org>
parents:
94
diff
changeset
|
237 #endif |
d5d27f262227
Beging merging of dmsimple2-fork into the main "engine".
Matti Hamalainen <ccr@tnsp.org>
parents:
94
diff
changeset
|
238 |
d5d27f262227
Beging merging of dmsimple2-fork into the main "engine".
Matti Hamalainen <ccr@tnsp.org>
parents:
94
diff
changeset
|
239 #ifdef DM_USE_TREMOR |
359
59045853853d
Make resource management re-entrant.
Matti Hamalainen <ccr@tnsp.org>
parents:
354
diff
changeset
|
240 DMResource *audioRes; |
113 | 241 size_t audioPos; |
105
d5d27f262227
Beging merging of dmsimple2-fork into the main "engine".
Matti Hamalainen <ccr@tnsp.org>
parents:
94
diff
changeset
|
242 #endif |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
243 |
366
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
244 int (*demoInit)(struct DMEngineData *); |
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
245 int (*demoInitPreVideo)(struct DMEngineData *); |
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
246 int (*demoInitPostVideo)(struct DMEngineData *); |
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
247 int (*demoRender)(struct DMEngineData *); |
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
248 void (*demoShutdown)(struct DMEngineData *); |
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
249 void (*demoQuit)(struct DMEngineData *); |
127
ab4086db7dad
Various improvements in modularity.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
250 |
622 | 251 // Setup specifics |
252 DMVector setupMenuPos, setupMenuDim, | |
253 setupText1Pos, setupText2Pos; | |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
254 } DMEngineData; |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
255 |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
256 |
382
371edff7dc3d
Fix extern variables to match what are actually declared in dmengine.c
Matti Hamalainen <ccr@tnsp.org>
parents:
375
diff
changeset
|
257 extern DMEffect *engineEffects; |
371edff7dc3d
Fix extern variables to match what are actually declared in dmengine.c
Matti Hamalainen <ccr@tnsp.org>
parents:
375
diff
changeset
|
258 extern int nengineEffects, nengineEffectsAlloc; |
368 | 259 |
260 | |
261 // Effect registration | |
262 int engineRegisterEffect(const DMEffect *ef); | |
371
56bd2693472f
Oops, the function prototypes were incorrect.
Matti Hamalainen <ccr@tnsp.org>
parents:
368
diff
changeset
|
263 int engineInitializeEffects(DMEngineData *); |
56bd2693472f
Oops, the function prototypes were incorrect.
Matti Hamalainen <ccr@tnsp.org>
parents:
368
diff
changeset
|
264 void engineShutdownEffects(DMEngineData *); |
368 | 265 DMEffect *engineFindEffect(const char *name, const int nparams); |
266 DMEffect *engineFindEffectByName(const char *name); | |
267 | |
268 | |
573
14640d0688d3
Make timeline stuff optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
564
diff
changeset
|
269 #ifdef DM_USE_TIMELINE |
368 | 270 // Basic timeline handling |
271 int dmLoadTimeline(DMResource *res, DMTimeline **tl); | |
272 void dmFreeTimeline(DMTimeline *tl); | |
273 | |
274 void dmFreeTimelinePoints(DMTimelinePoints *points); | |
275 void dmFreeTimelineEventParam(DMTimelineEventParam *param); | |
276 void dmFreeTimelineEvent(DMTimelineEvent *event); | |
277 void dmFreeTimelineTrack(DMTimelineTrack *track); | |
278 | |
279 | |
280 // Execution related | |
281 int dmPrepareTimeline(DMTimeline *tl, DMPreparedTimeline *ptl); | |
282 void dmFreePreparedTimelineData(DMPreparedTimeline *ptl); | |
283 | |
284 int dmSeekTimeline(DMPreparedTimeline *tl, int time); | |
285 int dmExecuteTimeline(DMPreparedTimeline *tl, SDL_Surface *screen, int time); | |
286 | |
287 | |
288 // Editing/saving related functions | |
395
530db8fa4569
Implement functions for copying timelines and timeline components.
Matti Hamalainen <ccr@tnsp.org>
parents:
390
diff
changeset
|
289 int dmCopyTimelinePoints(const DMTimelinePoints *src, DMTimelinePoints *dst); |
530db8fa4569
Implement functions for copying timelines and timeline components.
Matti Hamalainen <ccr@tnsp.org>
parents:
390
diff
changeset
|
290 int dmCopyTimelineEventParam(const DMTimelineEventParam *src, DMTimelineEventParam *dst); |
530db8fa4569
Implement functions for copying timelines and timeline components.
Matti Hamalainen <ccr@tnsp.org>
parents:
390
diff
changeset
|
291 int dmCopyTimelineEvent(const DMTimelineEvent *src, DMTimelineEvent **pdst); |
530db8fa4569
Implement functions for copying timelines and timeline components.
Matti Hamalainen <ccr@tnsp.org>
parents:
390
diff
changeset
|
292 int dmCopyTimelineCurve(const DMTimelineCurve *src, DMTimelineCurve *dst); |
530db8fa4569
Implement functions for copying timelines and timeline components.
Matti Hamalainen <ccr@tnsp.org>
parents:
390
diff
changeset
|
293 int dmCopyTimelineTrack(const DMTimelineTrack *src, DMTimelineTrack **pdst); |
530db8fa4569
Implement functions for copying timelines and timeline components.
Matti Hamalainen <ccr@tnsp.org>
parents:
390
diff
changeset
|
294 int dmCopyTimeline(const DMTimeline *src, DMTimeline **pdst); |
530db8fa4569
Implement functions for copying timelines and timeline components.
Matti Hamalainen <ccr@tnsp.org>
parents:
390
diff
changeset
|
295 |
368 | 296 int dmSaveTimeline(DMResource *res, DMTimeline *tl); |
297 | |
298 int dmTimelineNew(DMTimeline **tl, const char *name); | |
299 int dmTimelineAddTrack(DMTimeline *tl, DMTimelineTrack **track, const char *name); | |
300 int dmTimelineTrackAddEvent(DMTimelineTrack *track, int start, int duration, DMTimelineEvent **pev); | |
402
0f290af63fc1
Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents:
395
diff
changeset
|
301 int dmTimelineEventSetEffect(DMTimelineEvent *event, DMEffect *ef); |
0f290af63fc1
Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents:
395
diff
changeset
|
302 int dmTimelineEventSetEffectByIndex(DMTimelineEvent *event, const int index); |
0f290af63fc1
Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents:
395
diff
changeset
|
303 int dmTimelineEventSetEffectByName(DMTimelineEvent *event, const char *name); |
368 | 304 |
573
14640d0688d3
Make timeline stuff optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
564
diff
changeset
|
305 #endif // DM_USE_TIMELINE |
14640d0688d3
Make timeline stuff optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
564
diff
changeset
|
306 |
368 | 307 |
308 // Resource helpers | |
366
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
309 #define engineGetResImage(eng, x, name) \ |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
310 do { \ |
366
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
311 if ((x = (SDL_Surface *) engineGetResource(eng, name)) == NULL) \ |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
312 return DMERR_INIT_FAIL; \ |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
313 } while (0) |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
314 |
366
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
315 #define engineGetResModule(eng, x, name) \ |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
316 do { \ |
366
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
317 if ((x = (JSSModule *) engineGetResource(eng, name)) == NULL) \ |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
318 return DMERR_INIT_FAIL; \ |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
319 } while (0) |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
320 |
367 | 321 #define engineFindResource(eng, name) dmres_find((eng)->resources, name) |
322 | |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
323 |
342
c6ec970dc3cf
Separate some demo engine parts to two different modules.
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
324 int engineClassifier(DMResource *res); |
366
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
325 void * engineGetResource(DMEngineData *eng, const char *name); |
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
326 int engineGetTime(DMEngineData *eng, int t); |
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
327 int engineGetTimeDTi(DMEngineData *eng); |
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
328 int engineGetTick(DMEngineData *eng); |
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
329 float engineGetTimeDT(DMEngineData *eng); |
368 | 330 |
593 | 331 int engineGetVideoAspect(int width, int height); |
332 | |
333 | |
368 | 334 // Implemented in actual demo code |
366
38e10b5f4e09
Work towards base engine re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
335 int demoPreInit(DMEngineData *eng); |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
336 |
317 | 337 |
338 #ifdef __cplusplus | |
339 } | |
340 #endif | |
341 | |
372 | 342 #endif // DMENGINE_H |