projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.38.tar.gz
[xscreensaver]
/
hacks
/
hopalong.c
diff --git
a/hacks/hopalong.c
b/hacks/hopalong.c
index 10e2656d937b940e6603d636639a026362e7dd99..d3cc7df0cbdc5461f9e20ec0ddd263d21295c2c0 100644
(file)
--- a/
hacks/hopalong.c
+++ b/
hacks/hopalong.c
@@
-61,9
+61,9
@@
static const char sccsid[] = "@(#)hop.c 5.00 2000/11/01 xlockmore";
# define SMOOTH_COLORS
# define reshape_hop 0
# define SMOOTH_COLORS
# define reshape_hop 0
+# define release_hop 0
# define hop_handle_event 0
# include "xlockmore.h" /* in xscreensaver distribution */
# define hop_handle_event 0
# include "xlockmore.h" /* in xscreensaver distribution */
-# include "erase.h"
#else /* STANDALONE */
# include "xlock.h" /* in xlockmore distribution */
#endif /* STANDALONE */
#else /* STANDALONE */
# include "xlock.h" /* in xlockmore distribution */
#endif /* STANDALONE */
@@
-153,8
+153,8
@@
ENTRYPOINT ModeSpecOpt hop_opts =
#ifdef USE_MODULES
ModStruct hop_description =
#ifdef USE_MODULES
ModStruct hop_description =
-{"hop", "init_hop", "draw_hop",
"release_hop"
,
- "refresh_hop", "init_hop",
(char *) NULL
, &hop_opts,
+{"hop", "init_hop", "draw_hop",
(char *) NULL
,
+ "refresh_hop", "init_hop",
"free_hop"
, &hop_opts,
10000, 1000, 2500, 1, 64, 1.0, "",
"Shows real plane iterated fractals", 0, NULL};
10000, 1000, 2500, 1, 64, 1.0, "",
"Shows real plane iterated fractals", 0, NULL};
@@
-187,9
+187,6
@@
typedef struct {
int count;
int bufsize;
XPoint *pointBuffer; /* pointer for XDrawPoints */
int count;
int bufsize;
XPoint *pointBuffer; /* pointer for XDrawPoints */
-#ifdef STANDALONE
- eraser_state *eraser;
-#endif
} hopstruct;
static hopstruct *hops = (hopstruct *) NULL;
} hopstruct;
static hopstruct *hops = (hopstruct *) NULL;
@@
-202,11
+199,7
@@
init_hop(ModeInfo * mi)
double range;
hopstruct *hp;
double range;
hopstruct *hp;
- if (hops == NULL) {
- if ((hops = (hopstruct *) calloc(MI_NUM_SCREENS(mi),
- sizeof (hopstruct))) == NULL)
- return;
- }
+ MI_INIT (mi, hops);
hp = &hops[MI_SCREEN(mi)];
hp->centerx = MI_WIDTH(mi) / 2;
hp = &hops[MI_SCREEN(mi)];
hp->centerx = MI_WIDTH(mi) / 2;
@@
-389,9
+382,7
@@
init_hop(ModeInfo * mi)
return;
}
return;
}
-#ifndef STANDALONE
MI_CLEARWINDOW(mi);
MI_CLEARWINDOW(mi);
-#endif
XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
hp->count = 0;
XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
hp->count = 0;
@@
-410,13
+401,6
@@
draw_hop(ModeInfo * mi)
return;
hp = &hops[MI_SCREEN(mi)];
return;
hp = &hops[MI_SCREEN(mi)];
-#ifdef STANDALONE
- if (hp->eraser) {
- hp->eraser = erase_window (MI_DISPLAY(mi), MI_WINDOW(mi), hp->eraser);
- return;
- }
-#endif
-
if (hp->pointBuffer == NULL)
return;
if (hp->pointBuffer == NULL)
return;
@@
-545,35
+529,26
@@
draw_hop(ModeInfo * mi)
XDrawPoints(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
hp->pointBuffer, hp->bufsize, CoordModeOrigin);
if (++hp->count > MI_CYCLES(mi)) {
XDrawPoints(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
hp->pointBuffer, hp->bufsize, CoordModeOrigin);
if (++hp->count > MI_CYCLES(mi)) {
-#ifdef STANDALONE
- hp->eraser = erase_window (MI_DISPLAY(mi), MI_WINDOW(mi), hp->eraser);
-#endif /* STANDALONE */
init_hop(mi);
}
}
ENTRYPOINT void
init_hop(mi);
}
}
ENTRYPOINT void
-
releas
e_hop(ModeInfo * mi)
+
fre
e_hop(ModeInfo * mi)
{
{
- if (hops != NULL) {
- int screen;
-
- for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
- hopstruct *hp = &hops[screen];
+ hopstruct *hp = &hops[MI_SCREEN(mi)];
- if (hp->pointBuffer != NULL)
- (void) free((void *) hp->pointBuffer);
- }
- (void) free((void *) hops);
- hops = (hopstruct *) NULL;
- }
+ if (hp->pointBuffer != NULL)
+ (void) free((void *) hp->pointBuffer);
}
}
+#ifndef STANDALONE
ENTRYPOINT void
refresh_hop(ModeInfo * mi)
{
MI_CLEARWINDOW(mi);
}
ENTRYPOINT void
refresh_hop(ModeInfo * mi)
{
MI_CLEARWINDOW(mi);
}
+#endif
XSCREENSAVER_MODULE_2 ("Hopalong", hopalong, hop)
XSCREENSAVER_MODULE_2 ("Hopalong", hopalong, hop)