1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 17:20:00 +00:00

Font: Hud: Use orig. text dimensions, fix right-align calculations

This commit is contained in:
erorcun 2020-11-08 20:49:47 +03:00
parent a2e0373d22
commit fe5d0c9cdf
10 changed files with 67 additions and 52 deletions

View file

@ -73,7 +73,7 @@ CDarkel::DrawMessages()
{ {
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(30.0f)); CFont::SetCentreSize(SCREEN_SCALE_X(610.0f));
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetPropOn(); CFont::SetPropOn();
uint32 timePassedSinceStart = CTimer::GetTimeInMilliseconds() - TimeOfFrenzyStart; uint32 timePassedSinceStart = CTimer::GetTimeInMilliseconds() - TimeOfFrenzyStart;
@ -127,7 +127,7 @@ CDarkel::DrawMessages()
uint32 timePassedSinceStart = CTimer::GetTimeInMilliseconds() - TimeOfFrenzyStart; uint32 timePassedSinceStart = CTimer::GetTimeInMilliseconds() - TimeOfFrenzyStart;
if (CTimer::GetTimeInMilliseconds() - TimeOfFrenzyStart < 5000) { if (CTimer::GetTimeInMilliseconds() - TimeOfFrenzyStart < 5000) {
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(20.0f)); CFont::SetCentreSize(SCREEN_SCALE_X(620.0f));
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetScale(SCREEN_SCALE_X(1.5f), SCREEN_SCALE_Y(1.5f)); CFont::SetScale(SCREEN_SCALE_X(1.5f), SCREEN_SCALE_Y(1.5f));
CFont::SetJustifyOff(); CFont::SetJustifyOff();

View file

@ -1341,7 +1341,7 @@ void CGarages::PrintMessages()
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(50.0f)); CFont::SetCentreSize(SCREEN_SCALE_X(590.0f));
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));

View file

