Mercurial > hg > dmlib
view dmengine.h @ 366:38e10b5f4e09
Work towards base engine re-entrancy.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 16 Oct 2012 23:16:42 +0300 |
parents | bf60f60cafba |
children | 9875c65029af |
line wrap: on
line source
#ifndef DMSIMPLE_H #define DMSIMPLE_H #include "dmlib.h" #include <SDL_events.h> #include <SDL_audio.h> #include "dmres.h" #include "dmtimeline.h" #ifdef DM_USE_JSS #include "jss.h" #include "jssmod.h" #include "jssmix.h" #include "jssplr.h" #endif #ifdef __cplusplus extern "C" { #endif struct DMEngineData; typedef struct { DMResourceLib *resources; DMResource *timeline; DMTimeline *tl; DMPreparedTimeline *ptl; int frameTime, frameCount, startTime, endTime, adjustTime, pauseTime; BOOL pauseFlag, paused, exitFlag; SDL_Surface *screen; SDL_Event event; SDL_AudioSpec optAfmt; int optScrWidth, optScrHeight, optVFlags, optBitDepth, optResFlags; char *optDataPath, *optPackFilename; #ifdef DM_USE_JSS JSSMixer *dev; JSSPlayer *plr; int jss_format; #endif #ifdef DM_USE_TREMOR DMResource *audioRes; size_t audioPos; #endif int (*demoInit)(struct DMEngineData *); int (*demoInitPreVideo)(struct DMEngineData *); int (*demoInitPostVideo)(struct DMEngineData *); int (*demoRender)(struct DMEngineData *); void (*demoShutdown)(struct DMEngineData *); void (*demoQuit)(struct DMEngineData *); } DMEngineData; #define engineGetResImage(eng, x, name) \ do { \ if ((x = (SDL_Surface *) engineGetResource(eng, name)) == NULL) \ return DMERR_INIT_FAIL; \ } while (0) #define engineGetResModule(eng, x, name) \ do { \ if ((x = (JSSModule *) engineGetResource(eng, name)) == NULL) \ return DMERR_INIT_FAIL; \ } while (0) int engineClassifier(DMResource *res); void * engineGetResource(DMEngineData *eng, const char *name); int engineGetTime(DMEngineData *eng, int t); int engineGetTimeDTi(DMEngineData *eng); int engineGetTick(DMEngineData *eng); float engineGetTimeDT(DMEngineData *eng); int demoPreInit(DMEngineData *eng); #ifdef __cplusplus } #endif #endif // DMSIMPLE_H