Skip to content

Commit

Permalink
[Shared] Fix ocr_a font not working in console anymore after renderer…
Browse files Browse the repository at this point in the history
… restart.
  • Loading branch information
Daggolin committed Nov 11, 2023
1 parent 371b8d6 commit c54bc58
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions code/client/cl_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ void Con_DrawNotify (void)
currentColor = 7;
re.SetColor( g_color_table[currentColor] );

static int iFontIndex = re.RegisterFont("ocr_a");
int iFontIndex = cls.consoleFont;
float fFontScale = 1.0f;
int iPixelHeightToAdvance = 0;
if (re.Language_IsAsian())
Expand Down Expand Up @@ -765,7 +765,7 @@ void Con_DrawSolidConsole( float frac )
currentColor = 7;
re.SetColor( g_color_table[currentColor] );

static int iFontIndex = re.RegisterFont("ocr_a");
int iFontIndex = cls.consoleFont;
float fFontScale = 1.0f;
int iPixelHeightToAdvance = con.charHeight;
if (re.Language_IsAsian())
Expand Down
1 change: 1 addition & 0 deletions code/client/cl_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ void CL_InitRenderer( void ) {

// load character sets
cls.charSetShader = re.RegisterShaderNoMip("gfx/2d/charsgrid_med");
cls.consoleFont = re.RegisterFont( "ocr_a" );
cls.whiteShader = re.RegisterShader( "white" );
cls.consoleShader = re.RegisterShader( "console" );
g_console_field_width = cls.glconfig.vidWidth / SMALLCHAR_WIDTH - 2;
Expand Down
1 change: 1 addition & 0 deletions code/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ typedef struct {
qhandle_t charSetShader;
qhandle_t whiteShader;
qhandle_t consoleShader;
int consoleFont;
} clientStatic_t;

#define CON_TEXTSIZE 0x30000 //was 32768
Expand Down
4 changes: 2 additions & 2 deletions codemp/client/cl_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ void Con_DrawNotify (void)
currentColor = 7;
re->SetColor( g_color_table[currentColor] );

static int iFontIndex = re->RegisterFont("ocr_a");
int iFontIndex = cls.consoleFont;
float fFontScale = 1.0f;
int iPixelHeightToAdvance = 0;
if (re->Language_IsAsian())
Expand Down Expand Up @@ -928,7 +928,7 @@ void Con_DrawSolidConsole( float frac ) {
currentColor = 7;
re->SetColor( g_color_table[currentColor] );

static int iFontIndex = re->RegisterFont("ocr_a");
int iFontIndex = cls.consoleFont;
float fFontScale = 1.0f;
int iPixelHeightToAdvance = con.charHeight;
if (re->Language_IsAsian())
Expand Down
1 change: 1 addition & 0 deletions codemp/client/cl_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2290,6 +2290,7 @@ void CL_InitRenderer( void ) {

// load character sets
cls.charSetShader = re->RegisterShaderNoMip("gfx/2d/charsgrid_med");
cls.consoleFont = re->RegisterFont( "ocr_a" );

cls.whiteShader = re->RegisterShader( "white" );
cls.consoleShader = re->RegisterShader( "console" );
Expand Down
1 change: 1 addition & 0 deletions codemp/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ typedef struct clientStatic_s {
qhandle_t charSetShader;
qhandle_t whiteShader;
qhandle_t consoleShader;
int consoleFont;
} clientStatic_t;

#define CON_TEXTSIZE 0x30000 //was 32768
Expand Down

0 comments on commit c54bc58

Please sign in to comment.