@ -767,8 +767,8 @@ CMenuManager::DrawStandardMenus(bool activeScreen)
CFont::SetBackGroundOnlyTextOff(); CFont::SetBackGroundOnlyTextOff();
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN)); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN));
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENU_UNK_WIDTH)); CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_UNK_X_MARGIN));
CFont::SetCentreSize(SCREEN_WIDTH); CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH));
switch (m_nCurrScreen) { switch (m_nCurrScreen) {
case MENUPAGE_CHOOSE_LOAD_SLOT: case MENUPAGE_CHOOSE_LOAD_SLOT:
@ -808,7 +808,7 @@ CMenuManager::DrawStandardMenus(bool activeScreen)
wchar *str; wchar *str;
if (aScreens[m_nCurrScreen].m_aEntries[0].m_Action == MENUACTION_LABEL) { if (aScreens[m_nCurrScreen].m_aEntries[0].m_Action == MENUACTION_LABEL) {
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENULABEL_X_MARGIN)); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENULABEL_X_MARGIN));
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENULABEL_WIDTH)); CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENULABEL_X_MARGIN));
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
CFont::SetScale(MENU_X(BIGTEXT2_X_SCALE), MENU_Y(BIGTEXT2_Y_SCALE)); CFont::SetScale(MENU_X(BIGTEXT2_X_SCALE), MENU_Y(BIGTEXT2_Y_SCALE));
CFont::SetRightJustifyOff(); CFont::SetRightJustifyOff();
@ -848,7 +848,7 @@ CMenuManager::DrawStandardMenus(bool activeScreen)
CFont::PrintString(MENU_X_LEFT_ALIGNED(100.0f), MENU_Y(97.0f), str); CFont::PrintString(MENU_X_LEFT_ALIGNED(100.0f), MENU_Y(97.0f), str);
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN)); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN));
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENU_UNK_WIDTH)); CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_UNK_X_MARGIN));
} }
if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) { if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) {
@ -1301,13 +1301,16 @@ CMenuManager::DrawStandardMenus(bool activeScreen)
break; break;
} }
nextYToUse = MENU_Y(150.f); // TODO(Miami): Temp // Not just unused, but also collides with the bug fix in Font.cpp. Yikes.
#ifndef FIX_BUGS
nextYToUse += MENU_DEFAULT_LINE_HEIGHT * CFont::GetNumberLines(MENU_X_LEFT_ALIGNED(60.0f), MENU_Y(nextYToUse), leftText); nextYToUse += MENU_DEFAULT_LINE_HEIGHT * CFont::GetNumberLines(MENU_X_LEFT_ALIGNED(60.0f), MENU_Y(nextYToUse), leftText);
#endif
// TODO(Miami): Remove here after audio page is done nextYToUse = 300.0f; // TODO(Miami): temp
// Radio icons // Radio icons
if (aScreens[m_nCurrScreen].m_aEntries[i].m_Action == MENUACTION_RADIO) { if (aScreens[m_nCurrScreen].m_aEntries[i].m_Action == MENUACTION_RADIO) {
// TODO(Miami): Remove those after audio page is done
ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_WILDSTYLE], MENU_X_LEFT_ALIGNED(30.0f), MENU_Y(nextYToUse), 0, HOVEROPTION_RADIO_0); ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_WILDSTYLE], MENU_X_LEFT_ALIGNED(30.0f), MENU_Y(nextYToUse), 0, HOVEROPTION_RADIO_0);
ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_FLASH], MENU_X_LEFT_ALIGNED(90.0f), MENU_Y(nextYToUse), 1, HOVEROPTION_RADIO_1); ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_FLASH], MENU_X_LEFT_ALIGNED(90.0f), MENU_Y(nextYToUse), 1, HOVEROPTION_RADIO_1);
ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_KCHAT], MENU_X_LEFT_ALIGNED(150.0f), MENU_Y(nextYToUse), 2, HOVEROPTION_RADIO_2); ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_KCHAT], MENU_X_LEFT_ALIGNED(150.0f), MENU_Y(nextYToUse), 2, HOVEROPTION_RADIO_2);
@ -1804,7 +1807,7 @@ CMenuManager::DrawControllerSetupScreen()
CFont::SetRightJustifyOff(); CFont::SetRightJustifyOff();
CFont::SetBackGroundOnlyTextOn(); CFont::SetBackGroundOnlyTextOn();
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN)); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN));
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENU_UNK_WIDTH)); CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_UNK_X_MARGIN));
PREPARE_MENU_HEADER PREPARE_MENU_HEADER
switch (m_ControlMethod) { switch (m_ControlMethod) {
@ -2256,7 +2259,7 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen)
CFont::SetRightJustifyOff(); CFont::SetRightJustifyOff();
CFont::SetBackGroundOnlyTextOn(); CFont::SetBackGroundOnlyTextOn();
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN)); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN));
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENU_UNK_WIDTH)); CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_UNK_X_MARGIN));
// lstrcpy's changed with strcpy // lstrcpy's changed with strcpy
if (!m_bSkinsEnumerated) { if (!m_bSkinsEnumerated) {
@ -3042,7 +3045,7 @@ CMenuManager::SmallMessageScreen(const char* text)
CFont::SetBackGroundOnlyTextOn(); CFont::SetBackGroundOnlyTextOn();
CSprite2d::DrawRect(CRect(SCREEN_STRETCH_X(95.0f), SCREEN_SCALE_FROM_BOTTOM(165.0f), SCREEN_STRETCH_FROM_RIGHT(95.0f), SCREEN_SCALE_Y(115.0f)), CRGBA(50, 50, 50, FadeIn(210))); CSprite2d::DrawRect(CRect(SCREEN_STRETCH_X(95.0f), SCREEN_SCALE_FROM_BOTTOM(165.0f), SCREEN_STRETCH_FROM_RIGHT(95.0f), SCREEN_SCALE_Y(115.0f)), CRGBA(50, 50, 50, FadeIn(210)));
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
CFont::SetCentreSize(SCREEN_STRETCH_X(430.0f)); CFont::SetCentreSize(SCREEN_SCALE_X(430.0f));
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetColor(CRGBA(LABEL_COLOR.r, LABEL_COLOR.g, LABEL_COLOR.b, FadeIn(255))); CFont::SetColor(CRGBA(LABEL_COLOR.r, LABEL_COLOR.g, LABEL_COLOR.b, FadeIn(255)));
CFont::SetDropShadowPosition(2); CFont::SetDropShadowPosition(2);
@ -4702,8 +4705,8 @@ CMenuManager::PrintMap(void)
CRadar::DrawBlips(); CRadar::DrawBlips();
if (m_PrefsShowLegends) { if (m_PrefsShowLegends) {
CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(40.0f)); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(40.0f));
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(84.0f)); CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(84.0f));
CFont::SetBackGroundOnlyTextOff(); CFont::SetBackGroundOnlyTextOff();
CFont::SetColor(CRGBA(LABEL_COLOR.r, LABEL_COLOR.g, LABEL_COLOR.b, FadeIn(255))); CFont::SetColor(CRGBA(LABEL_COLOR.r, LABEL_COLOR.g, LABEL_COLOR.b, FadeIn(255)));
CFont::SetDropShadowPosition(2); CFont::SetDropShadowPosition(2);
@ -4826,8 +4829,8 @@ CMenuManager::PrintMap(void)
#endif #endif
m_bMenuMapActive = false; m_bMenuMapActive = false;
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(10.0f)); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN));
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(10.0f)); CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_UNK_X_MARGIN));
DisplayHelperText("FEH_MPH"); DisplayHelperText("FEH_MPH");
} }

