diff options
author | Simon Rettberg | 2019-02-18 11:55:41 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-02-18 11:55:41 +0100 |
commit | ae69a754244c4e475c8d2591772ca8e005071d83 (patch) | |
tree | 58b3fa7abc2dcfe3c23e1c0ce108950c720826ab /hacks/glx/esper.c | |
parent | Update gitignore (diff) | |
download | xscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.tar.gz xscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.tar.xz xscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.zip |
Update to 5.42
Diffstat (limited to 'hacks/glx/esper.c')
-rw-r--r-- | hacks/glx/esper.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/hacks/glx/esper.c b/hacks/glx/esper.c index 7a0bb0b..e7d85a9 100644 --- a/hacks/glx/esper.c +++ b/hacks/glx/esper.c @@ -147,7 +147,6 @@ "*reticleColor: #FFFF77\n" \ "*textColor: #FFFFBB\n" \ -# define free_esper 0 # define refresh_esper 0 # define release_esper 0 # include "xlockmore.h" @@ -2327,6 +2326,7 @@ parse_color (ModeInfo *mi, char *key, GLfloat color[4]) key, string); exit (1); } + free (string); color[0] = xcolor.red / 65536.0; color[1] = xcolor.green / 65536.0; @@ -2390,7 +2390,7 @@ draw_esper (ModeInfo *mi) if (!ss->glx_context) return; - glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(ss->glx_context)); + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *ss->glx_context); mi->polygon_count = 0; @@ -2407,6 +2407,31 @@ draw_esper (ModeInfo *mi) glXSwapBuffers (MI_DISPLAY (mi), MI_WINDOW(mi)); } + +ENTRYPOINT void +free_esper (ModeInfo *mi) +{ + esper_state *ss = &sss[MI_SCREEN(mi)]; + int i; + if (!ss->glx_context) return; + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *ss->glx_context); + + if (ss->font_data) free_texture_font (ss->font_data); + for (i = 0; i < ss->nimages; i++) { + if (ss->images[i]) { + if (ss->images[i]->title) free (ss->images[i]->title); + if (ss->images[i]->texid) glDeleteTextures (1, &ss->images[i]->texid); + free (ss->images[i]); + } + } + for (i = 0; i < countof(ss->sprites); i++) { + if (ss->sprites[i]) { + if (ss->sprites[i]->text) free (ss->sprites[i]->text); + if (ss->sprites[i]) free (ss->sprites[i]); + } + } +} + XSCREENSAVER_MODULE ("Esper", esper) #endif /* USE_GL */ |