Improved font scaling

This commit is contained in:
Simon 2023-03-07 22:52:55 +00:00
parent 6d6b4cf3da
commit 80f4e9520a
7 changed files with 14 additions and 12 deletions

View File

@ -50,7 +50,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#define STEP_TIME 200 #define STEP_TIME 200
#define DUCK_TIME 100 #define DUCK_TIME 100
#define PAIN_TWITCH_TIME 200 #define PAIN_TWITCH_TIME 200
#define WEAPON_SELECT_TIME 1400 #define WEAPON_SELECT_TIME 1900
#define ITEM_SCALEUP_TIME 1000 #define ITEM_SCALEUP_TIME 1000
// Zoom vars // Zoom vars
#define ZOOM_TIME 150 // not currently used? #define ZOOM_TIME 150 // not currently used?
@ -780,7 +780,7 @@ Ghoul2 Insert End
#define CG_PULSE 0x00004000 #define CG_PULSE 0x00004000
#define FONT_SCALE 0.5f #define FONT_SCALE (1.0f / cg_hudScale.value)
void CG_DrawRect( float x, float y, float width, float height, float size, const float *color ); void CG_DrawRect( float x, float y, float width, float height, float size, const float *color );
void CG_FillRect( float x, float y, float width, float height, const float *color ); void CG_FillRect( float x, float y, float width, float height, const float *color );

View File

@ -276,9 +276,9 @@ void CG_CaptionText( const char *str, int sound)
s=(const char*)&text; s=(const char*)&text;
// tai... // tai...
// s="賽卓哥爾博士已經安全了,我也把所有發現報告給「商店」。很不幸地,瑞士警局有些白癡發現了一些狀況,準備在機場逮捕亞歷西‧納克瑞得。他偽裝成外交使節,穿過了層層防備。現在他握有人質,並且威脅要散播病毒。根據最新的報告,納克瑞得以及他的黨羽已經完全佔據了機場。我受命來追捕納克瑞得以及救出所有人質。這並不容易。"; // s="<EFBFBD>ɨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>դh<EFBFBD>w<EFBFBD>g<EFBFBD>w<EFBFBD><EFBFBD><EFBFBD>F<EFBFBD>A<EFBFBD>ڤ]<5D><>Ҧ<EFBFBD><D2A6>o<EFBFBD>{<7B><><EFBFBD>i<EFBFBD><69><EFBFBD>u<EFB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顫歜檜棻 詩萼. 斜菟檜 蜓フ渠煎 啻陛 澀ブ雖 晦渠ビ啊棻."; // s="Wp:<EFBFBD><EFBFBD>Ÿ<EFBFBD><EFBFBD><EFBFBD>̴<EFBFBD> <20>ָ<EFBFBD>. <20>׵<EFBFBD><D7B5><EFBFBD> <20><><EFBFBD>Ѵ<EFBFBD><D1B4> <20>װ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ϰڴ<CFB0>.<2E><>Ÿ<EFBFBD><C5B8><EFBFBD>̴<EFBFBD> <20>ָ<EFBFBD>. <20>׵<EFBFBD><D7B5><EFBFBD> <20><><EFBFBD>Ѵ<EFBFBD><D1B4> <20>װ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ϰڴ<CFB0>.";
holds = s; holds = s;
int iPlayingTimeMS = cgi_S_GetSampleLength(sound); int iPlayingTimeMS = cgi_S_GetSampleLength(sound);
@ -733,7 +733,7 @@ void CG_DrawCenterString( void )
return; return;
} }
color = CG_FadeColor( cg.centerPrintTime, 1000 * 3 ); color = CG_FadeColor( cg.centerPrintTime, 1000 * 2 );
if ( !color ) { if ( !color ) {
return; return;
} }

View File

@ -2212,7 +2212,9 @@ void CG_DrawWeaponSelect( void )
{ {
int w = cgi_R_Font_StrLenPixels(text, cgs.media.qhFontSmall, 1.0f); int w = cgi_R_Font_StrLenPixels(text, cgs.media.qhFontSmall, 1.0f);
int x = ( SCREEN_WIDTH - w ) / 2; int x = ( SCREEN_WIDTH - w ) / 2;
cgi_R_Font_DrawString(x, (SCREEN_HEIGHT - 24)+yOffset, text, textColor, cgs.media.qhFontSmall, -1, 1.0f); int y = (SCREEN_HEIGHT - 24);
CG_AdjustFrom640Int(&x, &y, NULL, NULL);
cgi_R_Font_DrawString(x, y, text, textColor, cgs.media.qhFontSmall, -1, FONT_SCALE);
} }
} }