View file

@ -11,12 +11,10 @@
#define MENUHEADER_WIDTH 1.0f #define MENUHEADER_WIDTH 1.0f
#define MENU_UNK_X_MARGIN 10.0f #define MENU_UNK_X_MARGIN 10.0f
#define MENU_UNK_WIDTH 10.0f
#define MENUACTION_SCALE_MULT 0.9f #define MENUACTION_SCALE_MULT 0.9f
#define MENULABEL_X_MARGIN 80.0f #define MENULABEL_X_MARGIN 80.0f
#define MENULABEL_WIDTH 80.0f
#define MENULABEL_POS_X 100.0f #define MENULABEL_POS_X 100.0f
#define MENULABEL_POS_Y 97.0f #define MENULABEL_POS_Y 97.0f

View file

@ -137,7 +137,7 @@ void MessageScreen(char *msg)
CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(190.0f)); // 450.0f CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(190.0f)); // 450.0f
CFont::SetScale(SCREEN_SCALE_X(1.0f), SCREEN_SCALE_Y(1.0f)); CFont::SetScale(SCREEN_SCALE_X(1.0f), SCREEN_SCALE_Y(1.0f));
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(190.0f)); // 450.0f CFont::SetCentreSize(SCREEN_SCALE_X(450.0f));
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetColor(CRGBA(255, 255, 255, 255)); CFont::SetColor(CRGBA(255, 255, 255, 255));
CFont::SetDropColor(CRGBA(32, 32, 32, 255)); CFont::SetDropColor(CRGBA(32, 32, 32, 255));

View file

@ -3294,7 +3294,7 @@ void CPad::PrintErrorMessage(void)
CFont::SetScale(SCREEN_SCALE_X(0.85f), SCREEN_SCALE_Y(1.0f)); CFont::SetScale(SCREEN_SCALE_X(0.85f), SCREEN_SCALE_Y(1.0f));
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetCentreSize(SCREEN_STRETCH_FROM_RIGHT(50.0f)); CFont::SetCentreSize(SCREEN_SCALE_X(590.0f));
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetColor(CRGBA(255, 255, 200, 200)); CFont::SetColor(CRGBA(255, 255, 200, 200));
@ -3312,7 +3312,7 @@ void CPad::PrintErrorMessage(void)
CFont::SetScale(SCREEN_SCALE_X(0.85f), SCREEN_SCALE_Y(1.0f)); CFont::SetScale(SCREEN_SCALE_X(0.85f), SCREEN_SCALE_Y(1.0f));
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetCentreSize(SCREEN_STRETCH_FROM_RIGHT(50.0f)); CFont::SetCentreSize(SCREEN_SCALE_X(590.0f));
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetColor(CRGBA(255, 255, 200, 200)); CFont::SetColor(CRGBA(255, 255, 200, 200));

View file

