view dmsimple.h @ 96:6bf5220fa47e

Urgh .. use memset to silence some bogus GCC warnings about using potentially uninitialized values, while that will not actually be possible. In any case, it is annoying.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 02 Oct 2012 18:52:28 +0300
parents 4bbfc0274b29
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