View File

@ -568,5 +568,5 @@ void CG_DrawProportionalString( int x, int y, const char* str, int style, vec4_t
{ {
//assert(!style);//call this directly if you need style (OR it into the font handle) //assert(!style);//call this directly if you need style (OR it into the font handle)
CG_AdjustFrom640Int(&x, &y, NULL, NULL); CG_AdjustFrom640Int(&x, &y, NULL, NULL);
cgi_R_Font_DrawString (x, y, str, color, cgs.media.qhFontMedium, -1, 1.0f); cgi_R_Font_DrawString (x, y, str, color, cgs.media.qhFontMedium, -1, FONT_SCALE);
} }

View File

@ -50,7 +50,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#define STEP_TIME 200 #define STEP_TIME 200
#define DUCK_TIME 100 #define DUCK_TIME 100
#define PAIN_TWITCH_TIME 200 #define PAIN_TWITCH_TIME 200
#define WEAPON_SELECT_TIME 1400 #define WEAPON_SELECT_TIME 1900
#define ITEM_SCALEUP_TIME 1000 #define ITEM_SCALEUP_TIME 1000
// Zoom vars // Zoom vars
#define ZOOM_TIME 150 // not currently used? #define ZOOM_TIME 150 // not currently used?
@ -760,7 +760,7 @@ Ghoul2 Insert End
#define CG_UNDERLINE 0x00008000 #define CG_UNDERLINE 0x00008000
#define CG_TINYFONT 0x00010000 #define CG_TINYFONT 0x00010000
#define FONT_SCALE 0.5f #define FONT_SCALE (1.0f / cg_hudScale.value)
void CG_FillRect( float x, float y, float width, float height, const float *color ); void CG_FillRect( float x, float y, float width, float height, const float *color );
void CG_Scissor( float x, float y, float width, float height); void CG_Scissor( float x, float y, float width, float height);

View File

@ -727,7 +727,7 @@ void CG_DrawCenterString( void )
return; return;
} }
color = CG_FadeColor( cg.centerPrintTime, 1000 * 3 ); color = CG_FadeColor( cg.centerPrintTime, 1000 * 2 );
if ( !color ) { if ( !color ) {
return; return;
} }

View File

@ -811,7 +811,7 @@ static float CG_CalculateWeaponPositionAndScale( playerState_t *ps, vec3_t origi
int w = cgi_R_Font_StrLenPixels(vr->test_name, cgs.media.qhFontSmall, 1.0f); int w = cgi_R_Font_StrLenPixels(vr->test_name, cgs.media.qhFontSmall, 1.0f);
int x = ( SCREEN_WIDTH - w ) / 2; int x = ( SCREEN_WIDTH - w ) / 2;
cgi_R_Font_DrawString(x, (SCREEN_HEIGHT / 2), vr->test_name, colorTable[CT_ICON_BLUE], cgs.media.qhFontSmall, -1, 1.0f); cgi_R_Font_DrawString(x, (SCREEN_HEIGHT / 2), vr->test_name, colorTable[CT_ICON_BLUE], cgs.media.qhFontSmall, -1, FONT_SCALE);
} else { } else {
if (ps->weapon != 0) if (ps->weapon != 0)
{ {
@ -2181,7 +2181,7 @@ void CG_DrawWeaponSelect( void )
int x = ( SCREEN_WIDTH - w ) / 2; int x = ( SCREEN_WIDTH - w ) / 2;
int y = (SCREEN_HEIGHT - 24); int y = (SCREEN_HEIGHT - 24);
CG_AdjustFrom640Int(&x, &y, NULL, NULL); CG_AdjustFrom640Int(&x, &y, NULL, NULL);
cgi_R_Font_DrawString(x, y, text, textColor, cgs.media.qhFontSmall, -1, 1.0f); cgi_R_Font_DrawString(x, y, text, textColor, cgs.media.qhFontSmall, -1, FONT_SCALE);
} }
} }