Skip to content

Commit f99ea68

Browse files
committed
Remove unused font things
RE_Glyph(), fontInfo_t::height, fontInfo_t::glyphScale, a couple macros
1 parent f82cda6 commit f99ea68

File tree

6 files changed

+3
-30
lines changed

6 files changed

+3
-30
lines changed

src/engine/RefAPI.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ struct refexport_t {
7777
qhandle_t( *RegisterShader )( const char* name, int flags );
7878
fontInfo_t* ( *RegisterFont )( const char* fontName, int pointSize );
7979
void ( *UnregisterFont )( fontInfo_t* font );
80-
void ( *Glyph )( fontInfo_t* font, const char* str, glyphInfo_t* glyph );
8180
void ( *GlyphChar )( fontInfo_t* font, int ch, glyphInfo_t* glyph );
8281

8382
void ( *LoadWorld )( const char* name );

src/engine/null/null_renderer.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fontInfo_t* RE_RegisterFont( const char *, int )
5454
{
5555
return nullptr;
5656
}
57-
void RE_Glyph( fontInfo_t *, const char *, glyphInfo_t *glyph )
57+
void RE_GlyphChar( fontInfo_t *, int, glyphInfo_t *glyph )
5858
{
5959
glyph->height = 1;
6060
glyph->top = 1;
@@ -70,10 +70,6 @@ void RE_Glyph( fontInfo_t *, const char *, glyphInfo_t *glyph )
7070
glyph->glyph = 1;
7171
glyph->shaderName[0] = '\0';
7272
}
73-
void RE_GlyphChar( fontInfo_t *font, int, glyphInfo_t *glyph )
74-
{
75-
RE_Glyph( font, nullptr, glyph );
76-
}
7773
void RE_UnregisterFont( fontInfo_t* ) { }
7874
void RE_LoadWorldMap( const char * ) { }
7975
void RE_SetWorldVisData( const byte * ) { }
@@ -205,7 +201,6 @@ refexport_t *GetRefAPI( int, refimport_t* )
205201
re.RegisterSkin = RE_RegisterSkin;
206202
re.RegisterShader = RE_RegisterShader;
207203
re.RegisterFont = RE_RegisterFont;
208-
re.Glyph = RE_Glyph;
209204
re.GlyphChar = RE_GlyphChar;
210205
re.UnregisterFont = RE_UnregisterFont;
211206
re.LoadWorld = RE_LoadWorldMap;

src/engine/qcommon/q_shared.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2156,8 +2156,6 @@ union OpaquePlayerState {
21562156

21572157
#define GLYPH_START 0
21582158
#define GLYPH_END 255
2159-
#define GLYPH_CHARSTART 32
2160-
#define GLYPH_CHAREND 127
21612159
#define GLYPHS_PER_FONT ( GLYPH_END - GLYPH_START + 1 )
21622160
struct glyphInfo_t
21632161
{
@@ -2186,8 +2184,6 @@ struct fontInfo_t
21862184
void *face, *faceData;
21872185
glyphInfo_t *glyphBlock[0x110000 / 256]; // glyphBlock_t
21882186
int pointSize;
2189-
int height;
2190-
float glyphScale;
21912187
char name[ MAX_QPATH ];
21922188
};
21932189

src/engine/renderer/tr_font.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,6 @@ void RE_GlyphChar( fontInfo_t *font, int ch, glyphInfo_t *glyph )
360360
*glyph = font->glyphBlock[ ch / 256][ ch % 256 ];
361361
}
362362

363-
void RE_Glyph( fontInfo_t *font, const char *str, glyphInfo_t *glyph )
364-
{
365-
RE_GlyphChar( font, Q_UTF8_CodePoint( str ), glyph );
366-
}
367-
368363
static void RE_StoreImage( fontInfo_t *font, int chunk, int page, int from, int to, const unsigned char *bitmap, int yEnd )
369364
{
370365
int scaledSize = FONT_SIZE * FONT_SIZE;
@@ -642,7 +637,6 @@ fontInfo_t* RE_RegisterFont( const char *fontName, int pointSize )
642637
if ( len > 0x5004 && len <= 0x5004 + MAX_QPATH ) // 256 glyphs, scale info, and the bitmap name
643638
{
644639
glyphInfo_t *glyphs;
645-
int height = 0;
646640

647641
ri.FS_ReadFile( fileName, &faceData );
648642
fdOffset = 0;
@@ -652,13 +646,7 @@ fontInfo_t* RE_RegisterFont( const char *fontName, int pointSize )
652646

653647
for ( i = 0; i < GLYPHS_PER_FONT; i++ )
654648
{
655-
glyphs[ i ].height = readInt();
656-
657-
if ( glyphs[ i ].height > height )
658-
{
659-
height = glyphs[ i ].height;
660-
}
661-
649+
/* height */ readInt();
662650
glyphs[ i ].top = readInt();
663651
glyphs[ i ].bottom = readInt();
664652
glyphs[ i ].pitch = readInt();
@@ -675,8 +663,7 @@ fontInfo_t* RE_RegisterFont( const char *fontName, int pointSize )
675663
}
676664

677665
font->pointSize = pointSize;
678-
font->height = height;
679-
font->glyphScale = readFloat();
666+
/* glyphScale */ readFloat();
680667
Q_strncpyz( font->name, registeredName, sizeof( font->name ) );
681668

682669
ri.FS_FreeFile( faceData );
@@ -728,8 +715,6 @@ fontInfo_t* RE_RegisterFont( const char *fontName, int pointSize )
728715
font->face = face;
729716
font->faceData = faceData;
730717
font->pointSize = pointSize;
731-
font->glyphScale = 64.0f / pointSize;
732-
font->height = ceil( ( face->height / 64.0 ) * ( face->size->metrics.y_scale / 65536.0 ) * font->glyphScale );
733718

734719
RE_RenderChunk( font, 0 );
735720

src/engine/renderer/tr_init.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,6 @@ ScreenshotCmd screenshotPNGRegistration("screenshotPNG", ssFormat_t::SSF_PNG, "p
16601660
re.SetMatrixTransform = RE_SetMatrixTransform;
16611661
re.ResetMatrixTransform = RE_ResetMatrixTransform;
16621662

1663-
re.Glyph = RE_Glyph;
16641663
re.GlyphChar = RE_GlyphChar;
16651664
re.RegisterFont = RE_RegisterFont;
16661665
re.UnregisterFont = RE_UnregisterFont;

src/engine/renderer/tr_local.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3668,7 +3668,6 @@ void GLimp_LogComment_( std::string comment );
36683668
void R_DoneFreeType();
36693669
fontInfo_t* RE_RegisterFont( const char *fontName, int pointSize );
36703670
void RE_UnregisterFont( fontInfo_t *font );
3671-
void RE_Glyph(fontInfo_t *font, const char *str, glyphInfo_t *glyph);
36723671
void RE_GlyphChar(fontInfo_t *font, int ch, glyphInfo_t *glyph);
36733672

36743673
void R_SetAltShaderTokens( const char * );

0 commit comments

Comments
 (0)