summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Credits.cpp56
-rw-r--r--src/render/Fluff.cpp4
-rw-r--r--src/render/Hud.cpp126
-rw-r--r--src/render/Hud.h4
4 files changed, 129 insertions, 61 deletions
diff --git a/src/render/Credits.cpp b/src/render/Credits.cpp
index dc0b0252..60e69583 100644
--- a/src/render/Credits.cpp
+++ b/src/render/Credits.cpp
@@ -128,12 +128,12 @@ CCredits::Render(void)
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED040"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.4f, 0.82f, TheText.Get("CRED041"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.5, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED042"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED043"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.5, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED044"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
@@ -176,7 +176,7 @@ CCredits::Render(void)
PrintCreditSpace(2.0f, lineoffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED061"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.5, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED062"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
@@ -191,7 +191,7 @@ CCredits::Render(void)
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED068"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED069"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.5, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED070"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
@@ -220,7 +220,7 @@ CCredits::Render(void)
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED262"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED085"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.5, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED086"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
@@ -265,76 +265,76 @@ CCredits::Render(void)
PrintCreditText(1.0, 1.0, TheText.Get("CRED108"), lineoffset, scrolloffset);
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED109"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED110"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED111"), lineoffset, scrolloffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED112"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED113"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED114"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED115"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED116"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED117"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED118"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED119"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED120"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED121"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED122"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED123"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED124"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED125"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED126"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED127"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED128"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED129"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED130"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED131"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED132"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED133"), lineoffset, scrolloffset);
- if(CMenuManager::m_PrefsLanguage == LANGUAGE_ITALIAN)
+ if(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_ITALIAN)
PrintCreditSpace(1.0, lineoffset);
PrintCreditText(1.0, 1.0, TheText.Get("CRED134"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
diff --git a/src/render/Fluff.cpp b/src/render/Fluff.cpp
index 59ac1652..1056d6ff 100644
--- a/src/render/Fluff.cpp
+++ b/src/render/Fluff.cpp
@@ -382,7 +382,7 @@ void CScrollBar::Update()
m_pMessage = FindTimeMessage();
break;
case 6:
- if (CMenuManager::m_PrefsLanguage == LANGUAGE_FRENCH || CMenuManager::m_PrefsLanguage == LANGUAGE_GERMAN)
+ if (FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_FRENCH || FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_GERMAN)
m_pMessage = FindTimeMessage();
else
m_pMessage = "WWW.GRANDTHEFTAUTO3.COM ";
@@ -602,7 +602,7 @@ void CScrollBar::Update()
m_pMessage = "FREE FLUFFY DICE WITH ALL PURCHASES. . .";
break;
case 9:
- if (CMenuManager::m_PrefsLanguage == LANGUAGE_FRENCH || CMenuManager::m_PrefsLanguage == LANGUAGE_GERMAN)
+ if (FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_FRENCH || FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_GERMAN)
m_pMessage = "QUICK, TAKE A LOOK AT OUR CURRENT STOCK )CAUSE THESE AUTOS ARE MOVIN) FAST . . . ";
else
m_pMessage = "HTTP:((ROCKSTARGAMES.COM(GRANDTHEFTAUTO3(CAPITALAUTOS ";
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index 7289d70c..00d5b5c7 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -38,7 +38,7 @@ CRGBA COUNTER_COLOR(97, 194, 247, 255);
CRGBA PAGER_COLOR(32, 162, 66, 205);
CRGBA RADARDISC_COLOR(255, 255, 255, 255);
CRGBA BIGMESSAGE_COLOR(85, 119, 133, 255);
-CRGBA WASTEDBUSTED_COLOR(170, 123, 87, 255);
+CRGBA WASTEDBUSTED_COLOR(255, 150, 225, 255);
CRGBA ODDJOB_COLOR(89, 115, 150, 255);
CRGBA ODDJOB2_COLOR(156, 91, 40, 255);
CRGBA MISSIONTITLE_COLOR(220, 172, 2, 255);
@@ -102,6 +102,7 @@ uint32 CHud::m_WeaponState;
uint32 CHud::m_WeaponTimer;
uint32 CHud::m_LastDisplayScore;
+uint32 CHud::m_LastWanted;
CSprite2d CHud::Sprites[NUM_HUD_SPRITES];
@@ -483,33 +484,46 @@ void CHud::Draw()
/*
DrawWantedLevel
*/
- CFont::SetBackgroundOff();
- CFont::SetScale(SCREEN_SCALE_X(HUD_TEXT_SCALE_X), SCREEN_SCALE_Y(HUD_TEXT_SCALE_Y));
- CFont::SetJustifyOff();
- CFont::SetCentreOff();
- CFont::SetRightJustifyOn();
- CFont::SetPropOn();
- CFont::SetFontStyle(FONT_HEADING);
- CFont::SetDropShadowPosition(2); // TODO(Miami): Remove that, VC keeps that open above
+ if (m_LastWanted == playerPed->m_pWanted->m_nWantedLevel)
+ alpha = CHud::DrawFadeState(HUD_WANTED_FADING, 0);
+ else {
+ alpha = CHud::DrawFadeState(HUD_WANTED_FADING, 1);
+ m_LastWanted = playerPed->m_pWanted->m_nWantedLevel;
+ }
+
+ if (m_WantedState != FADED_OUT) {
+ CFont::SetBackgroundOff();
+ CFont::SetScale(SCREEN_SCALE_X(HUD_TEXT_SCALE_X), SCREEN_SCALE_Y(HUD_TEXT_SCALE_Y));
+ CFont::SetJustifyOff();
+ CFont::SetCentreOff();
+ CFont::SetRightJustifyOn();
+ CFont::SetPropOn();
+ CFont::SetFontStyle(FONT_HEADING);
+ CFont::SetDropShadowPosition(2); // TODO(Miami): Remove that, VC keeps that open above
+ CFont::SetDropColor(CRGBA(0,0,0,alpha)); // TODO(Miami): Remove that, VC keeps that open above
- AsciiToUnicode("]", sPrintIcon);
+ AsciiToUnicode("]", sPrintIcon);
- for (int i = 0; i < 6; i++) {
- if (playerPed->m_pWanted->m_nWantedLevel > i
- && (CTimer::GetTimeInMilliseconds() > playerPed->m_pWanted->m_nLastWantedLevelChange
- + 2000 || CTimer::GetFrameCounter() & 4)) {
+ for (int i = 0; i < 6; i++) {
+ if (playerPed->m_pWanted->m_nWantedLevel > i
+ && (CTimer::GetTimeInMilliseconds() > playerPed->m_pWanted->m_nLastWantedLevelChange
+ + 2000 || CTimer::GetFrameCounter() & 4)) {
- CFont::SetColor(WANTED_COLOR);
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f + 23.0f * i), SCREEN_SCALE_Y(87.0f), sPrintIcon);
+ WANTED_COLOR.a = alpha;
+ CFont::SetColor(WANTED_COLOR);
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f + 23.0f * i), SCREEN_SCALE_Y(87.0f), sPrintIcon);
- // TODO(Miami): There is one more condition in here
- }else if (playerPed->m_pWanted->m_nWantedLevel <= i) {
- CFont::SetColor(NOTWANTED_COLOR);
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f + 23.0f * i), SCREEN_SCALE_Y(87.0f), sPrintIcon);
+ // TODO(Miami): There is one more condition in here
+ }
+ else if (playerPed->m_pWanted->m_nWantedLevel <= i) {
+ NOTWANTED_COLOR.a = alpha;
+ CFont::SetColor(NOTWANTED_COLOR);
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f + 23.0f * i), SCREEN_SCALE_Y(87.0f), sPrintIcon);
+ }
}
- }
- CFont::SetDropShadowPosition(0); // TODO(Miami): Remove that, VC keeps that open
+ CFont::SetDropShadowPosition(0); // TODO(Miami): Remove that, VC keeps that open
+ }
/*
DrawZoneName
@@ -909,7 +923,17 @@ void CHud::Draw()
#else
rect.Translate(RADAR_LEFT, SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
#endif
- rect.Grow(4.0f);
+
+ // shadow, might not be exactly accurate numbers
+ rect.Translate(0.f, 4.f);
+ rect.Grow(6.0f);
+ rect.top += 2.f;
+ rect.bottom -= 2.f;
+ Sprites[HUD_RADARDISC].Draw(rect, CRGBA(0, 0, 0, 255));
+
+ rect.Translate(0.f, -4.f);
+ rect.top -= 2.f;
+ rect.bottom += 2.f;
Sprites[HUD_RADARDISC].Draw(rect, RADARDISC_COLOR);
CRadar::DrawBlips();
}
@@ -1466,6 +1490,30 @@ void CHud::GetRidOfAllHudMessages()
}
}
+#ifdef RELOADABLES
+void CHud::ReloadTXD()
+{
+ for (int i = 0; i < NUM_HUD_SPRITES; ++i) {
+ Sprites[i].Delete();
+ }
+
+ int HudTXD = CTxdStore::FindTxdSlot("hud");
+ CTxdStore::RemoveTxdSlot(HudTXD);
+
+ debug("Reloading HUD.TXD...\n");
+
+ HudTXD = CTxdStore::AddTxdSlot("hud");
+ CTxdStore::LoadTxd(HudTXD, "MODELS/HUD.TXD");
+ CTxdStore::AddRef(HudTXD);
+ CTxdStore::PopCurrentTxd();
+ CTxdStore::SetCurrentTxd(HudTXD);
+
+ for (int i = 0; i < NUM_HUD_SPRITES; i++) {
+ Sprites[i].SetTexture(WeaponFilenames[i].name, WeaponFilenames[i].mask);
+ }
+}
+#endif
+
void CHud::Initialise()
{
m_Wants_To_Draw_Hud = true;
@@ -1503,20 +1551,28 @@ void CHud::Initialise()
PagerSoundPlayed = 0;
PagerXOffset = 150.0f;
- m_WantedFadeTimer = 0;
+#ifdef HUD_AUTO_FADE
+ m_EnergyLostState = START_FADE_OUT;
+ m_WantedState = START_FADE_OUT;
+ m_DisplayScoreState = START_FADE_OUT;
+ m_WeaponState = START_FADE_OUT;
+#else
+ m_EnergyLostState = FADE_DISABLED;
m_WantedState = FADE_DISABLED;
+ m_DisplayScoreState = FADE_DISABLED;
+ m_WeaponState = FADE_DISABLED;
+#endif
+ m_WantedFadeTimer = 0;
m_WantedTimer = 0;
m_EnergyLostFadeTimer = 0;
- m_EnergyLostState = FADE_DISABLED;
m_EnergyLostTimer = 0;
m_DisplayScoreFadeTimer = 0;
- m_DisplayScoreState = FADE_DISABLED;
m_DisplayScoreTimer = 0;
m_WeaponFadeTimer = 0;
- m_WeaponState = FADE_DISABLED;
m_WeaponTimer = 0;
m_LastDisplayScore = CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney;
+ m_LastWanted = 0;
CTxdStore::PopCurrentTxd();
}
@@ -1542,20 +1598,28 @@ void CHud::ReInitialise() {
PagerSoundPlayed = 0;
PagerXOffset = 150.0f;
- m_WantedFadeTimer = 0;
+#ifdef HUD_AUTO_FADE
+ m_EnergyLostState = START_FADE_OUT;
+ m_WantedState = START_FADE_OUT;
+ m_DisplayScoreState = START_FADE_OUT;
+ m_WeaponState = START_FADE_OUT;
+#else
+ m_EnergyLostState = FADE_DISABLED;
m_WantedState = FADE_DISABLED;
+ m_DisplayScoreState = FADE_DISABLED;
+ m_WeaponState = FADE_DISABLED;
+#endif
+ m_WantedFadeTimer = 0;
m_WantedTimer = 0;
m_EnergyLostFadeTimer = 0;
- m_EnergyLostState = FADE_DISABLED;
m_EnergyLostTimer = 0;
m_DisplayScoreFadeTimer = 0;
- m_DisplayScoreState = FADE_DISABLED;
m_DisplayScoreTimer = 0;
m_WeaponFadeTimer = 0;
- m_WeaponState = FADE_DISABLED;
m_WeaponTimer = 0;
m_LastDisplayScore = CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney;
+ m_LastWanted = 0;
}
wchar LastBigMessage[6][128];
diff --git a/src/render/Hud.h b/src/render/Hud.h
index bae19ee4..db92e32c 100644
--- a/src/render/Hud.h
+++ b/src/render/Hud.h
@@ -119,11 +119,15 @@ public:
static uint32 m_WeaponTimer;
static uint32 m_LastDisplayScore;
+ static uint32 m_LastWanted;
public:
static void Draw();
static void DrawAfterFade();
static void GetRidOfAllHudMessages();
+#ifdef RELOADABLES
+ static void ReloadTXD();
+#endif
static void Initialise();
static void ReInitialise();
static void SetBigMessage(wchar *message, int16 style);