#include <sys/time.h>
/*#include <sys/utsname.h>*/
-#define DEBUGFILE "/tmp/abstractile.dbg"
-
#define MODE_CREATE 0 /* init, create, then finish sleep */
#define MODE_ERASE 1 /* erase, then reset colors */
#define MODE_DRAW 2
/* draw, erase, fill, init, line, object, z indexes */
unsigned int di, ei, fi, ii, bi, li, eli, oi, zi;
/* size variables */
- unsigned int gridx, gridy, gridn; /* grid size */
+ int gridx, gridy; /* grid size */
+ unsigned int gridn;
int lwid, bwid, swid;/* line width, background width, shadow width */
int narray, max_wxh;
int elwid, elpu, egridx, egridy; /* for now */
st->gridx=st->xgwa.width/st->lwid;
st->gridy=st->xgwa.height/st->lwid;
+ if ((st->gridx <= 0) || (st->gridy <= 0)) abort();
st->gridn=st->gridx*st->gridy;
/* clear grid */
for (z=0; z<st->gridn; z++) {
{
int n, cv[LAYERS];
+ cv[0] = 0;
for (n=0; n<st->layers; n++) {
cv[n]=_pattern(st,x,y,n);
/* first wave/shape */
True : False;
st->dline[st->li].obj = (lt==LINE_NEW) ? st->oi :
st->dline[bl].obj;
- st->dline[st->li].color = (lt==LINE_NEW) ?
- (_getcolor(st,x,y))%st->ncolors : st->dline[bl].color;
+ if (lt==LINE_NEW) {
+ int color = (_getcolor(st,x,y))%st->ncolors;
+ if (color < 0) color += st->ncolors;
+ st->dline[st->li].color = color;
+ } else {
+ st->dline[st->li].color = st->dline[bl].color;
+ }
st->dline[st->li].deo=(_getdeo(st,x,y,st->dmap,1) +
(random()%st->dvar) + (random()%st->dvar))*st->ddir;
st->dline[st->li].ndol=0;
static Bool
abstractile_event (Display *dpy, Window window, void *closure, XEvent *event)
{
+ struct state *st = (struct state *) closure;
+ if (screenhack_event_helper (dpy, window, event))
+ {
+ st->mode=MODE_CREATE;
+ return True;
+ }
+
return False;
}
"*sleep: 3",
"*speed: 3",
"*tile: random",
+#ifdef HAVE_MOBILE
+ "*ignoreRotation: True",
+#endif
0
};