Some cleanup for non-ENHANCED_SYMBOLS build

This commit is contained in:
Ray Chason
2022-11-05 18:34:44 -04:00
parent 69d76ed4b6
commit 0322ea9341
+13 -7
View File
@@ -59,11 +59,13 @@ extern int total_tiles_used, Tile_corr;
static X11_map_symbol glyph_char(const glyph_info *glyphinfo); static X11_map_symbol glyph_char(const glyph_info *glyphinfo);
static GC X11_make_gc(struct xwindow *wp, struct text_map_info_t *text_map, static GC X11_make_gc(struct xwindow *wp, struct text_map_info_t *text_map,
X11_color color, boolean inverted); X11_color color, boolean inverted);
#ifdef ENHANCED_SYMBOLS
static void X11_free_gc(struct xwindow *wp, GC gc, X11_color color); static void X11_free_gc(struct xwindow *wp, GC gc, X11_color color);
static void X11_set_map_font(struct xwindow *wp);
#endif
static void X11_draw_image_string(Display *display, Drawable d, static void X11_draw_image_string(Display *display, Drawable d,
GC gc, int x, int y, GC gc, int x, int y,
const X11_map_symbol *string, int length); const X11_map_symbol *string, int length);
static void X11_set_map_font(struct xwindow *wp);
static Font X11_get_map_font(struct xwindow *wp); static Font X11_get_map_font(struct xwindow *wp);
static XFontStruct *X11_get_map_font_struct(struct xwindow *wp); static XFontStruct *X11_get_map_font_struct(struct xwindow *wp);
static boolean init_tiles(struct xwindow *); static boolean init_tiles(struct xwindow *);
@@ -1475,7 +1477,9 @@ map_update(struct xwindow *wp, int start_row, int stop_row, int start_col, int s
+ (text_map->square_width + (text_map->square_width
* (cur_col - COL0_OFFSET)), * (cur_col - COL0_OFFSET)),
win_ystart, t_ptr, count); win_ystart, t_ptr, count);
#ifdef ENHANCED_SYMBOLS
X11_free_gc(wp, gc, color); X11_free_gc(wp, gc, color);
#endif
/* move text pointer and column count */ /* move text pointer and column count */
t_ptr += count; t_ptr += count;
@@ -1516,7 +1520,7 @@ map_update(struct xwindow *wp, int start_row, int stop_row, int start_col, int s
#ifdef TEXTCOLOR #ifdef TEXTCOLOR
static GC static GC
X11_make_gc(struct xwindow *wp, struct text_map_info_t *text_map, X11_make_gc(struct xwindow *wp UNUSED, struct text_map_info_t *text_map,
X11_color color, boolean inverted) X11_color color, boolean inverted)
{ {
boolean cur_inv = inverted; boolean cur_inv = inverted;
@@ -1571,16 +1575,16 @@ X11_make_gc(struct xwindow *wp, struct text_map_info_t *text_map,
return gc; return gc;
} }
#ifdef ENHANCED_SYMBOLS
static void static void
X11_free_gc(struct xwindow *wp, GC gc, X11_color color) X11_free_gc(struct xwindow *wp, GC gc, X11_color color)
{ {
#ifdef ENHANCED_SYMBOLS
if ((color & 0x80000000) != 0 && iflags.use_color) { if ((color & 0x80000000) != 0 && iflags.use_color) {
/* X11_make_gc allocated a new GC */ /* X11_make_gc allocated a new GC */
XtReleaseGC(wp->w, gc); XtReleaseGC(wp->w, gc);
} }
#endif
} }
#endif
#endif /* TEXTCOLOR */ #endif /* TEXTCOLOR */
static void static void
@@ -1737,7 +1741,9 @@ create_map_window(
map_info = wp->map_information = map_info = wp->map_information =
(struct map_info_t *) alloc(sizeof (struct map_info_t)); (struct map_info_t *) alloc(sizeof (struct map_info_t));
#ifdef ENHANCED_SYMBOLS
X11_set_map_font(wp); X11_set_map_font(wp);
#endif
map_info->viewport_width = map_info->viewport_height = 0; map_info->viewport_width = map_info->viewport_height = 0;
@@ -1786,10 +1792,10 @@ create_map_window(
map_all_unexplored(map_info); map_all_unexplored(map_info);
} }
#ifdef ENHANCED_SYMBOLS
static void static void
X11_set_map_font(struct xwindow *wp) X11_set_map_font(struct xwindow *wp)
{ {
#ifdef ENHANCED_SYMBOLS
struct map_info_t *map_info = wp->map_information; struct map_info_t *map_info = wp->map_information;
XFontStruct *fs; XFontStruct *fs;
Atom font_atom; Atom font_atom;
@@ -1839,8 +1845,8 @@ X11_set_map_font(struct xwindow *wp)
/* Fallback in case no iso10646 */ /* Fallback in case no iso10646 */
map_info->text_map.font = fs; map_info->text_map.font = fs;
} }
#endif
} }
#endif
static Font static Font
X11_get_map_font(struct xwindow *wp) X11_get_map_font(struct xwindow *wp)
@@ -1859,7 +1865,7 @@ X11_get_map_font_struct(struct xwindow *wp)
} }
return fs; return fs;
#else #else
return WindowFont(wp->w); return WindowFontStruct(wp->w);
#endif #endif
} }