X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fdemosys.h;h=e2bdb8a69ed8127846795d39b5276b2e45584748;hb=86b5ef7c43c2a3485850b8a4f58c33aaf6ca2566;hp=e369771cb467f7fca7767a7da1dcad5b7c4e9c94;hpb=ba4adddb6685c5a64a3ca5cae56ba879841327ec;p=andemo diff --git a/src/demosys.h b/src/demosys.h index e369771..e2bdb8a 100644 --- a/src/demosys.h +++ b/src/demosys.h @@ -6,8 +6,6 @@ struct demoscreen { char *name; - struct anm_track track; - int (*init)(void); void (*destroy)(void); void (*reshape)(int x, int y); @@ -22,26 +20,38 @@ struct demoscreen { void (*mouse)(int bn, int pressed, int x, int y); void (*motion)(int x, int y); - struct demoscreen *next; + struct anm_track track; + int active, prio; + float vis; }; -/* global demo state */ -int dsys_running; /* run/stop state */ -int dsys_eof; /* end of demo flag, seek back to reset */ -long dsys_time; /* demo time in milliseconds */ - #define MAX_DSYS_SCREENS 64 -struct demoscreen *dsys_screens[MAX_DSYS_SCREENS]; -int dsys_num_screens; -struct demoscreen *dsys_act_scr; /* linked list of active screens */ +struct demosystem { + int running; /* run/stop state */ + int eof; /* end of demo flag, seek back to reset */ + long tmsec; + + struct demoscreen *screens[MAX_DSYS_SCREENS]; + int num_screens; + struct demoscreen *act[MAX_DSYS_SCREENS]; + int num_act; + + struct demoscreen *scr_override; + + void *trackmap; + struct anm_track *track; + float *value; /* values for each track, stored on update */ + int num_tracks; +}; + +struct demosystem dsys; int dsys_init(const char *fname); void dsys_destroy(void); -/* overrides the demo sequence, and runs a single screen */ -struct demoscreen *dsys_find_screen(const char *name); -void dsys_run_screen(struct demoscreen *scr); +void dsys_update(void); +void dsys_draw(void); void dsys_run(void); void dsys_stop(void); @@ -49,6 +59,15 @@ void dsys_seek_abs(long tm); void dsys_seek_rel(long dt); void dsys_seek_norm(float t); +/* overrides the demo sequence, and runs a single screen */ +struct demoscreen *dsys_find_screen(const char *name); +void dsys_run_screen(struct demoscreen *scr); + int dsys_add_screen(struct demoscreen *scr); +/* demo event tracks */ +int dsys_add_track(const char *name); +int dsys_find_track(const char *name); +float dsys_value(const char *name); + #endif /* DEMOSYS_H_ */