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.37.tar.gz
[xscreensaver]
/
hacks
/
glx
/
pulsar.c
diff --git
a/hacks/glx/pulsar.c
b/hacks/glx/pulsar.c
index 12b16a80de83aed4fe916cf957324dda9e1dbe35..c229090d2279ef7b5210f84521a69786d927f61e 100644
(file)
--- a/
hacks/glx/pulsar.c
+++ b/
hacks/glx/pulsar.c
@@
-45,6
+45,7
@@
"*showFPS: False \n" \
# define refresh_pulsar 0
"*showFPS: False \n" \
# define refresh_pulsar 0
+# define release_pulsar 0
# define pulsar_handle_event 0
# include "xlockmore.h" /* from the xpulsar distribution */
#else /* !STANDALONE */
# define pulsar_handle_event 0
# include "xlockmore.h" /* from the xpulsar distribution */
#else /* !STANDALONE */
@@
-160,7
+161,7
@@
ENTRYPOINT ModeSpecOpt pulsar_opts = {countof(opts), opts, countof(vars), vars,
#ifdef USE_MODULES
ModStruct pulsar_description =
#ifdef USE_MODULES
ModStruct pulsar_description =
-{"pulsar", "init_pulsar", "draw_pulsar",
"release_pulsar"
,
+{"pulsar", "init_pulsar", "draw_pulsar",
NULL
,
"draw_pulsar", "init_pulsar", NULL, &pulsar_opts,
1000, 1, 2, 1, 4, 1.0, "",
"OpenGL pulsar", 0, NULL};
"draw_pulsar", "init_pulsar", NULL, &pulsar_opts,
1000, 1, 2, 1, 4, 1.0, "",
"OpenGL pulsar", 0, NULL};
@@
-230,11
+231,16
@@
static void Create_Texture(ModeInfo *mi, const char *filename)
int format;
if ( !strncmp(filename, "BUILTIN", 7))
int format;
if ( !strncmp(filename, "BUILTIN", 7))
- image = Generate_Image(&width, &height, &format);
+ {
+ BUILTIN:
+ image = Generate_Image(&width, &height, &format);
+ }
else
{
XImage *ximage = xpm_file_to_ximage (MI_DISPLAY (mi), MI_VISUAL (mi),
MI_COLORMAP (mi), filename);
else
{
XImage *ximage = xpm_file_to_ximage (MI_DISPLAY (mi), MI_VISUAL (mi),
MI_COLORMAP (mi), filename);
+ if (! ximage)
+ goto BUILTIN;
image = (GLubyte *) ximage->data;
width = ximage->width;
height = ximage->height;
image = (GLubyte *) ximage->data;
width = ximage->width;
height = ximage->height;
@@
-363,6
+369,10
@@
static void initializeGL(ModeInfo *mi, GLsizei width, GLsizei height)
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
}
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
}
+# ifdef HAVE_JWZGLES /* #### glPolygonMode other than GL_FILL unimplemented */
+ do_wire = 0;
+# endif
+
if (do_wire)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
else
if (do_wire)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
else
@@
-472,6
+482,8
@@
reshape_pulsar(ModeInfo *mi, int width, int height)
resetProjection();
}
resetProjection();
}
+static void free_pulsar(ModeInfo * mi);
+
ENTRYPOINT void
init_pulsar(ModeInfo * mi)
{
ENTRYPOINT void
init_pulsar(ModeInfo * mi)
{
@@
-479,10
+491,7
@@
init_pulsar(ModeInfo * mi)
pulsarstruct *gp;
pulsarstruct *gp;
- if (Pulsar == NULL) {
- if ((Pulsar = (pulsarstruct *) calloc(MI_NUM_SCREENS(mi), sizeof (pulsarstruct))) == NULL)
- return;
- }
+ MI_INIT (mi, Pulsar, free_pulsar);
gp = &Pulsar[screen];
gp->window = MI_WINDOW(mi);
gp = &Pulsar[screen];
gp->window = MI_WINDOW(mi);
@@
-499,18
+508,10
@@
init_pulsar(ModeInfo * mi)
/* all sorts of nice cleanup code should go here! */
/* all sorts of nice cleanup code should go here! */
-
ENTRYPOINT void releas
e_pulsar(ModeInfo * mi)
+
static void fre
e_pulsar(ModeInfo * mi)
{
{
- int screen;
- if (Pulsar != NULL) {
- for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
- pulsarstruct *gp = &Pulsar[screen];
- free(gp->quads);
- }
- (void) free((void *) Pulsar);
- Pulsar = NULL;
- }
- FreeAllGL(mi);
+ pulsarstruct *gp = &Pulsar[MI_SCREEN(mi)];
+ free(gp->quads);
}
#endif
}
#endif