@ -73,7 +73,7 @@ CCredits::Render(void)
scrolloffset = (CTimer::GetTimeInMilliseconds() - CreditsStartTime) / 24.0f; scrolloffset = (CTimer::GetTimeInMilliseconds() - CreditsStartTime) / 24.0f;
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetCentreSize(SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH * 0.75f)); CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.75f));
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetFontStyle(FONT_STANDARD); CFont::SetFontStyle(FONT_STANDARD);
@ -421,7 +421,7 @@ CCredits::Render(void)
PrintCreditText(0.65f, 0.65f, TheText.Get("CRED129"), lineoffset, scrolloffset); PrintCreditText(0.65f, 0.65f, TheText.Get("CRED129"), lineoffset, scrolloffset);
PrintCreditSpace(1.5f, lineoffset); PrintCreditSpace(1.5f, lineoffset);
CFont::SetCentreSize(SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH * 0.8f)); CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.8f));
PrintCreditText(1.1f, 0.8f, TheText.Get("CRD111A"), lineoffset, scrolloffset); PrintCreditText(1.1f, 0.8f, TheText.Get("CRD111A"), lineoffset, scrolloffset);
PrintCreditSpace(0.5f, lineoffset); PrintCreditSpace(0.5f, lineoffset);
@ -469,7 +469,7 @@ CCredits::Render(void)
PrintCreditSpace(0.5f, lineoffset); PrintCreditSpace(0.5f, lineoffset);
PrintCreditText(0.65f, 0.65f, TheText.Get("CRD134I"), lineoffset, scrolloffset); PrintCreditText(0.65f, 0.65f, TheText.Get("CRD134I"), lineoffset, scrolloffset);
CFont::SetCentreSize(SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH * 0.7f)); CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.7f));
PrintCreditSpace(1.5f, lineoffset); PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.1f, 0.8f, TheText.Get("CRED135"), lineoffset, scrolloffset); PrintCreditText(1.1f, 0.8f, TheText.Get("CRED135"), lineoffset, scrolloffset);
@ -505,7 +505,7 @@ CCredits::Render(void)
PrintCreditText(1.1f, 1.1f, TheText.Get("CRD140L"), lineoffset, scrolloffset); PrintCreditText(1.1f, 1.1f, TheText.Get("CRD140L"), lineoffset, scrolloffset);
PrintCreditSpace(1.5f, lineoffset); PrintCreditSpace(1.5f, lineoffset);
CFont::SetCentreSize(SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH * 0.85f)); CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.85f));
PrintCreditText(0.95f, 0.7f, TheText.Get("CRED259"), lineoffset, scrolloffset); PrintCreditText(0.95f, 0.7f, TheText.Get("CRED259"), lineoffset, scrolloffset);
PrintCreditSpace(0.5f, lineoffset); PrintCreditSpace(0.5f, lineoffset);
@ -586,7 +586,7 @@ CCredits::Render(void)
PrintCreditText(0.65f, 0.65f, TheText.Get("CRED172"), lineoffset, scrolloffset); PrintCreditText(0.65f, 0.65f, TheText.Get("CRED172"), lineoffset, scrolloffset);
PrintCreditSpace(0.5f, lineoffset); PrintCreditSpace(0.5f, lineoffset);
CFont::SetCentreSize(SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH * 0.75f)); CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.75f));
PrintCreditSpace(1.5f, lineoffset); PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(0.95f, 0.7f, TheText.Get("CRED217"), lineoffset, scrolloffset); PrintCreditText(0.95f, 0.7f, TheText.Get("CRED217"), lineoffset, scrolloffset);
@ -709,7 +709,7 @@ CCredits::Render(void)
PrintCreditText(0.65f, 0.65f, TheText.Get("CRED332"), lineoffset, scrolloffset); PrintCreditText(0.65f, 0.65f, TheText.Get("CRED332"), lineoffset, scrolloffset);
PrintCreditSpace(1.5f, lineoffset); PrintCreditSpace(1.5f, lineoffset);
CFont::SetCentreSize(SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH * 0.8f)); CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.8f));
PrintCreditText(0.95f, 0.7f, TheText.Get("CRED333"), lineoffset, scrolloffset); PrintCreditText(0.95f, 0.7f, TheText.Get("CRED333"), lineoffset, scrolloffset);
PrintCreditSpace(0.5f, lineoffset); PrintCreditSpace(0.5f, lineoffset);
@ -747,7 +747,7 @@ CCredits::Render(void)
PrintCreditSpace(1.5f, lineoffset); PrintCreditSpace(1.5f, lineoffset);
CFont::SetCentreSize(SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH * 0.75f)); CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.75f));
PrintCreditText(0.95f, 0.7f, TheText.Get("CRED267"), lineoffset, scrolloffset); PrintCreditText(0.95f, 0.7f, TheText.Get("CRED267"), lineoffset, scrolloffset);
PrintCreditSpace(0.5f, lineoffset); PrintCreditSpace(0.5f, lineoffset);

