Merge pull request #909 from Fire-Head/master

Sprite Scaling Option
This commit is contained in:
Fire_Head 2021-01-08 19:43:31 +03:00 committed by GitHub
commit 6e42c791cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 199 additions and 427 deletions

Binary file not shown.

View File

@ -1459,18 +1459,34 @@ CMenuManager::Draw()
#else #else
switch (m_PrefsUseWideScreen) { switch (m_PrefsUseWideScreen) {
case AR_AUTO: case AR_AUTO:
sprintf(asciiTemp, "AUTO"); rightText = TheText.Get("FEM_AUT");
break; break;
case AR_4_3: case AR_4_3:
sprintf(asciiTemp, "4:3"); sprintf(asciiTemp, "4:3");
AsciiToUnicode(asciiTemp, unicodeTemp);
rightText = unicodeTemp;
break;
case AR_5_4:
sprintf(asciiTemp, "5:4");
AsciiToUnicode(asciiTemp, unicodeTemp);
rightText = unicodeTemp;
break;
case AR_16_10:
sprintf(asciiTemp, "16:10");
AsciiToUnicode(asciiTemp, unicodeTemp);
rightText = unicodeTemp;
break; break;
case AR_16_9: case AR_16_9:
sprintf(asciiTemp, "16:9"); sprintf(asciiTemp, "16:9");
break;
}
AsciiToUnicode(asciiTemp, unicodeTemp); AsciiToUnicode(asciiTemp, unicodeTemp);
rightText = unicodeTemp; rightText = unicodeTemp;
break;
case AR_21_9:
sprintf(asciiTemp, "21:9");
AsciiToUnicode(asciiTemp, unicodeTemp);
rightText = unicodeTemp;
break;
}
#endif #endif
break; break;
case MENUACTION_RADIO: case MENUACTION_RADIO:
@ -5252,12 +5268,12 @@ CMenuManager::ProcessButtonPresses(void)
case MENUACTION_WIDESCREEN: case MENUACTION_WIDESCREEN:
if (changeValueBy > 0) { if (changeValueBy > 0) {
m_PrefsUseWideScreen++; m_PrefsUseWideScreen++;
if (m_PrefsUseWideScreen > 2) if (m_PrefsUseWideScreen > AR_MAX-1)
m_PrefsUseWideScreen = 0; m_PrefsUseWideScreen = 0;
} else { } else {
m_PrefsUseWideScreen--; m_PrefsUseWideScreen--;
if (m_PrefsUseWideScreen < 0) if (m_PrefsUseWideScreen < 0)
m_PrefsUseWideScreen = 2; m_PrefsUseWideScreen = AR_MAX-1;
} }
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0);
SaveSettings(); SaveSettings();

View File

@ -91,8 +91,26 @@ VALIDATE_SIZE(sRadarTrace, 0x30);
#else #else
#define RADAR_BOTTOM (47.0f) #define RADAR_BOTTOM (47.0f)
#endif #endif
#ifdef FIX_RADAR
/*
The values are from an early screenshot taken before R* broke radar
*/
#define RADAR_WIDTH (82.0f)
#define RADAR_HEIGHT (82.0f)
#else
/*
broken since forever, someone tried to fix size for 640x512(PAL)
http://aap.rockstarvision.com/pics/gta3/ps2screens/gta3_interface.jpg
but failed:
http://aap.rockstarvision.com/pics/gta3/artwork/gta3_artwork_16.jpg
most likely the guy used something like this:
int y = 82 * (640.0/512.0)/(640.0/480.0);
int x = y * (640.0/512.0);
*/
#define RADAR_WIDTH (94.0f) #define RADAR_WIDTH (94.0f)
#define RADAR_HEIGHT (76.0f) #define RADAR_HEIGHT (76.0f)
#endif
class CRadar class CRadar
{ {

View File

@ -121,7 +121,7 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
#include "skeleton.h" #include "skeleton.h"
#include "Draw.h" #include "Draw.h"
#if defined(USE_PROPER_SCALING) #if defined(PROPER_SCALING) || defined(PS2_HUD)
#ifdef FORCE_PC_SCALING #ifdef FORCE_PC_SCALING
#define DEFAULT_SCREEN_WIDTH (640) #define DEFAULT_SCREEN_WIDTH (640)
#define DEFAULT_SCREEN_HEIGHT (448) #define DEFAULT_SCREEN_HEIGHT (448)
@ -155,8 +155,8 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
#define SCREEN_HEIGHT ((float)RsGlobal.height) #define SCREEN_HEIGHT ((float)RsGlobal.height)
#endif #endif
#define SCREEN_HEIGHT_PAL (512) #define SCREEN_HEIGHT_PAL ((float)512)
#define SCREEN_HEIGHT_NTSC (448) #define SCREEN_HEIGHT_NTSC ((float)448)
#define SCREEN_ASPECT_RATIO (CDraw::GetAspectRatio()) #define SCREEN_ASPECT_RATIO (CDraw::GetAspectRatio())
#define SCREEN_VIEWWINDOW (Tan(DEGTORAD(CDraw::GetScaledFOV() * 0.5f))) #define SCREEN_VIEWWINDOW (Tan(DEGTORAD(CDraw::GetScaledFOV() * 0.5f)))
@ -175,8 +175,7 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
#ifdef ASPECT_RATIO_SCALE #ifdef ASPECT_RATIO_SCALE
#define SCREEN_SCALE_AR(a) ((a) * DEFAULT_ASPECT_RATIO / SCREEN_ASPECT_RATIO) #define SCREEN_SCALE_AR(a) ((a) * DEFAULT_ASPECT_RATIO / SCREEN_ASPECT_RATIO)
extern float ScaleAndCenterX(float x); #define SCALE_AND_CENTER_X(x) ((SCREEN_WIDTH == DEFAULT_SCREEN_WIDTH) ? (x) : (SCREEN_WIDTH - SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH)) / 2 + SCREEN_SCALE_X((x)))
#define SCALE_AND_CENTER_X(x) ScaleAndCenterX(x)
#else #else
#define SCREEN_SCALE_AR(a) (a) #define SCREEN_SCALE_AR(a) (a)
#define SCALE_AND_CENTER_X(x) SCREEN_STRETCH_X(x) #define SCALE_AND_CENTER_X(x) SCREEN_STRETCH_X(x)

View File

@ -241,6 +241,7 @@ enum Config {
//# define HARDCODED_MODEL_FLAGS // sets the flags enabled above from hardcoded model names. //# define HARDCODED_MODEL_FLAGS // sets the flags enabled above from hardcoded model names.
// NB: keep this enabled unless your map IDEs have these flags baked in // NB: keep this enabled unless your map IDEs have these flags baked in
#define ASPECT_RATIO_SCALE // Not just makes everything scale with aspect ratio, also adds support for all aspect ratios #define ASPECT_RATIO_SCALE // Not just makes everything scale with aspect ratio, also adds support for all aspect ratios
#define PROPER_SCALING // use original DEFAULT_SCREEN_WIDTH/DEFAULT_SCREEN_HEIGHT from PS2 instead of PC(R* changed HEIGHT here to make radar look better, but broke other hud elements aspect ratio).
#define DEFAULT_NATIVE_RESOLUTION // Set default video mode to your native resolution (fixes Windows 10 launch) #define DEFAULT_NATIVE_RESOLUTION // Set default video mode to your native resolution (fixes Windows 10 launch)
#define USE_TXD_CDIMAGE // generate and load textures from txd.img #define USE_TXD_CDIMAGE // generate and load textures from txd.img
#define PS2_ALPHA_TEST // emulate ps2 alpha test #define PS2_ALPHA_TEST // emulate ps2 alpha test
@ -255,6 +256,8 @@ enum Config {
#define NEW_RENDERER // leeds-like world rendering, needs librw #define NEW_RENDERER // leeds-like world rendering, needs librw
#endif #endif
#define FIX_SPRITES // fix sprites aspect ratio(moon, coronas, particle etc)
#ifndef EXTENDED_COLOURFILTER #ifndef EXTENDED_COLOURFILTER
#undef SCREEN_DROPLETS // we need the backbuffer for this effect #undef SCREEN_DROPLETS // we need the backbuffer for this effect
#endif #endif
@ -283,6 +286,7 @@ enum Config {
#define HUD_ENHANCEMENTS // Adjusts some aspects to make the HUD look/behave a little bit better. #define HUD_ENHANCEMENTS // Adjusts some aspects to make the HUD look/behave a little bit better.
// #define BETA_SLIDING_TEXT // #define BETA_SLIDING_TEXT
#define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC #define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC
#define FIX_RADAR // use radar size from early version before R* broke it
// #define XBOX_SUBTITLES // the infamous outlines // #define XBOX_SUBTITLES // the infamous outlines
#define RADIO_OFF_TEXT #define RADIO_OFF_TEXT
#define PC_MENU #define PC_MENU

View File

@ -35,8 +35,14 @@ CDraw::FindAspectRatio(void)
default: default:
case AR_4_3: case AR_4_3:
return 4.0f / 3.0f; return 4.0f / 3.0f;
case AR_5_4:
return 5.0f / 4.0f;
case AR_16_10:
return 16.0f / 10.0f;
case AR_16_9: case AR_16_9:
return 16.0f / 9.0f; return 16.0f / 9.0f;
case AR_21_9:
return 21.0f / 9.0f;
}; };
#endif #endif
} }
@ -70,14 +76,3 @@ CDraw::SetFOV(float fov)
#endif #endif
ms_fFOV = fov; ms_fFOV = fov;
} }
#ifdef ASPECT_RATIO_SCALE
float
ScaleAndCenterX(float x)
{
if (SCREEN_WIDTH == DEFAULT_SCREEN_WIDTH)
return x;
else
return (SCREEN_WIDTH - SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH)) / 2 + SCREEN_SCALE_X(x);
}
#endif

