# include "xlockmore.h" /* in xscreensaver distribution */
#else /* STANDALONE */
# include "xlock.h" /* in xlockmore distribution */
# include "xlockmore.h" /* in xscreensaver distribution */
#else /* STANDALONE */
# include "xlock.h" /* in xlockmore distribution */
-{"demon", "init_demon", "draw_demon", "release_demon",
+{"demon", "init_demon", "draw_demon", (char *) NULL,
"refresh_demon", "init_demon", (char *) NULL, &demon_opts,
50000, 0, 1000, -7, 64, 1.0, "",
"Shows Griffeath's cellular automata", 0, NULL};
"refresh_demon", "init_demon", (char *) NULL, &demon_opts,
50000, 0, 1000, -7, 64, 1.0, "",
"Shows Griffeath's cellular automata", 0, NULL};
#define DEMONBITS(n,w,h)\
if ((dp->pixmaps[dp->init_bits]=\
#define DEMONBITS(n,w,h)\
if ((dp->pixmaps[dp->init_bits]=\
- XCreatePixmapFromBitmapData(display,window,(char *)n,w,h,1,0,1))==None){\
- free_demon(display,dp); return;} else {dp->init_bits++;}
+ XCreatePixmapFromBitmapData(MI_DISPLAY(mi),window,(char *)n,w,h,1,0,1))==None){\
+ free_demon(mi); return;} else {dp->init_bits++;}
- if (demons == NULL) {
- if ((demons = (demonstruct *) calloc(MI_NUM_SCREENS(mi),
- sizeof (demonstruct))) == NULL)
- return;
- }
+ MI_INIT (mi, demons, free_demon);
dp->states = plots[1][nk];
if ((dp->cellList = (CellList **) calloc(dp->states,
sizeof (CellList *))) == NULL) {
dp->states = plots[1][nk];
if ((dp->cellList = (CellList **) calloc(dp->states,
sizeof (CellList *))) == NULL) {
if ((dp->oldcell = (unsigned char *)
malloc(dp->ncols * dp->nrows * sizeof (unsigned char))) == NULL) {
if ((dp->oldcell = (unsigned char *)
malloc(dp->ncols * dp->nrows * sizeof (unsigned char))) == NULL) {
return;
}
if ((dp->newcell = (unsigned char *)
malloc(dp->ncols * dp->nrows * sizeof (unsigned char))) == NULL) {
return;
}
if ((dp->newcell = (unsigned char *)
malloc(dp->ncols * dp->nrows * sizeof (unsigned char))) == NULL) {
if (dp->oldcell[i + mj] != dp->newcell[i + mj]) {
dp->oldcell[i + mj] = dp->newcell[i + mj];
if (!addtolist(mi, i, j, dp->oldcell[i + mj])) {
if (dp->oldcell[i + mj] != dp->newcell[i + mj]) {
dp->oldcell[i + mj] = dp->newcell[i + mj];
if (!addtolist(mi, i, j, dp->oldcell[i + mj])) {
} else {
if (dp->ncells[dp->state])
if (!draw_state(mi, dp->state)) {
} else {
if (dp->ncells[dp->state])
if (!draw_state(mi, dp->state)) {
-ENTRYPOINT void
-release_demon (ModeInfo * mi)
-{
- if (demons != NULL) {
- int screen;
-
- for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
- free_demon(MI_DISPLAY(mi), &demons[screen]);
- (void) free((void *) demons);
- demons = (demonstruct *) NULL;
- }
-}
-