View file

@ -268,8 +268,8 @@ CFont::Initialise(void)
SetColor(CRGBA(0xFF, 0xFF, 0xFF, 0)); SetColor(CRGBA(0xFF, 0xFF, 0xFF, 0));
SetJustifyOff(); SetJustifyOff();
SetCentreOff(); SetCentreOff();
SetWrapx(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH)); SetWrapx(SCREEN_WIDTH);
SetCentreSize(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH)); SetCentreSize(SCREEN_WIDTH);
SetBackgroundOff(); SetBackgroundOff();
SetBackgroundColor(CRGBA(0x80, 0x80, 0x80, 0x80)); SetBackgroundColor(CRGBA(0x80, 0x80, 0x80, 0x80));
SetBackGroundOnlyTextOff(); SetBackGroundOnlyTextOff();
@ -646,7 +646,14 @@ CFont::GetNumberLines(float xstart, float ystart, wchar *s)
y = ystart; y = ystart;
while(*s){ while(*s){
#ifdef FIX_BUGS
float f = Details.centre ? Details.centreSize :
Details.rightJustify ? xstart - Details.rightJustifyWrap :
Details.wrapX;
#else
float f = (Details.centre ? Details.centreSize : Details.wrapX); float f = (Details.centre ? Details.centreSize : Details.wrapX);
#endif
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
if (IsJapaneseFont()) if (IsJapaneseFont())
f -= SCREEN_SCALE_X(21.0f * 2.0f); f -= SCREEN_SCALE_X(21.0f * 2.0f);
@ -726,8 +733,15 @@ CFont::GetTextRect(CRect *rect, float xstart, float ystart, wchar *s)
x = xstart; x = xstart;
y = ystart; y = ystart;
#ifdef FIX_BUGS
float xEnd = Details.centre ? Details.centreSize :
Details.rightJustify ? xstart - Details.rightJustifyWrap :
Details.wrapX;
#else
float xEnd = (Details.centre ? Details.centreSize : Details.wrapX);
#endif
while(*s){ while(*s){
if(x + GetStringWidth(s) > (Details.centre ? Details.centreSize : Details.wrapX)){ if(x + GetStringWidth(s) > xEnd){
// reached end of line // reached end of line
if(x > maxlength) if(x > maxlength)
maxlength = x; maxlength = x;

View file

@ -1095,7 +1095,7 @@ void CHud::Draw()
CFont::SetCentreOff(); CFont::SetCentreOff();
CFont::SetWrapx(SCALE_AND_CENTER_X(CTheScripts::IntroTextLines[i].m_fWrapX)); CFont::SetWrapx(SCALE_AND_CENTER_X(CTheScripts::IntroTextLines[i].m_fWrapX));
CFont::SetCentreSize(SCALE_AND_CENTER_X(CTheScripts::IntroTextLines[i].m_fCenterSize)); CFont::SetCentreSize(SCREEN_SCALE_X(CTheScripts::IntroTextLines[i].m_fCenterSize));
if (CTheScripts::IntroTextLines[i].m_bBackground) if (CTheScripts::IntroTextLines[i].m_bBackground)
CFont::SetBackgroundOn(); CFont::SetBackgroundOn();
@ -1168,7 +1168,7 @@ void CHud::Draw()
onceItWasWidescreen = true; onceItWasWidescreen = true;
if (FrontEndMenuManager.m_PrefsShowSubtitles || !CCutsceneMgr::IsRunning()) { if (FrontEndMenuManager.m_PrefsShowSubtitles || !CCutsceneMgr::IsRunning()) {
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(60.0f)); CFont::SetCentreSize(SCREEN_WIDTH - SCREEN_SCALE_X(60.0f));
CFont::SetScale(SCREEN_SCALE_X(0.58f), SCREEN_SCALE_Y(1.2f)); CFont::SetScale(SCREEN_SCALE_X(0.58f), SCREEN_SCALE_Y(1.2f));
CFont::PrintString(SCREEN_WIDTH / 2.f, SCREEN_SCALE_FROM_BOTTOM(80.0f), m_Message); CFont::PrintString(SCREEN_WIDTH / 2.f, SCREEN_SCALE_FROM_BOTTOM(80.0f), m_Message);
} }
@ -1182,11 +1182,11 @@ void CHud::Draw()
CFont::SetDropColor(CRGBA(0, 0, 0, 255)); CFont::SetDropColor(CRGBA(0, 0, 0, 255));
CFont::SetScale(SCREEN_SCALE_X(0.58f), SCREEN_SCALE_Y(1.22f)); CFont::SetScale(SCREEN_SCALE_X(0.58f), SCREEN_SCALE_Y(1.22f));
float offsetX = SCREEN_SCALE_X(140.0f) + SCREEN_SCALE_X(8.0f); float radarBulge = SCREEN_SCALE_X(140.0f) + SCREEN_SCALE_X(8.0f);
float center = SCREEN_SCALE_FROM_RIGHT(20.0f) - SCREEN_SCALE_X(8.0f) - offsetX; float rectWidth = SCREEN_WIDTH - SCREEN_SCALE_X(20.0f) - SCREEN_SCALE_X(8.0f) - radarBulge;
CFont::SetCentreSize(center); CFont::SetCentreSize(rectWidth);
CFont::PrintString(center / 2.0f + offsetX, SCREEN_SCALE_FROM_BOTTOM(105.f + 2.0f), m_Message); CFont::PrintString(rectWidth / 2.0f + radarBulge, SCREEN_SCALE_FROM_BOTTOM(105.f + 2.0f), m_Message);
} }
CFont::SetDropShadowPosition(0); CFont::SetDropShadowPosition(0);
} }
@ -1322,13 +1322,13 @@ void CHud::Draw()
} }
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(50.0f)); CFont::SetCentreSize(SCREEN_SCALE_X(590.0f));
CFont::SetColor(CRGBA(255, 255, 0, BigMessageAlpha[0])); // unused color CFont::SetColor(CRGBA(255, 255, 0, BigMessageAlpha[0])); // unused color
CFont::SetFontStyle(FONT_HEADING); CFont::SetFontStyle(FONT_HEADING);
// Appearently sliding text in here was abandoned very early, since this text is centered now. // Appearently sliding text in here was abandoned very early, since this text is centered now.
if (BigMessageX[0] >= SCREEN_SCALE_FROM_RIGHT(20.0f)) { if (BigMessageX[0] >= SCALE_AND_CENTER_X(620.0f)) {
BigMessageInUse[0] += CTimer::GetTimeStep(); BigMessageInUse[0] += CTimer::GetTimeStep();
if (BigMessageInUse[0] >= 120.0f) { if (BigMessageInUse[0] >= 120.0f) {
@ -1356,7 +1356,7 @@ void CHud::Draw()
} }
else { else {
BigMessageAlpha[0] = 0.0f; BigMessageAlpha[0] = 0.0f;
BigMessageX[0] = SCREEN_SCALE_FROM_RIGHT(DEFAULT_SCREEN_WIDTH + 60.0f); BigMessageX[0] = SCALE_AND_CENTER_X(-60.0f);
BigMessageInUse[0] = 1.0f; BigMessageInUse[0] = 1.0f;
} }
} }
@ -1435,7 +1435,7 @@ void CHud::DrawAfterFade()
CFont::SetCentreOff(); CFont::SetCentreOff();
CFont::SetWrapx(SCALE_AND_CENTER_X(line.m_fWrapX)); CFont::SetWrapx(SCALE_AND_CENTER_X(line.m_fWrapX));
CFont::SetCentreSize(SCALE_AND_CENTER_X(line.m_fCenterSize)); CFont::SetCentreSize(SCREEN_SCALE_X(line.m_fCenterSize));
if (line.m_bBackground) if (line.m_bBackground)
CFont::SetBackgroundOn(); CFont::SetBackgroundOn();
else else
@ -1481,7 +1481,7 @@ void CHud::DrawAfterFade()
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f)); CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f));
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(40.0f)); CFont::SetCentreSize(SCREEN_SCALE_X(600.0f));
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
CFont::SetDropShadowPosition(2); CFont::SetDropShadowPosition(2);
CFont::SetDropColor(CRGBA(0, 0, 0, 255)); CFont::SetDropColor(CRGBA(0, 0, 0, 255));
@ -1495,7 +1495,7 @@ void CHud::DrawAfterFade()
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f)); CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f));
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(60.0f)); CFont::SetCentreSize(SCREEN_SCALE_X(580.0f));
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
CFont::SetDropShadowPosition(2); CFont::SetDropShadowPosition(2);
CFont::SetDropColor(CRGBA(0, 0, 0, 255)); CFont::SetDropColor(CRGBA(0, 0, 0, 255));
@ -1550,7 +1550,7 @@ void CHud::DrawAfterFade()
CFont::SetScale(SCREEN_SCALE_X(1.0f), SCREEN_SCALE_Y(1.2f)); CFont::SetScale(SCREEN_SCALE_X(1.0f), SCREEN_SCALE_Y(1.2f));
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(80.0f)); CFont::SetCentreSize(SCREEN_SCALE_X(560.0f));
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
CFont::SetDropShadowPosition(2); CFont::SetDropShadowPosition(2);
CFont::SetDropColor(CRGBA(0, 0, 0, 255)); CFont::SetDropColor(CRGBA(0, 0, 0, 255));
@ -1581,7 +1581,7 @@ void CHud::DrawAfterFade()
CFont::SetScale(SCREEN_SCALE_X(1.04f), SCREEN_SCALE_Y(1.6f)); CFont::SetScale(SCREEN_SCALE_X(1.04f), SCREEN_SCALE_Y(1.6f));
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetRightJustifyWrap(0.0f); CFont::SetRightJustifyWrap(SCALE_AND_CENTER_X(0.0f));
CFont::SetRightJustifyOn(); CFont::SetRightJustifyOn();
CFont::SetFontStyle(FONT_BANK); CFont::SetFontStyle(FONT_BANK);
CFont::SetScale(FrontEndMenuManager.m_PrefsLanguage == CMenuManager::LANGUAGE_AMERICAN ? SCREEN_SCALE_X(1.7f) : SCREEN_SCALE_X(1.5f), SCREEN_SCALE_Y(1.8f)); CFont::SetScale(FrontEndMenuManager.m_PrefsLanguage == CMenuManager::LANGUAGE_AMERICAN ? SCREEN_SCALE_X(1.7f) : SCREEN_SCALE_X(1.5f), SCREEN_SCALE_Y(1.8f));

View file

@ -179,7 +179,7 @@ CSpecialFX::Render2DFXs(void)
CFont::SetScale(SCREEN_SCALE_X(1.5f), SCREEN_SCALE_Y(1.5f)); CFont::SetScale(SCREEN_SCALE_X(1.5f), SCREEN_SCALE_Y(1.5f));
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(20.0f)); CFont::SetCentreSize(SCREEN_SCALE_X(620.0f)); // unused
CFont::SetCentreOff(); CFont::SetCentreOff();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetColor(CRGBA(0, 255, 0, 200)); CFont::SetColor(CRGBA(0, 255, 0, 200));
@ -204,7 +204,7 @@ CSpecialFX::Render2DFXs(void)
CFont::SetScale(SCREEN_SCALE_X(1.5f), SCREEN_SCALE_Y(1.5f)); CFont::SetScale(SCREEN_SCALE_X(1.5f), SCREEN_SCALE_Y(1.5f));
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(20.0f)); CFont::SetCentreSize(SCREEN_SCALE_X(620.0f)); // unused
CFont::SetCentreOff(); CFont::SetCentreOff();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetColor(CRGBA(100, 100, 100, 200)); CFont::SetColor(CRGBA(100, 100, 100, 200));