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/atlantis.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'hacks/glx/atlantis.c') diff --git a/hacks/glx/atlantis.c b/hacks/glx/atlantis.c index 04bde12..05ea903 100644 --- a/hacks/glx/atlantis.c +++ b/hacks/glx/atlantis.c @@ -308,6 +308,9 @@ Init(ModeInfo *mi) glLoadIdentity(); glScalef(scale, scale, 1); glMatrixMode(GL_MODELVIEW); + + if (ap->texture) XDestroyImage (ap->texture); + ap->texture = 0; } InitFishs(ap); @@ -466,7 +469,7 @@ init_atlantis(ModeInfo * mi) if ((ap->sharks = (fishRec *) calloc(ap->num_sharks, sizeof (fishRec))) == NULL) { /* free everything up to now */ - (void) free((void *) atlantis); + free(atlantis); atlantis = NULL; return; } @@ -520,7 +523,7 @@ draw_atlantis(ModeInfo * mi) if (!ap->glx_context) return; - glXMakeCurrent(display, window, *(ap->glx_context)); + glXMakeCurrent(display, window, *ap->glx_context); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -545,12 +548,10 @@ draw_atlantis(ModeInfo * mi) ENTRYPOINT void free_atlantis(ModeInfo * mi) { -#if 0 - atlantisstruct *ap = &atlantis[screen]; - - if (ap->sharks) - (void) free((void *) ap->sharks); -#endif + atlantisstruct *ap = &atlantis[MI_SCREEN(mi)]; + if (!ap->glx_context) return; + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *ap->glx_context); + if (ap->sharks) free(ap->sharks); } #ifndef STANDALONE @@ -567,7 +568,7 @@ change_atlantis(ModeInfo * mi) if (!ap->glx_context) return; - glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(ap->glx_context)); + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *ap->glx_context); Init(mi); } #endif /* !STANDALONE */ -- cgit v1.2.3-55-g7522