View File

@ -4,10 +4,14 @@ enum eAspectRatio
{ {
// Make sure these work the same as FrontEndMenuManager.m_PrefsUseWideScreen // Make sure these work the same as FrontEndMenuManager.m_PrefsUseWideScreen
// without widescreen support // without widescreen support
AR_4_3,
AR_16_9,
AR_AUTO, AR_AUTO,
AR_4_3,
AR_5_4,
AR_16_10,
AR_16_9,
AR_21_9,
AR_MAX,
}; };
class CDraw class CDraw

View File

@ -21,6 +21,60 @@
#include "User.h" #include "User.h"
#include "World.h" #include "World.h"
#ifdef PS2_HUD
#define MONEY_X 100.0f
#define WEAPON_X 91.0f
#define AMMO_X 59.0f
#define HEALTH_X 100.0f
#define STARS_X 49.0f
#define ZONE_Y 61.0f
#define VEHICLE_Y 81.0f
#define CLOCK_X 101.0f
#define SUBS_Y 83.0f
#define WASTEDBUSTED_Y 122.0f
#define BIGMESSAGE_Y 80.0f
#else
#define MONEY_X 110.0f
#define WEAPON_X 99.0f
#define AMMO_X 66.0f
#define HEALTH_X 110.0f
#define STARS_X 60.0f
#define ZONE_Y 30.0f
#define VEHICLE_Y 55.0f
#define CLOCK_X 111.0f
#define SUBS_Y 68.0f
#define WASTEDBUSTED_Y 82.0f
#define BIGMESSAGE_Y 84.0f
#endif
#ifdef FIX_BUGS
#define TIMER_RIGHT_OFFSET 34.0f // Taken from VC frenzy timer
#define BIGMESSAGE_Y_OFFSET 18.0f
#else
#define TIMER_RIGHT_OFFSET 27.0f
#define BIGMESSAGE_Y_OFFSET 20.0f
#endif
#if defined(PS2_HUD) && !defined(FIX_BUGS)
#define SCREEN_SCALE_X_PC(a) (a)
#define SCREEN_SCALE_Y_PC(a) (a)
#define SCALE_AND_CENTER_X_PC(a) (a)
#else
#define SCREEN_SCALE_X_PC(a) SCREEN_SCALE_X(a)
#define SCREEN_SCALE_Y_PC(a) SCREEN_SCALE_Y(a)
#define SCALE_AND_CENTER_X_PC(a) SCALE_AND_CENTER_X(a)
#endif
#if defined(FIX_BUGS)
#define SCREEN_SCALE_X_FIX(a) SCREEN_SCALE_X(a)
#define SCREEN_SCALE_Y_FIX(a) SCREEN_SCALE_Y(a)
#define SCALE_AND_CENTER_X_FIX(a) SCALE_AND_CENTER_X(a)
#else
#define SCREEN_SCALE_X_FIX(a) (a)
#define SCREEN_SCALE_Y_FIX(a) (a)
#define SCALE_AND_CENTER_X_FIX(a) (a)
#endif
// Game has colors inlined in code. // Game has colors inlined in code.
// For easier modification we collect them here: // For easier modification we collect them here:
CRGBA MONEY_COLOR(89, 115, 150, 255); CRGBA MONEY_COLOR(89, 115, 150, 255);
@ -387,11 +441,7 @@ void CHud::Draw()
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpRocketSightTex)); RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpRocketSightTex));
#if defined(PS2_HUD) && !defined(FIX_BUGS) CSprite::RenderOneXLUSprite(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, 1.0f, SCREEN_SCALE_X_PC(40.0f), SCREEN_SCALE_Y_PC(40.0f), (100.0f * fMultBright), (200.0f * fMultBright), (100.0f * fMultBright), 255, 1.0f, 255);
CSprite::RenderOneXLUSprite(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, 1.0f, 40.0f, 40.0f, (100.0f * fMultBright), (200.0f * fMultBright), (100.0f * fMultBright), 255, 1.0f, 255);
#else
CSprite::RenderOneXLUSprite(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, 1.0f, SCREEN_SCALE_X(40.0f), SCREEN_SCALE_Y(40.0f), (100.0f * fMultBright), (200.0f * fMultBright), (100.0f * fMultBright), 255, 1.0f, 255);
#endif
} }
else { else {
// Sniper // Sniper
@ -452,24 +502,10 @@ void CHud::Draw()
CFont::SetFontStyle(FONT_HEADING); CFont::SetFontStyle(FONT_HEADING);
CFont::SetPropOff(); CFont::SetPropOff();
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MONEY_X) + SCREEN_SCALE_X_FIX(2.0f), SCREEN_SCALE_Y(43.0f) + SCREEN_SCALE_Y_FIX(2.0f), sPrint);
#ifdef PS2_HUD
#define MONEY_X 100.0f
#else
#define MONEY_X 110.0f
#endif
#ifdef FIX_BUGS
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MONEY_X) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(43.0f) + SCREEN_SCALE_Y(2.0f), sPrint);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MONEY_X) + 2.0f, SCREEN_SCALE_Y(43.0f) + 2.0f, sPrint);
#endif
CFont::SetColor(MONEY_COLOR); CFont::SetColor(MONEY_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MONEY_X), SCREEN_SCALE_Y(43.0f), sPrint); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MONEY_X), SCREEN_SCALE_Y(43.0f), sPrint);
#undef MONEY_X
/* /*
DrawAmmo DrawAmmo
*/ */
@ -506,14 +542,6 @@ void CHud::Draw()
/* /*
DrawWeaponIcon DrawWeaponIcon
*/ */
#ifdef PS2_HUD
#define WEAPON_X 91.0f
#define AMMO_X 59.0f
#else
#define WEAPON_X 99.0f
#define AMMO_X 66.0f
#endif
Sprites[WeaponType].Draw( Sprites[WeaponType].Draw(
CRect( CRect(
SCREEN_SCALE_FROM_RIGHT(WEAPON_X), SCREEN_SCALE_FROM_RIGHT(WEAPON_X),
@ -543,19 +571,9 @@ void CHud::Draw()
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(AMMO_X), SCREEN_SCALE_Y(73.0f), sPrint); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(AMMO_X), SCREEN_SCALE_Y(73.0f), sPrint);
} }
#undef WEAPON_X
#undef AMMO_X
/* /*
DrawHealth DrawHealth
*/ */
#ifdef PS2_HUD
#define HEALTH_X 100.0f
#else
#define HEALTH_X 110.0f
#endif
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f)); CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
CFont::SetJustifyOff(); CFont::SetJustifyOff();
@ -579,35 +597,20 @@ void CHud::Draw()
sprintf(sTemp, "%03d", (int32)FindPlayerPed()->m_fHealth); sprintf(sTemp, "%03d", (int32)FindPlayerPed()->m_fHealth);
#endif #endif
AsciiToUnicode(sTemp, sPrint); AsciiToUnicode(sTemp, sPrint);
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
#ifdef FIX_BUGS CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + SCREEN_SCALE_X_FIX(2.0f), SCREEN_SCALE_Y(65.0f) + SCREEN_SCALE_Y_FIX(2.0f), sPrint);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + SCREEN_SCALE_Y(2.0f), sPrint);
#else if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss + 2000 || CTimer::GetFrameCounter() & 4)
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + 2.0f, SCREEN_SCALE_Y(65.0f) + 2.0f, sPrint); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + SCREEN_SCALE_X_FIX(2.0f) - SCREEN_SCALE_X(56.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + SCREEN_SCALE_Y_FIX(2.0f), sPrintIcon);
#endif
if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss + 2000 || CTimer::GetFrameCounter() & 4) {
#ifdef FIX_BUGS
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + SCREEN_SCALE_X(2.0f) - SCREEN_SCALE_X(56.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + SCREEN_SCALE_Y(2.0f), sPrintIcon);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + 2.0f - SCREEN_SCALE_X(56.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + 2.0f, sPrintIcon);
#endif
}
CFont::SetColor(HEALTH_COLOR); CFont::SetColor(HEALTH_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X), SCREEN_SCALE_Y(65.0f), sPrint); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X), SCREEN_SCALE_Y(65.0f), sPrint);
if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss + 2000 || CTimer::GetFrameCounter() & 4) { if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss + 2000 || CTimer::GetFrameCounter() & 4)
#ifdef FIX_BUGS CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + SCREEN_SCALE_X_FIX(2.0f) - SCREEN_SCALE_X(56.0f), SCREEN_SCALE_Y(65.0f), sPrintIcon);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + SCREEN_SCALE_X(2.0f) - SCREEN_SCALE_X(56.0f), SCREEN_SCALE_Y(65.0f), sPrintIcon);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + 2.0f - SCREEN_SCALE_X(56.0f), SCREEN_SCALE_Y(65.0f), sPrintIcon);
#endif
} }
} }
}
#undef HEALTH_X
/* /*
DrawArmour DrawArmour
@ -624,19 +627,10 @@ void CHud::Draw()
AsciiToUnicode(sTemp, sPrint); AsciiToUnicode(sTemp, sPrint);
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
#ifdef FIX_BUGS CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f) + SCREEN_SCALE_X_FIX(2.0f), SCREEN_SCALE_Y(65.0f) + SCREEN_SCALE_Y_FIX(2.0f), sPrint);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + SCREEN_SCALE_Y(2.0f), sPrint);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f) + 2.0f, SCREEN_SCALE_Y(65.0f) + 2.0f, sPrint);
#endif
if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastArmourLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastArmourLoss + 2000 || CTimer::GetFrameCounter() & 4) { if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastArmourLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastArmourLoss + 2000 || CTimer::GetFrameCounter() & 4)
#ifdef FIX_BUGS CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f) + SCREEN_SCALE_X_FIX(2.0f) - SCREEN_SCALE_X(54.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + SCREEN_SCALE_Y_FIX(2.0f), sPrintIcon);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f) + SCREEN_SCALE_X(2.0f) - SCREEN_SCALE_X(54.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + SCREEN_SCALE_Y(2.0f), sPrintIcon);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f) + 2.0f - SCREEN_SCALE_X(54.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + 2.0f, sPrintIcon);
#endif
}
CFont::SetColor(ARMOUR_COLOR); CFont::SetColor(ARMOUR_COLOR);
@ -651,13 +645,6 @@ void CHud::Draw()
/* /*
DrawWantedLevel DrawWantedLevel
*/ */
#ifdef PS2_HUD
#define STARS_X 49.0f
#else
#define STARS_X 60.0f
#endif
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f)); CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
CFont::SetJustifyOff(); CFont::SetJustifyOff();
@ -672,11 +659,8 @@ void CHud::Draw()
for (int i = 0; i < 6; i++) { for (int i = 0; i < 6; i++) {
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
#ifdef FIX_BUGS CFont::PrintString(fStarsX + SCREEN_SCALE_X_FIX(2.0f), SCREEN_SCALE_Y(87.0f) + SCREEN_SCALE_Y_FIX(2.0f), sPrintIcon);
CFont::PrintString(fStarsX + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(87.0f) + SCREEN_SCALE_Y(2.0f), sPrintIcon);
#else
CFont::PrintString(fStarsX + 2.0f, SCREEN_SCALE_Y(87.0f) + 2.0f, sPrintIcon);
#endif
if (FindPlayerPed()->m_pWanted->m_nWantedLevel > i if (FindPlayerPed()->m_pWanted->m_nWantedLevel > i
&& (CTimer::GetTimeInMilliseconds() > FindPlayerPed()->m_pWanted->m_nLastWantedLevelChange && (CTimer::GetTimeInMilliseconds() > FindPlayerPed()->m_pWanted->m_nLastWantedLevelChange
+ 2000 || CTimer::GetFrameCounter() & 4)) { + 2000 || CTimer::GetFrameCounter() & 4)) {
@ -688,16 +672,9 @@ void CHud::Draw()
fStarsX -= SCREEN_SCALE_X(23.0f); fStarsX -= SCREEN_SCALE_X(23.0f);
} }
#undef STARS_X
/* /*
DrawZoneName DrawZoneName
*/ */
#ifdef PS2_HUD
#define ZONE_Y 61.0f
#else
#define ZONE_Y 30.0f
#endif
if (m_pZoneName) { if (m_pZoneName) {
float fZoneAlpha = 255.0f; float fZoneAlpha = 255.0f;
@ -783,29 +760,16 @@ void CHud::Draw()
CFont::SetBackGroundOnlyTextOff(); CFont::SetBackGroundOnlyTextOff();
CFont::SetFontStyle(FONT_BANK); CFont::SetFontStyle(FONT_BANK);
CFont::SetColor(CRGBA(0, 0, 0, fZoneAlpha)); CFont::SetColor(CRGBA(0, 0, 0, fZoneAlpha));
#ifdef FIX_BUGS CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + SCREEN_SCALE_X_FIX(1.0f), SCREEN_SCALE_FROM_BOTTOM(ZONE_Y) + SCREEN_SCALE_Y_FIX(1.0f), m_ZoneToPrint);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + SCREEN_SCALE_X(1.0f), SCREEN_SCALE_FROM_BOTTOM(ZONE_Y) + SCREEN_SCALE_Y(1.0f), m_ZoneToPrint);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + 1.0f, SCREEN_SCALE_FROM_BOTTOM(ZONE_Y) + 1.0f, m_ZoneToPrint);
#endif
CFont::SetColor(CRGBA(ZONE_COLOR.r, ZONE_COLOR.g, ZONE_COLOR.b, fZoneAlpha)); CFont::SetColor(CRGBA(ZONE_COLOR.r, ZONE_COLOR.g, ZONE_COLOR.b, fZoneAlpha));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f), SCREEN_SCALE_FROM_BOTTOM(ZONE_Y), m_ZoneToPrint); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f), SCREEN_SCALE_FROM_BOTTOM(ZONE_Y), m_ZoneToPrint);
} }
} }
} }
#undef ZONE_Y
/* /*
DrawVehicleName DrawVehicleName
*/ */
#ifdef PS2_HUD
#define VEHICLE_Y 81.0f
#else
#define VEHICLE_Y 55.0f
#endif
if (m_pVehicleName) { if (m_pVehicleName) {
float fVehicleAlpha = 0.0f; float fVehicleAlpha = 0.0f;
@ -890,13 +854,7 @@ void CHud::Draw()
CFont::SetBackGroundOnlyTextOff(); CFont::SetBackGroundOnlyTextOff();
CFont::SetFontStyle(FONT_BANK); CFont::SetFontStyle(FONT_BANK);
CFont::SetColor(CRGBA(0, 0, 0, fVehicleAlpha)); CFont::SetColor(CRGBA(0, 0, 0, fVehicleAlpha));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + SCREEN_SCALE_X_FIX(1.0f), SCREEN_SCALE_FROM_BOTTOM(VEHICLE_Y) + SCREEN_SCALE_Y_FIX(1.0f), m_pVehicleNameToPrint);
#ifdef FIX_BUGS
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + SCREEN_SCALE_X(1.0f), SCREEN_SCALE_FROM_BOTTOM(VEHICLE_Y) + SCREEN_SCALE_Y(1.0f), m_pVehicleNameToPrint);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + 1.0f, SCREEN_SCALE_FROM_BOTTOM(VEHICLE_Y) + 1.0f, m_pVehicleNameToPrint);
#endif
CFont::SetColor(CRGBA(VEHICLE_COLOR.r, VEHICLE_COLOR.g, VEHICLE_COLOR.b, fVehicleAlpha)); CFont::SetColor(CRGBA(VEHICLE_COLOR.r, VEHICLE_COLOR.g, VEHICLE_COLOR.b, fVehicleAlpha));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f), SCREEN_SCALE_FROM_BOTTOM(VEHICLE_Y), m_pVehicleNameToPrint); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f), SCREEN_SCALE_FROM_BOTTOM(VEHICLE_Y), m_pVehicleNameToPrint);
} }
@ -908,16 +866,10 @@ void CHud::Draw()
m_VehicleFadeTimer = 0; m_VehicleFadeTimer = 0;
m_VehicleNameTimer = 0; m_VehicleNameTimer = 0;
} }
#undef VEHICLE_Y
/* /*
DrawClock DrawClock
*/ */
#ifdef PS2_HUD
#define CLOCK_X 101.0f
#else
#define CLOCK_X 111.0f
#endif
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetCentreOff(); CFont::SetCentreOff();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
@ -932,22 +884,13 @@ void CHud::Draw()
AsciiToUnicode(sTemp, sPrint); AsciiToUnicode(sTemp, sPrint);
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(CLOCK_X) + SCREEN_SCALE_X_FIX(2.0f), SCREEN_SCALE_Y(22.0f) + SCREEN_SCALE_Y_FIX(2.0f), sPrint);
#ifdef FIX_BUGS
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(CLOCK_X) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(22.0f) + SCREEN_SCALE_Y(2.0f), sPrint);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(CLOCK_X) + 2.0f, SCREEN_SCALE_Y(22.0f) + 2.0f, sPrint);
#endif
CFont::SetColor(CLOCK_COLOR); CFont::SetColor(CLOCK_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(CLOCK_X), SCREEN_SCALE_Y(22.0f), sPrint); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(CLOCK_X), SCREEN_SCALE_Y(22.0f), sPrint);
#undef CLOCK_X
/* /*
DrawOnScreenTimer DrawOnScreenTimer
*/ */
wchar sTimer[16]; wchar sTimer[16];
if (!CUserDisplay::OnscnTimer.m_sEntries[0].m_bTimerProcessed) if (!CUserDisplay::OnscnTimer.m_sEntries[0].m_bTimerProcessed)
@ -955,11 +898,6 @@ void CHud::Draw()
if (!CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterProcessed) if (!CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterProcessed)
CounterOnLastFrame = false; CounterOnLastFrame = false;
#ifdef FIX_BUGS
#define TIMER_RIGHT_OFFSET 34.0f // Taken from VC frenzy timer
#else
#define TIMER_RIGHT_OFFSET 27.0f
#endif
if (CUserDisplay::OnscnTimer.m_bProcessed) { if (CUserDisplay::OnscnTimer.m_bProcessed) {
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_bTimerProcessed) { if (CUserDisplay::OnscnTimer.m_sEntries[0].m_bTimerProcessed) {
if (!TimerOnLastFrame) if (!TimerOnLastFrame)
@ -983,11 +921,7 @@ void CHud::Draw()
CFont::SetPropOff(); CFont::SetPropOff();
CFont::SetBackGroundOnlyTextOn(); CFont::SetBackGroundOnlyTextOn();
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
#ifdef FIX_BUGS CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X_FIX(2.0f), SCREEN_SCALE_Y(110.0f) + SCREEN_SCALE_Y_FIX(2.0f), sTimer);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + SCREEN_SCALE_Y(2.0f), sTimer);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + 2.0f, SCREEN_SCALE_Y(110.0f) + 2.0f, sTimer);
#endif
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f)); CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
CFont::SetColor(TIMER_COLOR); CFont::SetColor(TIMER_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(110.0f), sTimer); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(110.0f), sTimer);
@ -996,12 +930,7 @@ void CHud::Draw()
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::SetScale(SCREEN_SCALE_X(0.8f * 0.8f), SCREEN_SCALE_Y(1.35f)); CFont::SetScale(SCREEN_SCALE_X(0.8f * 0.8f), SCREEN_SCALE_Y(1.35f));
#ifdef FIX_BUGS CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + SCREEN_SCALE_Y_FIX(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + SCREEN_SCALE_Y(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + 2.0f, TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
#endif
CFont::SetColor(TIMER_COLOR); CFont::SetColor(TIMER_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f), SCREEN_SCALE_Y(110.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText)); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f), SCREEN_SCALE_Y(110.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
} }
@ -1032,14 +961,8 @@ void CHud::Draw()
CFont::SetWrapx(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH)); CFont::SetWrapx(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH));
CFont::SetPropOff(); CFont::SetPropOff();
CFont::SetBackGroundOnlyTextOn(); CFont::SetBackGroundOnlyTextOn();
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
#ifdef FIX_BUGS CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X_FIX(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y_FIX(2.0f), sTimer);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), sTimer);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + 2.0f, SCREEN_SCALE_Y(132.0f) + 2.0f, sTimer);
#endif
CFont::SetColor(COUNTER_COLOR); CFont::SetColor(COUNTER_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(132.0f), sTimer); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(132.0f), sTimer);
} else { } else {
@ -1051,23 +974,10 @@ void CHud::Draw()
( (
CRect CRect
( (
#ifdef FIX_BUGS SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X_FIX(4.0f),
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f),
#else
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + 4.0f,
#endif
SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f),
#ifdef FIX_BUGS SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X_FIX(4.0f),
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y_PC(11.0f) + SCREEN_SCALE_Y(8.0f)
#else
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + 4.0f,
#endif
#if !defined(PS2_HUD) || defined(FIX_BUGS)
SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)
#else
SCREEN_SCALE_Y(132.0f) + 11.0f + SCREEN_SCALE_Y(8.0f)
#endif
), ),
CRGBA(0, 106, 164, 80) CRGBA(0, 106, 164, 80)
); );
@ -1076,30 +986,10 @@ void CHud::Draw()
( (
CRect CRect
( (
#ifdef FIX_BUGS SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X_FIX(4.0f),
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f),
#else
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + 4.0f,
#endif
SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f),
SCREEN_SCALE_X_PC((float)counter) / 2.0f + SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2.0f + SCREEN_SCALE_X_FIX(4.0f),
#if !defined(PS2_HUD) || defined(FIX_BUGS) SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y_PC(11.0f) + SCREEN_SCALE_Y(8.0f)
SCREEN_SCALE_X(counter) / 2.0f +
#else
(float)(counter) / 2.0f +
#endif
#ifdef FIX_BUGS
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2.0f + SCREEN_SCALE_X(4.0f),
#else
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2.0f + 4.0f,
#endif
#if !defined(PS2_HUD) || defined(FIX_BUGS)
SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)
#else
SCREEN_SCALE_Y(132.0f) + 11.0f + SCREEN_SCALE_Y(8.0f)
#endif
), ),
CRGBA(0, 106, 164, 255) CRGBA(0, 106, 164, 255)
); );
@ -1109,19 +999,13 @@ void CHud::Draw()
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f)); CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
#ifdef FIX_BUGS CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y_FIX(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(132.0f) + 2.0f, TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
#endif
CFont::SetColor(COUNTER_COLOR); CFont::SetColor(COUNTER_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f), SCREEN_SCALE_Y(132.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText)); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f), SCREEN_SCALE_Y(132.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
} }
} }
} }
} }
#undef TIMER_RIGHT_OFFSET
///////////////////////////////// /////////////////////////////////
/* /*
@ -1158,13 +1042,7 @@ void CHud::Draw()
PagerOn = 0; PagerOn = 0;
} }
} }
Sprites[HUD_PAGER].Draw(CRect(SCREEN_SCALE_X(26.0f) - SCREEN_SCALE_X_FIX(PagerXOffset), SCREEN_SCALE_Y(27.0f), SCREEN_SCALE_X(160.0f) + SCREEN_SCALE_X(26.0f) - SCREEN_SCALE_X_FIX(PagerXOffset), SCREEN_SCALE_Y(80.0f) + SCREEN_SCALE_Y(27.0f)), CRGBA(255, 255, 255, 255));
#ifdef FIX_BUGS
Sprites[HUD_PAGER].Draw(CRect(SCREEN_SCALE_X(26.0f) - SCREEN_SCALE_X(PagerXOffset), SCREEN_SCALE_Y(27.0f), SCREEN_SCALE_X(160.0f) + SCREEN_SCALE_X(26.0f) - SCREEN_SCALE_X(PagerXOffset), SCREEN_SCALE_Y(80.0f) + SCREEN_SCALE_Y(27.0f)), CRGBA(255, 255, 255, 255));
#else
Sprites[HUD_PAGER].Draw(CRect(SCREEN_SCALE_X(26.0f) - PagerXOffset, SCREEN_SCALE_Y(27.0f), SCREEN_SCALE_X(160.0f) + SCREEN_SCALE_X(26.0f) - PagerXOffset, SCREEN_SCALE_Y(80.0f) + SCREEN_SCALE_Y(27.0f)), CRGBA(255, 255, 255, 255));
#endif
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetScale(SCREEN_SCALE_X(0.84f), SCREEN_SCALE_Y(1.0f)); CFont::SetScale(SCREEN_SCALE_X(0.84f), SCREEN_SCALE_Y(1.0f));
CFont::SetColor(PAGER_COLOR); CFont::SetColor(PAGER_COLOR);
@ -1175,12 +1053,7 @@ void CHud::Draw()
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetPropOff(); CFont::SetPropOff();
CFont::SetFontStyle(FONT_PAGER); CFont::SetFontStyle(FONT_PAGER);
CFont::PrintString(SCREEN_SCALE_X(52.0f) - SCREEN_SCALE_X_FIX(PagerXOffset), SCREEN_SCALE_Y(54.0f), m_PagerMessage);
#ifdef FIX_BUGS
CFont::PrintString(SCREEN_SCALE_X(52.0f) - SCREEN_SCALE_X(PagerXOffset), SCREEN_SCALE_Y(54.0f), m_PagerMessage);
#else
CFont::PrintString(SCREEN_SCALE_X(52.0f) - PagerXOffset, SCREEN_SCALE_Y(54.0f), m_PagerMessage);
#endif
} }
/* /*
@ -1189,11 +1062,7 @@ void CHud::Draw()
if (m_ItemToFlash == ITEM_RADAR && CTimer::GetFrameCounter() & 8 || m_ItemToFlash != ITEM_RADAR) { if (m_ItemToFlash == ITEM_RADAR && CTimer::GetFrameCounter() & 8 || m_ItemToFlash != ITEM_RADAR) {
CRadar::DrawMap(); CRadar::DrawMap();
CRect rect(0.0f, 0.0f, SCREEN_SCALE_X(RADAR_WIDTH), SCREEN_SCALE_Y(RADAR_HEIGHT)); CRect rect(0.0f, 0.0f, SCREEN_SCALE_X(RADAR_WIDTH), SCREEN_SCALE_Y(RADAR_HEIGHT));
#ifdef FIX_BUGS rect.Translate(SCREEN_SCALE_X_FIX(RADAR_LEFT), SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
rect.Translate(SCREEN_SCALE_X(RADAR_LEFT), SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
#else
rect.Translate(RADAR_LEFT, SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
#endif
#ifdef PS2_HUD #ifdef PS2_HUD
#ifdef FIX_BUGS #ifdef FIX_BUGS
@ -1226,11 +1095,12 @@ void CHud::Draw()
if (!CTimer::GetIsUserPaused()) { if (!CTimer::GetIsUserPaused()) {
for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroTextLines); i++) { for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroTextLines); i++) {
if (CTheScripts::IntroTextLines[i].m_Text[0] && CTheScripts::IntroTextLines[i].m_bTextBeforeFade) { if (CTheScripts::IntroTextLines[i].m_Text[0] && CTheScripts::IntroTextLines[i].m_bTextBeforeFade) {
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::SetScale(SCREEN_SCALE_X_PC(CTheScripts::IntroTextLines[i].m_fScaleX), SCREEN_SCALE_Y_PC(CTheScripts::IntroTextLines[i].m_fScaleY)
CFont::SetScale(CTheScripts::IntroTextLines[i].m_fScaleX, CTheScripts::IntroTextLines[i].m_fScaleY); #if !defined(PS2_HUD) || defined(FIX_BUGS)
#else * 0.5f
CFont::SetScale(SCREEN_SCALE_X(CTheScripts::IntroTextLines[i].m_fScaleX), SCREEN_SCALE_Y(CTheScripts::IntroTextLines[i].m_fScaleY * 0.5f));
#endif #endif
);
CFont::SetColor(CTheScripts::IntroTextLines[i].m_sColor); CFont::SetColor(CTheScripts::IntroTextLines[i].m_sColor);
if (CTheScripts::IntroTextLines[i].m_bJustify) if (CTheScripts::IntroTextLines[i].m_bJustify)
@ -1248,17 +1118,9 @@ void CHud::Draw()
else else
CFont::SetCentreOff(); CFont::SetCentreOff();
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::SetWrapx(SCALE_AND_CENTER_X_PC(CTheScripts::IntroTextLines[i].m_fWrapX));
CFont::SetWrapx(CTheScripts::IntroTextLines[i].m_fWrapX);
#else
CFont::SetWrapx(SCALE_AND_CENTER_X(CTheScripts::IntroTextLines[i].m_fWrapX));
#endif
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::SetCentreSize(SCREEN_SCALE_X_PC(CTheScripts::IntroTextLines[i].m_fCenterSize));
CFont::SetCentreSize(CTheScripts::IntroTextLines[i].m_fCenterSize);
#else
CFont::SetCentreSize(SCREEN_SCALE_X(CTheScripts::IntroTextLines[i].m_fCenterSize));
#endif
if (CTheScripts::IntroTextLines[i].m_bBackground) if (CTheScripts::IntroTextLines[i].m_bBackground)
CFont::SetBackgroundOn(); CFont::SetBackgroundOn();
@ -1315,20 +1177,11 @@ void CHud::Draw()
/* /*
DrawSubtitles DrawSubtitles
*/ */
#ifdef PS2_HUD
#define SUBS_Y 83.0f
#else
#define SUBS_Y 68.0f
#endif
if (m_Message[0] && !m_BigMessage[2][0] && (FrontEndMenuManager.m_PrefsShowSubtitles == 1 || !TheCamera.m_WideScreenOn)) { if (m_Message[0] && !m_BigMessage[2][0] && (FrontEndMenuManager.m_PrefsShowSubtitles == 1 || !TheCamera.m_WideScreenOn)) {
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
CFont::SetBackgroundColor(CRGBA(0, 0, 0, 128)); CFont::SetBackgroundColor(CRGBA(0, 0, 0, 128));
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::SetScale(SCREEN_SCALE_X_PC(0.48f), SCREEN_SCALE_Y_PC(1.12f));
CFont::SetScale(0.48f, 1.12f);
#else
CFont::SetScale(SCREEN_SCALE_X(0.48f), SCREEN_SCALE_Y(1.12f));
#endif
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK)); CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
@ -1353,17 +1206,10 @@ void CHud::Draw()
CFont::SetColor(CRGBA(235, 235, 235, 255)); CFont::SetColor(CRGBA(235, 235, 235, 255));
// I'm not sure shadow substaction was intentional here, might be a leftover if CFont::PrintString was used for a shadow draw call // I'm not sure shadow substaction was intentional here, might be a leftover if CFont::PrintString was used for a shadow draw call
#if defined(FIX_BUGS) CFont::PrintString(rectWidth / 2.0f + radarBulge - SCREEN_SCALE_X_FIX(shadow), SCREEN_SCALE_Y_PC(4.0f) + SCREEN_SCALE_FROM_BOTTOM(SUBS_Y) - SCREEN_SCALE_Y_FIX(shadow), m_Message);
CFont::PrintString(rectWidth / 2.0f + radarBulge - SCREEN_SCALE_X(shadow), SCREEN_SCALE_Y(4.0f) + SCREEN_SCALE_FROM_BOTTOM(SUBS_Y) - SCREEN_SCALE_Y(shadow), m_Message);
#elif defined(PS2_HUD)
CFont::PrintString(rectWidth / 2.0f + radarBulge - shadow, 4.0f + SCREEN_SCALE_FROM_BOTTOM(SUBS_Y) - shadow, m_Message);
#else
CFont::PrintString(rectWidth / 2.0f + radarBulge - shadow, SCREEN_SCALE_Y(4.0f) + SCREEN_SCALE_FROM_BOTTOM(SUBS_Y) - shadow, m_Message);
#endif
CFont::SetDropShadowPosition(0); CFont::SetDropShadowPosition(0);
#endif // #ifdef XBOX_SUBTITLES #endif // #ifdef XBOX_SUBTITLES
} }
#undef SUBS_Y
/* /*
DrawBigMessage DrawBigMessage
@ -1376,17 +1222,9 @@ void CHud::Draw()
CFont::SetBackGroundOnlyTextOff(); CFont::SetBackGroundOnlyTextOff();
if (CGame::frenchGame || CGame::germanGame) if (CGame::frenchGame || CGame::germanGame)
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::SetScale(SCREEN_SCALE_X_PC(1.8f), SCREEN_SCALE_Y_PC(1.8f));
CFont::SetScale(1.8f, 1.8f);
#else
CFont::SetScale(SCREEN_SCALE_X(1.8f), SCREEN_SCALE_Y(1.8f));
#endif
else else
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::SetScale(SCREEN_SCALE_X_PC(1.8f), SCREEN_SCALE_Y_PC(1.8f));
CFont::SetScale(1.8f, 1.8f);
#else
CFont::SetScale(SCREEN_SCALE_X(1.8f), SCREEN_SCALE_Y(1.8f));
#endif
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetCentreOn(); CFont::SetCentreOn();
@ -1414,30 +1252,18 @@ void CHud::Draw()
} }
} }
else { else {
#ifdef FIX_BUGS BigMessageX[0] += SCREEN_SCALE_X_FIX(CTimer::GetTimeStepInMilliseconds() * 0.3f);
BigMessageX[0] += SCREEN_SCALE_X((CTimer::GetTimeStepInMilliseconds() * 0.3f));
#else
BigMessageX[0] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
#endif
BigMessageAlpha[0] += (CTimer::GetTimeStepInMilliseconds() * 0.3f); BigMessageAlpha[0] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
if (BigMessageAlpha[0] > 255.0f) if (BigMessageAlpha[0] > 255.0f)
BigMessageAlpha[0] = 255.0f; BigMessageAlpha[0] = 255.0f;
} }
CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[0])); CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[0]));
#ifdef FIX_BUGS
#define Y_OFFSET 18.0f
#else
#define Y_OFFSET 20.0f
#endif
#if defined(FIX_BUGS) #if defined(PS2_HUD) && !defined(FIX_BUGS) // yeah, that's right. ps2 uses y=ScaleX(a)
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(Y_OFFSET) + SCREEN_SCALE_Y(2.0f), m_BigMessage[0]); CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X_FIX(2.0f), (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(120.0f) + SCREEN_SCALE_Y_FIX(2.0f), m_BigMessage[0]);
#elif defined(PS2_HUD) // yeah, that's right. ps2 uses y=ScaleX(a)
CFont::PrintString(SCREEN_WIDTH / 2 + 2.0f, (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(120.0f) + 2.0f, m_BigMessage[0]);
#else #else
CFont::PrintString(SCREEN_WIDTH / 2 + 2.0f, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(Y_OFFSET) + 2.0f, m_BigMessage[0]); CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X_FIX(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y_OFFSET) + SCREEN_SCALE_Y_FIX(2.0f), m_BigMessage[0]);
#endif #endif
CFont::SetColor(CRGBA(BIGMESSAGE_COLOR.r, BIGMESSAGE_COLOR.g, BIGMESSAGE_COLOR.b, BigMessageAlpha[0])); CFont::SetColor(CRGBA(BIGMESSAGE_COLOR.r, BIGMESSAGE_COLOR.g, BIGMESSAGE_COLOR.b, BigMessageAlpha[0]));
#if defined(PS2_HUD) && !defined(FIX_BUGS) // same #if defined(PS2_HUD) && !defined(FIX_BUGS) // same
@ -1445,16 +1271,10 @@ void CHud::Draw()
#else #else
CFont::PrintString(SCREEN_WIDTH / 2, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(18.0f), m_BigMessage[0]); CFont::PrintString(SCREEN_WIDTH / 2, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(18.0f), m_BigMessage[0]);
#endif #endif
#undef Y_OFFSET
} }
else { else {
BigMessageAlpha[0] = 0.0f; BigMessageAlpha[0] = 0.0f;
#ifdef FIX_BUGS BigMessageX[0] = SCALE_AND_CENTER_X_FIX(-60.0f);
BigMessageX[0] = SCALE_AND_CENTER_X(-60.0f);
#else
BigMessageX[0] = -60.0f;
#endif
BigMessageInUse[0] = 1.0f; BigMessageInUse[0] = 1.0f;
} }
} }
@ -1463,11 +1283,6 @@ void CHud::Draw()
} }
// WastedBustedText // WastedBustedText
#ifdef PS2_HUD
#define WASTEDBUSTED_Y 122.0f
#else
#define WASTEDBUSTED_Y 82.0f
#endif
if (m_BigMessage[2][0]) { if (m_BigMessage[2][0]) {
if (BigMessageInUse[2] != 0.0f) { if (BigMessageInUse[2] != 0.0f) {
BigMessageAlpha[2] += (CTimer::GetTimeStepInMilliseconds() * 0.4f); BigMessageAlpha[2] += (CTimer::GetTimeStepInMilliseconds() * 0.4f);
@ -1477,29 +1292,17 @@ void CHud::Draw()
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
#if defined(PS2_HUD) && !defined(FIX_BUGS)
if (CGame::frenchGame || CGame::germanGame) if (CGame::frenchGame || CGame::germanGame)
CFont::SetScale(1.4f, 1.4f); CFont::SetScale(SCREEN_SCALE_X_PC(1.4f), SCREEN_SCALE_Y_PC(1.4f));
else else
CFont::SetScale(2.0f, 2.0f); CFont::SetScale(SCREEN_SCALE_X_PC(2.0f), SCREEN_SCALE_Y_PC(2.0f));
#else
if (CGame::frenchGame || CGame::germanGame)
CFont::SetScale(SCREEN_SCALE_X(1.4f), SCREEN_SCALE_Y(1.4f));
else
CFont::SetScale(SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(2.0f));
#endif
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetRightJustifyOn(); CFont::SetRightJustifyOn();
CFont::SetFontStyle(FONT_HEADING); CFont::SetFontStyle(FONT_HEADING);
CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[2]*0.75f)); CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[2]*0.75f));
#ifdef FIX_BUGS CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + SCREEN_SCALE_X_FIX(4.0f), SCREEN_SCALE_FROM_BOTTOM(WASTEDBUSTED_Y) + SCREEN_SCALE_Y(4.0f), m_BigMessage[2]);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_FROM_BOTTOM(WASTEDBUSTED_Y) + SCREEN_SCALE_Y(4.0f), m_BigMessage[2]);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + 4.0f, SCREEN_SCALE_FROM_BOTTOM(WASTEDBUSTED_Y) + SCREEN_SCALE_Y(4.0f), m_BigMessage[2]);
#endif
CFont::SetColor(CRGBA(WASTEDBUSTED_COLOR.r, WASTEDBUSTED_COLOR.g, WASTEDBUSTED_COLOR.b, BigMessageAlpha[2])); CFont::SetColor(CRGBA(WASTEDBUSTED_COLOR.r, WASTEDBUSTED_COLOR.g, WASTEDBUSTED_COLOR.b, BigMessageAlpha[2]));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(WASTEDBUSTED_Y), m_BigMessage[2]); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(WASTEDBUSTED_Y), m_BigMessage[2]);
} }
@ -1511,7 +1314,6 @@ void CHud::Draw()
else { else {
BigMessageInUse[2] = 0.0f; BigMessageInUse[2] = 0.0f;
} }
#undef WASTEDBUSTED_Y
} }
} }
@ -1606,28 +1408,16 @@ void CHud::DrawAfterFade()
CFont::SetJustifyOff(); CFont::SetJustifyOff();
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
if (CFont::IsJapanese()) if (CFont::IsJapanese())
#ifdef FIX_BUGS CFont::SetWrapx(SCREEN_SCALE_X(229.0f) + SCREEN_SCALE_X(26.0f) - SCREEN_SCALE_X_FIX(4.0f));
CFont::SetWrapx(SCREEN_SCALE_X(229.0f) + SCREEN_SCALE_X(26.0f) - SCREEN_SCALE_X(4.0f));
#else
CFont::SetWrapx(SCREEN_SCALE_X(229.0f) + SCREEN_SCALE_X(26.0f) - 4.0f);
#endif
else else
#endif #endif
#ifdef FIX_BUGS CFont::SetWrapx(SCREEN_SCALE_X(200.0f) + SCREEN_SCALE_X(26.0f) - SCREEN_SCALE_X_FIX(4.0f));
CFont::SetWrapx(SCREEN_SCALE_X(200.0f) + SCREEN_SCALE_X(26.0f) - SCREEN_SCALE_X(4.0f));
#else
CFont::SetWrapx(SCREEN_SCALE_X(200.0f) + SCREEN_SCALE_X(26.0f) - 4.0f);
#endif
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK)); CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
CFont::SetBackgroundOn(); CFont::SetBackgroundOn();
CFont::SetBackGroundOnlyTextOff(); CFont::SetBackGroundOnlyTextOff();
CFont::SetBackgroundColor(CRGBA(0, 0, 0, fAlpha * 0.9f)); CFont::SetBackgroundColor(CRGBA(0, 0, 0, fAlpha * 0.9f));
CFont::SetColor(CRGBA(175, 175, 175, 255)); CFont::SetColor(CRGBA(175, 175, 175, 255));
#ifdef FIX_BUGS CFont::PrintString(SCREEN_SCALE_X(26.0f), SCREEN_SCALE_Y(28.0f) + SCREEN_SCALE_Y_FIX((150.0f - PagerXOffset) * 0.6f), m_HelpMessageToPrint);
CFont::PrintString(SCREEN_SCALE_X(26.0f), SCREEN_SCALE_Y(28.0f + (150.0f - PagerXOffset) * 0.6f), m_HelpMessageToPrint);
#else
CFont::PrintString(SCREEN_SCALE_X(26.0f), SCREEN_SCALE_Y(28.0f) + (150.0f - PagerXOffset) * 0.6f, m_HelpMessageToPrint);
#endif
CFont::SetAlphaFade(255.0f); CFont::SetAlphaFade(255.0f);
} }
} }
@ -1635,11 +1425,12 @@ void CHud::DrawAfterFade()
for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroTextLines); i++) { for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroTextLines); i++) {
intro_text_line &line = CTheScripts::IntroTextLines[i]; intro_text_line &line = CTheScripts::IntroTextLines[i];
if (line.m_Text[0] != '\0' && !line.m_bTextBeforeFade) { if (line.m_Text[0] != '\0' && !line.m_bTextBeforeFade) {
#if defined(PS2_HUD) && !defined(FIX_BUGS)
CFont::SetScale(line.m_fScaleX, line.m_fScaleY); CFont::SetScale(SCREEN_SCALE_X_PC(line.m_fScaleX), SCREEN_SCALE_Y_PC(line.m_fScaleY)
#else #if !defined(PS2_HUD) || defined(FIX_BUGS)
CFont::SetScale(SCREEN_SCALE_X(line.m_fScaleX), SCREEN_SCALE_Y(line.m_fScaleY) / 2); / 2
#endif #endif
);
CFont::SetColor(line.m_sColor); CFont::SetColor(line.m_sColor);
if (line.m_bJustify) if (line.m_bJustify)
CFont::SetJustifyOn(); CFont::SetJustifyOn();
@ -1656,13 +1447,8 @@ void CHud::DrawAfterFade()
else else
CFont::SetCentreOff(); CFont::SetCentreOff();
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::SetWrapx(SCALE_AND_CENTER_X_PC(line.m_fWrapX));
CFont::SetWrapx(line.m_fWrapX); CFont::SetCentreSize(SCREEN_SCALE_X_PC(line.m_fCenterSize));
CFont::SetCentreSize(line.m_fCenterSize);
#else
CFont::SetWrapx(SCALE_AND_CENTER_X(line.m_fWrapX));
CFont::SetCentreSize(SCREEN_SCALE_X(line.m_fCenterSize));
#endif
if (line.m_bBackground) if (line.m_bBackground)
CFont::SetBackgroundOn(); CFont::SetBackgroundOn();
@ -1706,61 +1492,34 @@ void CHud::DrawAfterFade()
/* /*
DrawBigMessage2 DrawBigMessage2
*/ */
#ifdef PS2_HUD
#define BIGMESSAGE_Y 80.0f
#else
#define BIGMESSAGE_Y 84.0f
#endif
// Oddjob // Oddjob
if (m_BigMessage[3][0]) { if (m_BigMessage[3][0]) {
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::SetScale(SCREEN_SCALE_X_PC(1.2f), SCREEN_SCALE_Y_PC(1.5f));
CFont::SetScale(1.2f, 1.5f);
#else
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f));
#endif
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - 40)); CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - 40));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK)); CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X_FIX(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y) + SCREEN_SCALE_Y_FIX(2.0f), m_BigMessage[3]);
#ifdef FIX_BUGS
CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y) + SCREEN_SCALE_Y(2.0f), m_BigMessage[3]);
#else
CFont::PrintString((SCREEN_WIDTH / 2) + 2.0f, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y) + 2.0f, m_BigMessage[3]);
#endif
CFont::SetColor(ODDJOB_COLOR); CFont::SetColor(ODDJOB_COLOR);
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y), m_BigMessage[3]); CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y), m_BigMessage[3]);
} }
if (!m_BigMessage[1][0] && m_BigMessage[4][0]) { if (!m_BigMessage[1][0] && m_BigMessage[4][0]) {
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::SetScale(SCREEN_SCALE_X_PC(1.2f), SCREEN_SCALE_Y_PC(1.5f));
CFont::SetScale(1.2f, 1.5f);
#else
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f));
#endif
CFont::SetCentreOn(); CFont::SetCentreOn();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - 20)); CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - 20));
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK)); CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
CFont::PrintString((SCREEN_WIDTH / 2) - SCREEN_SCALE_X_FIX(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y) - SCREEN_SCALE_Y_FIX(2.0f), m_BigMessage[4]);
#ifdef FIX_BUGS
CFont::PrintString((SCREEN_WIDTH / 2) - SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y) - SCREEN_SCALE_Y(2.0f), m_BigMessage[4]);
#else
CFont::PrintString((SCREEN_WIDTH / 2) - 2.0f, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y) - 2.0f, m_BigMessage[4]);
#endif
CFont::SetColor(ODDJOB_COLOR); CFont::SetColor(ODDJOB_COLOR);
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y), m_BigMessage[4]); CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y), m_BigMessage[4]);
} }
#undef BIGMESSAGE_Y
// Oddjob result // Oddjob result
if (OddJob2OffTimer > 0) if (OddJob2OffTimer > 0)
@ -1819,19 +1578,11 @@ void CHud::DrawAfterFade()
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK)); CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
#ifdef BETA_SLIDING_TEXT #ifdef BETA_SLIDING_TEXT
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X_PC(2.0f) - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y_PC(2.0f), m_BigMessage[5]);
CFont::PrintString(SCREEN_WIDTH / 2 + 2.0f - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + 2.0f, m_BigMessage[5]);
#else
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f) - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[5]);
#endif
CFont::SetColor(ODDJOB2_COLOR); CFont::SetColor(ODDJOB2_COLOR);
CFont::PrintString(SCREEN_WIDTH / 2 - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]); CFont::PrintString(SCREEN_WIDTH / 2 - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]);
#else #else
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X_PC(2.0f), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y_PC(2.0f), m_BigMessage[5]);
CFont::PrintString(SCREEN_WIDTH / 2 + 2.0f, SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + 2.0f, m_BigMessage[5]);
#else
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[5]);
#endif
CFont::SetColor(ODDJOB2_COLOR); CFont::SetColor(ODDJOB2_COLOR);
CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]); CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]);
#endif #endif
@ -1847,17 +1598,9 @@ void CHud::DrawAfterFade()
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
if (CGame::frenchGame || FrontEndMenuManager.m_PrefsLanguage == CMenuManager::LANGUAGE_SPANISH) if (CGame::frenchGame || FrontEndMenuManager.m_PrefsLanguage == CMenuManager::LANGUAGE_SPANISH)
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::SetScale(SCREEN_SCALE_X_PC(0.884f), SCREEN_SCALE_Y_PC(1.36f));
CFont::SetScale(0.884f, 1.36f);
#else
CFont::SetScale(SCREEN_SCALE_X(0.884f), SCREEN_SCALE_Y(1.36f));
#endif
else else
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::SetScale(SCREEN_SCALE_X_PC(1.04f), SCREEN_SCALE_Y_PC(1.6f));
CFont::SetScale(1.04f, 1.6f);
#else
CFont::SetScale(SCREEN_SCALE_X(1.04f), SCREEN_SCALE_Y(1.6f));
#endif
CFont::SetPropOn(); CFont::SetPropOn();
#ifdef FIX_BUGS #ifdef FIX_BUGS
@ -1868,11 +1611,7 @@ void CHud::DrawAfterFade()
CFont::SetRightJustifyOn(); CFont::SetRightJustifyOn();
CFont::SetFontStyle(FONT_HEADING); CFont::SetFontStyle(FONT_HEADING);
#ifdef FIX_BUGS if (BigMessageX[1] >= SCREEN_WIDTH - SCREEN_SCALE_X_FIX(20.0f))
if (BigMessageX[1] >= SCREEN_WIDTH - SCREEN_SCALE_X(20.0f))
#else
if (BigMessageX[1] >= SCREEN_WIDTH - 20.0f)
#endif
{ {
BigMessageInUse[1] += CTimer::GetTimeStep(); BigMessageInUse[1] += CTimer::GetTimeStep();
@ -1885,11 +1624,7 @@ void CHud::DrawAfterFade()
BigMessageAlpha[1] = 0.0f; BigMessageAlpha[1] = 0.0f;
} }
} else { } else {
#ifdef FIX_BUGS BigMessageX[1] += SCREEN_SCALE_X_FIX(CTimer::GetTimeStepInMilliseconds() * 0.3f);
BigMessageX[1] += SCREEN_SCALE_X((CTimer::GetTimeStepInMilliseconds() * 0.3f));
#else
BigMessageX[1] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
#endif
BigMessageAlpha[1] += (CTimer::GetTimeStepInMilliseconds() * 0.3f); BigMessageAlpha[1] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
if (BigMessageAlpha[1] > 255.0f) if (BigMessageAlpha[1] > 255.0f)
@ -1898,21 +1633,11 @@ void CHud::DrawAfterFade()
CFont::SetColor(CRGBA(40, 40, 40, BigMessageAlpha[1])); CFont::SetColor(CRGBA(40, 40, 40, BigMessageAlpha[1]));
#ifdef BETA_SLIDING_TEXT #ifdef BETA_SLIDING_TEXT
#if defined(PS2_HUD) && !defined(FIX_BUGS) CFont::PrintString(SCREEN_SCALE_X(2.0f) + BigMessageX[1], SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y_PC(2.0f), m_BigMessage[1]);
CFont::PrintString(SCREEN_SCALE_X(2.0f) + BigMessageX[1], SCREEN_SCALE_FROM_BOTTOM(120.0f) + 2.0f, m_BigMessage[1]);
#else
CFont::PrintString(SCREEN_SCALE_X(2.0f) + BigMessageX[1], SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[1]);
#endif
CFont::SetColor(CRGBA(MISSIONTITLE_COLOR.r, MISSIONTITLE_COLOR.g, MISSIONTITLE_COLOR.b, BigMessageAlpha[1])); CFont::SetColor(CRGBA(MISSIONTITLE_COLOR.r, MISSIONTITLE_COLOR.g, MISSIONTITLE_COLOR.b, BigMessageAlpha[1]));
CFont::PrintString(BigMessageX[1], SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]); CFont::PrintString(BigMessageX[1], SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]);
#else #else
#ifdef FIX_BUGS CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + SCREEN_SCALE_X_FIX(2.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y_PC(2.0f), m_BigMessage[1]);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[1]);
#elif defined(PS2_HUD)
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + 2.0f, SCREEN_SCALE_FROM_BOTTOM(120.0f) + 2.0f, m_BigMessage[1]);
#else
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + 2.0f, SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[1]);
#endif
CFont::SetColor(CRGBA(MISSIONTITLE_COLOR.r, MISSIONTITLE_COLOR.g, MISSIONTITLE_COLOR.b, BigMessageAlpha[1])); CFont::SetColor(CRGBA(MISSIONTITLE_COLOR.r, MISSIONTITLE_COLOR.g, MISSIONTITLE_COLOR.b, BigMessageAlpha[1]));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]);
#endif #endif

