@@ -107,12 +107,6 @@ static glyphInfo_t *Glyph( int ch )
107107
108108void SCR_DrawConsoleFontUnichar ( float x, float y, int ch )
109109{
110- if ( cls.useLegacyConsoleFont )
111- {
112- SCR_DrawSmallUnichar ( ( int ) x, ( int ) y, ch );
113- return ;
114- }
115-
116110 if ( ch != ' ' )
117111 {
118112 glyphInfo_t *glyph = Glyph ( ch );
@@ -126,53 +120,6 @@ void SCR_DrawConsoleFontUnichar( float x, float y, int ch )
126120 }
127121}
128122
129- /*
130- ** SCR_DrawSmallUnichar
131- ** small chars are drawn at native screen resolution
132- */
133- void SCR_DrawSmallUnichar ( int x, int y, int ch )
134- {
135- int row, col;
136- float frow, fcol;
137- float size;
138-
139- if ( ch < 0x100 || cls.useLegacyConsoleFont )
140- {
141- if ( ch == ' ' ) {
142- return ;
143- }
144-
145- if ( y < -SMALLCHAR_HEIGHT ) {
146- return ;
147- }
148-
149- if ( ch >= 0x100 ) { ch = 0 ; }
150-
151- row = ch>>4 ;
152- col = ch&15 ;
153-
154- frow = row*0.0625 ;
155- fcol = col*0.0625 ;
156- size = 0.0625 ;
157-
158- // adjust for baseline
159- re.DrawStretchPic ( x, y - (int )( SMALLCHAR_HEIGHT / ( CONSOLE_FONT_VPADDING + 1 ) ),
160- SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT,
161- fcol, frow,
162- fcol + size, frow + size,
163- cls.charSetShader );
164- } else {
165- glyphInfo_t *glyph = Glyph ( ch );
166-
167- re.DrawStretchPic ( x, y, SMALLCHAR_WIDTH, glyph->imageHeight ,
168- glyph->s ,
169- glyph->t ,
170- glyph->s2 ,
171- glyph->t2 ,
172- glyph->glyph );
173- }
174- }
175-
176123/*
177124==================
178125SCR_DrawSmallString[Color]
@@ -335,9 +282,7 @@ void SCR_UpdateScreen()
335282
336283float SCR_ConsoleFontUnicharWidth ( int ch )
337284{
338- return cls.useLegacyConsoleFont
339- ? SMALLCHAR_WIDTH
340- : Glyph ( ch )->xSkip + cl_consoleFontKerning->value ;
285+ return Glyph ( ch )->xSkip + cl_consoleFontKerning->value ;
341286}
342287
343288float SCR_ConsoleFontCharWidth ( const char *s )
@@ -347,44 +292,18 @@ float SCR_ConsoleFontCharWidth( const char *s )
347292
348293float SCR_ConsoleFontCharHeight ()
349294{
350- return cls.useLegacyConsoleFont
351- ? SMALLCHAR_HEIGHT
352- : cls.consoleFont ->glyphBlock [0 ][(unsigned )' I' ].imageHeight + CONSOLE_FONT_VPADDING * cl_consoleFontSize->value ;
295+ return cls.consoleFont ->glyphBlock [0 ][(unsigned )' I' ].imageHeight + CONSOLE_FONT_VPADDING * cl_consoleFontSize->value ;
353296}
354297
355298float SCR_ConsoleFontCharVPadding ()
356299{
357- return cls.useLegacyConsoleFont
358- ? 0
359- : std::max ( 0 , -cls.consoleFont ->glyphBlock [0 ][(unsigned )' g' ].bottom >> 6 );
300+ return std::max ( 0 , -cls.consoleFont ->glyphBlock [0 ][(unsigned )' g' ].bottom >> 6 );
360301}
361302
362303float SCR_ConsoleFontStringWidth ( const char * s, int len )
363304{
364305 float width = 0 ;
365306
366- if ( cls.useLegacyConsoleFont )
367- {
368- if ( cls.useLegacyConsoleFace )
369- {
370- return len * SMALLCHAR_WIDTH;
371- }
372- else
373- {
374- int l = 0 ;
375- const char *str = s;
376-
377- while ( *str && len > 0 )
378- {
379- l++;
380- str += Q_UTF8_Width ( str );
381- len--;
382- }
383-
384- return l * SMALLCHAR_WIDTH;
385- }
386- }
387-
388307 while ( *s && len > 0 )
389308 {
390309 width += SCR_ConsoleFontCharWidth ( s );
0 commit comments