} else {
int i;
+
+ if(dsys.scr_override && dsys.scr_override->keyboard) {
+ dsys.scr_override->keyboard(key, pressed);
+ break;
+ }
+
for(i=0; i<dsys.num_act; i++) {
struct demoscreen *scr = dsys.act[i];
if(scr->keyboard) scr->keyboard(key, pressed);
void demo_mouse(int bn, int pressed, int x, int y)
{
int i;
+
+ if(dsys.scr_override && dsys.scr_override->mouse) {
+ dsys.scr_override->mouse(bn, pressed, x, y);
+ return;
+ }
+
for(i=0; i<dsys.num_act; i++) {
struct demoscreen *scr = dsys.act[i];
if(scr->mouse) scr->mouse(bn, pressed, x, y);
void demo_motion(int x, int y)
{
int i;
+
+ if(dsys.scr_override && dsys.scr_override->motion) {
+ dsys.scr_override->motion(x, y);
+ }
+
for(i=0; i<dsys.num_act; i++) {
struct demoscreen *scr = dsys.act[i];
if(scr->motion) scr->motion(x, y);
dsys.tmsec = time_msec;
+ /* evaluate tracks */
+ for(i=0; i<dsys.num_tracks; i++) {
+ dsys.value[i] = anm_get_value(dsys.track + i, dsys.tmsec);
+ }
+
+ if(dsys.scr_override) {
+ scr = dsys.scr_override;
+ scr->vis = 1;
+ if(scr->update) scr->update(dsys.tmsec);
+ return;
+ }
+
dsys.num_act = 0;
for(i=0; i<dsys.num_screens; i++) {
scr = dsys.screens[i];
}
}
}
-
- /* evaluate tracks */
- for(i=0; i<dsys.num_tracks; i++) {
- dsys.value[i] = anm_get_value(dsys.track + i, dsys.tmsec);
- }
}
/* TODO: do something about draw ordering of the active screens */
void dsys_draw(void)
{
int i;
+
+ if(dsys.scr_override) {
+ dsys.scr_override->draw();
+ return;
+ }
+
for(i=0; i<dsys.num_act; i++) {
dsys.act[i]->draw();
}
{
int i;
- if(!scr) return;
- if(dsys.num_act == 1 && dsys.act[0] == scr) return;
+ if(!scr) {
+ if(dsys.scr_override) {
+ scr = dsys.scr_override;
+ if(scr->stop) scr->stop();
+ }
+ dsys.scr_override = 0;
+ return;
+ }
for(i=0; i<dsys.num_act; i++) {
if(dsys.act[i]->stop) dsys.act[i]->stop();
dsys.act[i]->active = 0;
}
+ dsys.num_act = 0;
- dsys.act[0] = scr;
- dsys.num_act = 1;
+ dsys.scr_override = scr;
if(scr->start) scr->start();
scr->active = 1;
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 */