projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://www.jwz.org/xscreensaver/xscreensaver-5.12.tar.gz
[xscreensaver]
/
hacks
/
triangle.c
diff --git
a/hacks/triangle.c
b/hacks/triangle.c
index d8be189a304e7de218ae0f7e2d98e075725d485d..3f413432564b15c8f46f4f75db4043d443e9ca2c 100644
(file)
--- a/
hacks/triangle.c
+++ b/
hacks/triangle.c
@@
-1,9
+1,8
@@
/* -*- Mode: C; tab-width: 4 -*- */
/* triangle --- create a triangle-mountain */
/* -*- Mode: C; tab-width: 4 -*- */
/* triangle --- create a triangle-mountain */
-#if
!defined( lint ) && !defined( SABER )
+#if
0
static const char sccsid[] = "@(#)triangle.c 4.04 97/07/28 xlockmore";
static const char sccsid[] = "@(#)triangle.c 4.04 97/07/28 xlockmore";
-
#endif
/*-
#endif
/*-
@@
-47,25
+46,27
@@
static const char sccsid[] = "@(#)triangle.c 4.04 97/07/28 xlockmore";
*/
#ifdef STANDALONE
*/
#ifdef STANDALONE
-# define PROGCLASS "Triangle"
-# define HACK_INIT init_triangle
-# define HACK_DRAW draw_triangle
-# define triangle_opts xlockmore_opts
# define DEFAULTS "*delay: 10000 \n" \
# define DEFAULTS "*delay: 10000 \n" \
- "*ncolors: 128 \n"
+ "*ncolors: 128 \n" \
+ "*fpsSolid: true \n" \
+
# define SMOOTH_COLORS
# define SMOOTH_COLORS
+# define reshape_triangle 0
+# define triangle_handle_event 0
# include "xlockmore.h" /* in xscreensaver distribution */
#else /* STANDALONE */
# include "xlock.h" /* in xlockmore distribution */
#endif /* STANDALONE */
# include "xlockmore.h" /* in xscreensaver distribution */
#else /* STANDALONE */
# include "xlock.h" /* in xlockmore distribution */
#endif /* STANDALONE */
-ModeSpecOpt triangle_opts =
+
ENTRYPOINT
ModeSpecOpt triangle_opts =
{0, NULL, 0, NULL, NULL};
#define MAX_STEPS 8
#define MAX_SIZE (1<<MAX_STEPS)
#define MAX_LEVELS 1000
{0, NULL, 0, NULL, NULL};
#define MAX_STEPS 8
#define MAX_SIZE (1<<MAX_STEPS)
#define MAX_LEVELS 1000
+#undef TOP /* FTSO AIX */
+
#define DELTA 0.4
#define LEFT (-0.25)
#define RIGHT 1.25
#define DELTA 0.4
#define LEFT (-0.25)
#define RIGHT 1.25
@@
-216,8
+217,8
@@
draw_mesh(ModeInfo * mi, trianglestruct * tp, int d, int count)
}
}
}
}
-void
-init_triangle(ModeInfo * mi)
+
ENTRYPOINT
void
+init_triangle
(ModeInfo * mi)
{
trianglestruct *tp;
short *tmp;
{
trianglestruct *tp;
short *tmp;
@@
-276,8
+277,8
@@
init_triangle(ModeInfo * mi)
}
}
}
}
-void
-draw_triangle(ModeInfo * mi)
+
ENTRYPOINT
void
+draw_triangle
(ModeInfo * mi)
{
trianglestruct *tp = &triangles[MI_SCREEN(mi)];
int d, d2, i, j, delta;
{
trianglestruct *tp = &triangles[MI_SCREEN(mi)];
int d, d2, i, j, delta;
@@
-295,20
+296,18
@@
draw_triangle(ModeInfo * mi)
#else
if (tp->stage == -1)
{
#else
if (tp->stage == -1)
{
- XSync(MI_DISPLAY(mi), False);
- usleep(2000000);
XClearWindow(MI_DISPLAY(mi), MI_WINDOW(mi));
XClearWindow(MI_DISPLAY(mi), MI_WINDOW(mi));
-# if 1
if (!mono_p)
{
free_colors(mi->dpy, mi->xgwa.colormap, mi->colors,
mi->npixels);
if (!mono_p)
{
free_colors(mi->dpy, mi->xgwa.colormap, mi->colors,
mi->npixels);
+ mi->npixels =
+ get_integer_resource (mi->dpy, "ncolors", "Integer");
make_smooth_colormap (mi->dpy,
mi->xgwa.visual, mi->xgwa.colormap,
mi->colors, &mi->npixels,
True, &mi->writable_p, True);
}
make_smooth_colormap (mi->dpy,
mi->xgwa.visual, mi->xgwa.colormap,
mi->colors, &mi->npixels,
True, &mi->writable_p, True);
}
-# endif /* 0 */
}
#endif
}
}
#endif
}
@@
-346,7
+345,7
@@
draw_triangle(ModeInfo * mi)
}
}
}
}
-void
+
ENTRYPOINT
void
release_triangle(ModeInfo * mi)
{
if (triangles != NULL) {
release_triangle(ModeInfo * mi)
{
if (triangles != NULL) {
@@
-355,8
+354,10
@@
release_triangle(ModeInfo * mi)
}
}
}
}
-void
-refresh_triangle(ModeInfo * mi)
+
ENTRYPOINT
void
+refresh_triangle
(ModeInfo * mi)
{
/* Do nothing, it will refresh by itself */
}
{
/* Do nothing, it will refresh by itself */
}
+
+XSCREENSAVER_MODULE ("Triangle", triangle)