static void rotate_continue(void) { if (rotate && stopped) { stopped = 0; if (driver->flags & ASYNC_PALETTE) { tl_add_timer(asyncgroup, rotatetimer); } else tl_add_timer(syncgroup, rotatetimer); } }
static void rotate_on(void) { if (driver->rotate_palette != NULL && (driver->flags & PALETTE_ROTATION)) { rotate = 1; rotatetimer = tl_create_timer(); rotate_update(); tl_set_multihandler(rotatetimer, rotatehandler); if (driver->flags & ASYNC_PALETTE) { tl_add_timer(asyncgroup, rotatetimer); } else tl_add_timer(syncgroup, rotatetimer); } else { driver->print(0, 0, "Rotating of palette not supported by this configuration"); } }
void timestuff(int rate, void (*control) (int), void (*draw) (void), int maxtime) { int waitmode = 0, t; tl_timer *timer; bbupdate(); /*starttime = TIME; */ endtime = starttime + maxtime; timer = tl_create_timer(); if (control == NULL) { rate = -40; } if (rate < 0) { waitmode = 1, rate = -rate; control1 = control; tl_set_multihandler(timer, mycontrol); } else tl_set_multihandler(timer, control); tl_set_interval(timer, 1000000 / rate); tl_add_timer(syncgroup, timer); tl_reset_timer(timer); if (control != NULL) control(1); while (!finish_stuff && TIME < endtime) { called = 0; t = tl_process_group(syncgroup); bbupdate(); if (TIME > endtime) break; #ifdef __DJGPP__ if (0) #else if (!called && waitmode) #endif tl_sleep(t); else { if (draw != NULL) draw(); } } starttime = endtime; tl_free_timer(timer); }
static int uih_message1 (uih_context * c, CONST char *message, int type) { static int pid; int i; for (i = 0; i < NMESSAGES && c->messg.message[i] != NULL; i++); if (i == NMESSAGES) uih_scrollup (c), i--; c->messg.message[i] = mystrdup (message); c->messg.messagetype[i] = type; c->messg.messagetimer[i] = tl_create_timer (); tl_reset_timer (c->messg.messagetimer[i]); tl_set_interval (c->messg.messagetimer[i], 1);; tl_slowdown_timer (c->messg.messagetimer[i], EXPIRETIME);; tl_set_handler (c->messg.messagetimer[i], (void (*)(void *)) uih_scrollup, c); tl_add_timer (syncgroup, c->messg.messagetimer[i]); /*tl_remove_timer (c->messg.messagetimer[i]); */ c->messg.pid[i] = ++pid; c->display = 1; return (pid); }