View File

@ -5,6 +5,10 @@
#include "Camera.h" #include "Camera.h"
#include "Sprite.h" #include "Sprite.h"
#ifdef ASPECT_RATIO_SCALE
#include "Frontend.h"
#endif
float CSprite::m_f2DNearScreenZ; float CSprite::m_f2DNearScreenZ;
float CSprite::m_f2DFarScreenZ; float CSprite::m_f2DFarScreenZ;
float CSprite::m_fRecipNearClipPlane; float CSprite::m_fRecipNearClipPlane;
@ -33,7 +37,11 @@ CSprite::CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh,
// this is used to scale correctly if you zoom in with sniper rifle // this is used to scale correctly if you zoom in with sniper rifle
float fovScale = fov / CDraw::GetFOV(); float fovScale = fov / CDraw::GetFOV();
#ifdef FIX_SPRITES
*outw = fovScale * recip * SCREEN_HEIGHT;
#else
*outw = fovScale * SCREEN_SCALE_AR(recip) * SCREEN_WIDTH; *outw = fovScale * SCREEN_SCALE_AR(recip) * SCREEN_WIDTH;
#endif
*outh = fovScale * recip * SCREEN_HEIGHT; *outh = fovScale * recip * SCREEN_HEIGHT;
return true; return true;

View File

@ -8061,6 +8061,9 @@ PS2
[FEM_XBX] [FEM_XBX]
XBOX XBOX
[FEM_AUT]
AUTO
[FEC_IVP] [FEC_IVP]
INVERT PAD VERTICALLY INVERT PAD VERTICALLY