summaryrefslogtreecommitdiffstats
path: root/hacks/glx/gibson.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/gibson.c')
-rw-r--r--hacks/glx/gibson.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/hacks/glx/gibson.c b/hacks/glx/gibson.c
index 8f99040..e90d8d2 100644
--- a/hacks/glx/gibson.c
+++ b/hacks/glx/gibson.c
@@ -1,4 +1,4 @@
-/* gibson, Copyright (c) 2020 Jamie Zawinski <jwz@jwz.org>
+/* gibson, Copyright (c) 2020-2021 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -14,7 +14,7 @@
* edge-lit etched perspex, each about four feet tall.
*/
-#define TOWER_FONT "-*-helvetica-bold-r-normal-*-*-480-*-*-*-*-*-*"
+#define TOWER_FONT "sans-serif bold 48"
#define DEFAULTS "*delay: 20000 \n" \
"*groundColor: #8A2BE2" "\n" \
@@ -26,8 +26,6 @@
"*wireframe: False \n" \
# define release_gibson 0
-#undef countof
-#define countof(x) (sizeof((x))/sizeof((*x)))
#include "xlockmore.h"
#include "colors.h"
@@ -441,10 +439,6 @@ draw_tower_face_text (ModeInfo *mi, GLfloat height, Bool which)
Bool wire2 = False; /* Debugging quads */
Bool bg_p = (which == 1 && do_tex && !wire);
- glColor4fv (which ? bp->tower_color2 : bp->tower_color);
- glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE,
- which ? bp->tower_color2 : bp->tower_color);
-
/* The texture is a tex_width x tex_height rectangle, of which we
only use the rbearing+lbearing x ascent+descent sub-rectangle.
Texture coordinates reference the tex_width x tex_height rectangle
@@ -479,6 +473,10 @@ draw_tower_face_text (ModeInfo *mi, GLfloat height, Bool which)
GLfloat m3 = m2 / (which ? 1 : height);
GLfloat h2 = height * (which ? 1-margin : 1);
+ glColor4fv (which ? bp->tower_color2 : bp->tower_color);
+ glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE,
+ which ? bp->tower_color2 : bp->tower_color);
+
glBindTexture (GL_TEXTURE_2D, bp->text[n].texid);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
@@ -1237,7 +1235,7 @@ draw_gibson (ModeInfo *mi)
if (do_tex)
{
glEnable (GL_TEXTURE_2D);
- enable_texture_string_parameters();
+ enable_texture_string_parameters (bp->text[0].font_data);
}
glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE);
@@ -1306,7 +1304,6 @@ free_gibson (ModeInfo *mi)
if (!bp->glx_context) return;
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *bp->glx_context);
- if (bp->towers) free (bp->towers);
if (bp->rot) free_rotator (bp->rot);
if (bp->rot2) free_rotator (bp->rot2);
if (glIsList(bp->ground_dlist)) glDeleteLists(bp->ground_dlist, 1);
@@ -1316,16 +1313,17 @@ free_gibson (ModeInfo *mi)
if (bp->text[i].font_data) free_texture_font (bp->text[i].font_data);
if (bp->text[i].text) free (bp->text[i].text);
}
- for (i = 0; i < bp->ntowers; i++)
- {
- for (j = 0; j < countof(bp->towers[i].fg_dlists); j++)
- {
- if (glIsList(bp->towers[i].fg_dlists[j]))
- glDeleteLists(bp->towers[i].fg_dlists[j], 1);
- if (glIsList(bp->towers[i].bg_dlists[j]))
- glDeleteLists(bp->towers[i].bg_dlists[j], 1);
- }
- }
+ if (bp->towers)
+ for (i = 0; i < bp->ntowers; i++)
+ {
+ for (j = 0; j < countof(bp->towers[i].fg_dlists); j++)
+ {
+ if (glIsList(bp->towers[i].fg_dlists[j]))
+ glDeleteLists(bp->towers[i].fg_dlists[j], 1);
+ if (glIsList(bp->towers[i].bg_dlists[j]))
+ glDeleteLists(bp->towers[i].bg_dlists[j], 1);
+ }
+ }
}