From ae69a754244c4e475c8d2591772ca8e005071d83 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 18 Feb 2019 11:55:41 +0100 Subject: Update to 5.42 --- hacks/glx/blinkbox.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'hacks/glx/blinkbox.c') diff --git a/hacks/glx/blinkbox.c b/hacks/glx/blinkbox.c index f777371..45071a9 100644 --- a/hacks/glx/blinkbox.c +++ b/hacks/glx/blinkbox.c @@ -16,7 +16,6 @@ "*wireframe: False \n" \ "*suppressRotationAnimation: True\n" \ -# define free_ball 0 # define release_ball 0 # define ball_handle_event xlockmore_no_events #undef countof @@ -383,11 +382,11 @@ init_ball (ModeInfo *mi) #define SPHERE_SLICES 12 /* how densely to render spheres */ #define SPHERE_STACKS 16 - bp->sp = malloc(sizeof(*bp->sp)); +/* bp->sp = malloc(sizeof(*bp->sp)); if(bp->sp == NULL){ fprintf(stderr,"Could not allocate memory\n"); exit(1); - } + }*/ if( (bp->bscale.wh < 1) || (bp->bscale.wh > 8) ) { fprintf(stderr,"Boxsize out of range. Using default\n"); @@ -449,7 +448,7 @@ draw_ball (ModeInfo *mi) if (! bp->glx_context) return; mi->polygon_count = 0; - glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(bp->glx_context)); + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *bp->glx_context); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -603,6 +602,16 @@ draw_ball (ModeInfo *mi) } +ENTRYPOINT void +free_ball (ModeInfo *mi) +{ + blinkboxstruct *bp = &blinkbox[MI_SCREEN(mi)]; + if (!bp->glx_context) return; + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *bp->glx_context); + if (glIsList(bp->ballList)) glDeleteLists(bp->ballList, 1); + if (glIsList(bp->boxList)) glDeleteLists(bp->boxList, 1); +} + XSCREENSAVER_MODULE_2 ("BlinkBox", blinkbox, ball) #endif /* USE_GL */ -- cgit v1.2.3-55-g7522