*/
#include <math.h>
-#include <assert.h>
#include "screenhack.h"
#include "erase.h"
#define SQRT_3 1.73205080756887729352
+#undef assert
+#define assert(EXP) do { if (!((EXP))) abort(); } while(0)
/*-----------------------------------------*/
Graph graph;
XWindowAttributes xgwa;
int delay2;
- int reset;
+ int reset, force_reset;
double t;
struct params params;
"*delay: 10000",
"*delay2: 5",
"*showGraph: False",
-#ifdef USE_IPHONE
+#ifdef HAVE_MOBILE
"*ignoreRotation: True",
#endif
0
return 10000;
}
- if (st->reset) {
+ if (st->reset || st->force_reset) {
+ int delay = (st->force_reset ? 0 : st->delay2);
st->reset = 0;
+ st->force_reset = 0;
+ st->t = 1;
- pattern_del(st->pattern);
+ if (st->pattern != NULL) {
+ pattern_del(st->pattern);
+ }
st->pattern = NULL;
graph_del(st->graph);
st->colors, &st->ncolors, True, 0, True);
st->eraser = erase_window (st->dpy, st->window, st->eraser);
- return st->delay2;
+ return (delay);
}
if (st->pattern == NULL) {
static Bool
celtic_event (Display *dpy, Window window, void *closure, XEvent *event)
{
+ struct state *st = (struct state *) closure;
+ if (screenhack_event_helper (dpy, window, event))
+ {
+ st->force_reset = 1;
+ return True;
+ }
return False;
}