2dlib: Fix set but not used compiler warning in font.cpp

This fixes a set but not used compiler warning in Release builds in
2dlib/font.cpp.
This commit is contained in:
Sebastian Holtermann 2024-10-30 19:05:49 +01:00
parent b43a5bb039
commit 0e8980ea13

View File

@ -631,7 +631,7 @@ int grFont::draw_char(grSurface *sf, int x, int y, int ch, tCharProperties *chpr
int grFont::draw_char(grSurface *sf, int x, int y, int ch, int sx, int sy, int sw, int sh, tCharProperties *chprop) { int grFont::draw_char(grSurface *sf, int x, int y, int ch, int sx, int sy, int sw, int sh, tCharProperties *chprop) {
gr_font_record *ft; gr_font_record *ft;
int next_x = 0, width, index; int next_x = 0, index;
ASSERT(m_FontHandle > -1); ASSERT(m_FontHandle > -1);
if ((ch < min_ascii()) || (ch > max_ascii())) if ((ch < min_ascii()) || (ch > max_ascii()))
@ -643,6 +643,7 @@ int grFont::draw_char(grSurface *sf, int x, int y, int ch, int sx, int sy, int s
index = ch - ft->font.min_ascii; index = ch - ft->font.min_ascii;
// draw either a color bitmap or mono font. // draw either a color bitmap or mono font.
[[maybe_unused]] int width;
if (ft->font.flags & FT_PROPORTIONAL) { if (ft->font.flags & FT_PROPORTIONAL) {
width = (int)ft->font.char_widths[index]; width = (int)ft->font.char_widths[index];
} else { } else {