engine: client: make color array of DrawString functions const

This commit is contained in:
Alibek Omarov 2025-02-23 06:46:22 +03:00
parent 0c8da36a0b
commit fe1fd5b024
4 changed files with 9 additions and 9 deletions

View file

@ -173,7 +173,7 @@ static int CL_CalcTabStop( const cl_font_t *font, int x )
return stop;
}
int CL_DrawCharacter( float x, float y, int number, rgba_t color, cl_font_t *font, int flags )
int CL_DrawCharacter( float x, float y, int number, const rgba_t color, cl_font_t *font, int flags )
{
wrect_t *rc;
float w, h;
@ -231,7 +231,7 @@ int CL_DrawCharacter( float x, float y, int number, rgba_t color, cl_font_t *fon
return font->charWidths[number];
}
int CL_DrawString( float x, float y, const char *s, rgba_t color, cl_font_t *font, int flags )
int CL_DrawString( float x, float y, const char *s, const rgba_t color, cl_font_t *font, int flags )
{
rgba_t current_color;
int draw_len = 0;
@ -287,7 +287,7 @@ int CL_DrawString( float x, float y, const char *s, rgba_t color, cl_font_t *fon
return draw_len;
}
int CL_DrawStringf( cl_font_t *font, float x, float y, rgba_t color, int flags, const char *fmt, ... )
int CL_DrawStringf( cl_font_t *font, float x, float y, const rgba_t color, int flags, const char *fmt, ... )
{
va_list va;
char buf[MAX_VA_STRING];

View file

@ -807,11 +807,11 @@ qboolean Con_LoadFixedWidthFont( const char *fontname, cl_font_t *font, float sc
qboolean Con_LoadVariableWidthFont( const char *fontname, cl_font_t *font, float scale, convar_t *rendermode, uint texFlags );
void CL_FreeFont( cl_font_t *font );
void CL_SetFontRendermode( cl_font_t *font );
int CL_DrawCharacter( float x, float y, int number, rgba_t color, cl_font_t *font, int flags );
int CL_DrawString( float x, float y, const char *s, rgba_t color, cl_font_t *font, int flags );
int CL_DrawCharacter( float x, float y, int number, const rgba_t color, cl_font_t *font, int flags );
int CL_DrawString( float x, float y, const char *s, const rgba_t color, cl_font_t *font, int flags );
void CL_DrawCharacterLen( cl_font_t *font, int number, int *width, int *height );
void CL_DrawStringLen( cl_font_t *font, const char *s, int *width, int *height, int flags );
int CL_DrawStringf( cl_font_t *font, float x, float y, rgba_t color, int flags, const char *fmt, ... ) FORMAT_CHECK( 6 );
int CL_DrawStringf( cl_font_t *font, float x, float y, const rgba_t color, int flags, const char *fmt, ... ) FORMAT_CHECK( 6 );
//
@ -1107,7 +1107,7 @@ int Con_UtfMoveRight( char *str, int pos, int length );
void Con_DefaultColor( int r, int g, int b, qboolean gameui );
cl_font_t *Con_GetCurFont( void );
cl_font_t *Con_GetFont( int num );
int Con_DrawString( int x, int y, const char *string, rgba_t setColor ); // legacy, use cl_font.c
int Con_DrawString( int x, int y, const char *string, const rgba_t setColor ); // legacy, use cl_font.c
void GAME_EXPORT Con_DrawStringLen( const char *pText, int *length, int *height ); // legacy, use cl_font.c
void Con_CharEvent( int key );
void Key_Console( int key );

View file

@ -759,7 +759,7 @@ Con_DrawString
client version of routine
====================
*/
int Con_DrawString( int x, int y, const char *string, rgba_t setColor )
int Con_DrawString( int x, int y, const char *string, const rgba_t setColor )
{
return CL_DrawString( x, y, string, setColor, con.curFont, FONT_DRAW_UTF8 );
}

View file

@ -348,7 +348,7 @@ typedef struct ref_api_s
void (*Con_NXPrintf)( struct con_nprint_s *info, const char *fmt, ... ) FORMAT_CHECK( 2 );
void (*CL_CenterPrint)( const char *s, float y );
void (*Con_DrawStringLen)( const char *pText, int *length, int *height );
int (*Con_DrawString)( int x, int y, const char *string, rgba_t setColor );
int (*Con_DrawString)( int x, int y, const char *string, const rgba_t setColor );
void (*CL_DrawCenterPrint)( void );
// entity management