view dmsimple.h @ 94:4bbfc0274b29

Change some function names, etc.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 02 Oct 2012 18:14:44 +0300
parents 15fdd5573344
children d5d27f262227
line wrap: on
line source

#ifndef DMSIMPLE_H
#define DMSIMPLE_H

#include "dmlib.h"
#include "dmargs.h"
#include "dmres.h"
#include "dmimage.h"

#include "jss.h"
#include "jssmod.h"
#include "jssmix.h"
#include "jssplr.h"


typedef struct
{
    int currFrame, endTime, startTime,
        totalFrameTime, adjustTime, pauseTime;

    BOOL pauseFlag, paused, exitFlag;
    SDL_Surface *screen;
    SDL_Event event;

    int optScrWidth, optScrHeight, optVFlags, optBitDepth;

    JSSMixer *dev;
    JSSPlayer *plr;

#ifdef DM_DEBUG
    BOOL optDebug;
    Uint8 *audioBuf;
    int audioBufSize;
    int audioSamples;
    int demoDuration;
#endif
} DMEngineData;


typedef struct
{
    int currFrame, endTime, startTime;
} DMFrameData;


extern DMEngineData engine;
extern DMFrameData frame;


#define engineGetResImage(x, name) \
    do { \
        if ((x = (SDL_Surface *) engineGetResource(name)) == NULL) \
            return DMERR_INIT_FAIL; \
    } while (0)

#define engineGetResModule(x, name) \
    do { \
        if ((x = (JSSModule *) engineGetResource(name)) == NULL) \
            return DMERR_INIT_FAIL; \
    } while (0)


void * engineGetResource(const char *name);
int    engineGetTime(int t);
int    engineGetTimeDTi();
int    engineGetTick();
float  engineGetTimeDT();

int    demoInit();
int    demoPreInit();
int    demoMainTick();
void   demoShutdown();
void   demoQuit();

#endif // DMSIMPLE_H