Fix font rendering

This commit is contained in:
smallmodel 2024-12-20 21:53:33 +01:00
parent 7e150c7a8a
commit 954d096261
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -535,8 +535,8 @@ void R_LoadFontShader(fontheader_sgl_t* font)
{ {
if (fontshader->stages[0] != NULL && fontshader->stages[0]->active) if (fontshader->stages[0] != NULL && fontshader->stages[0]->active)
{ {
fontshader->stages[0]->rgbGen = CGEN_GLOBAL_COLOR; fontshader->stages[0]->rgbGen = CGEN_ENTITY;
fontshader->stages[0]->alphaGen = AGEN_GLOBAL_ALPHA; fontshader->stages[0]->alphaGen = AGEN_ENTITY;
} }
} }
@ -585,6 +585,9 @@ void R_DrawString_sgl(fontheader_sgl_t* font, const char* text, float x, float y
R_LoadFontShader(font); R_LoadFontShader(font);
} }
Vector4Copy(backEnd.color2D, backEnd.entity2D.e.shaderRGBA);
backEnd.currentEntity = &backEnd.entity2D;
charHeight = s_fontHeightScale * font->height * s_fontGeneralScale; charHeight = s_fontHeightScale * font->height * s_fontGeneralScale;
RB_BeginSurface((shader_t*)font->shader, 0, 0); RB_BeginSurface((shader_t*)font->shader, 0, 0);