From f299e9ebd51cc26d30a40ee5edff7ddf2968b2ec Mon Sep 17 00:00:00 2001 From: _AG Date: Mon, 17 Jun 2019 02:10:55 +0200 Subject: Update HUD stuff, bug and format fixes. Added environment variables to premake5.lua. Update README.md --- src/audio/MusicManager.cpp | 30 +++++++++++++++++------------- src/audio/MusicManager.h | 9 ++++++--- 2 files changed, 23 insertions(+), 16 deletions(-) (limited to 'src/audio') diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp index d3f14b0a..881f6407 100644 --- a/src/audio/MusicManager.cpp +++ b/src/audio/MusicManager.cpp @@ -16,7 +16,8 @@ int &gRetuneCounter = *(int*)0x650B84; //WRAPPER void cMusicManager::DisplayRadioStationName(void) { EAXJMP(0x57E6D0); } -bool cMusicManager::PlayerInCar() { +bool cMusicManager::PlayerInCar() +{ if (!FindPlayerVehicle()) return false; else { @@ -25,7 +26,6 @@ bool cMusicManager::PlayerInCar() { if (State == PED_DRAG_FROM_CAR || State == PED_EXIT_CAR || State == PED_ARRESTED) return false; - int16 Model = FindPlayerVehicle()->m_modelIndex; switch (FindPlayerVehicle()->m_modelIndex) { case MI_FIRETRUCK: case MI_AMBULAN: @@ -42,8 +42,9 @@ bool cMusicManager::PlayerInCar() { } } -void cMusicManager::DisplayRadioStationName() { - wchar* RadioName = nullptr; +void cMusicManager::DisplayRadioStationName() +{ + wchar *RadioName = nullptr; uint32 RadioStation = gNumRetunePresses + MusicManager.m_nCurrentStreamedSound; switch (RadioStation) { @@ -84,11 +85,11 @@ void cMusicManager::DisplayRadioStationName() { CFont::SetJustifyOff(); CFont::SetBackgroundOff(); - CFont::SetScale(SCREEN_STRETCH_X(0.8f), SCREEN_STRETCH_Y(1.35f)); + CFont::SetScale(HUD_STRETCH_X(0.8f), HUD_STRETCH_Y(1.35f)); CFont::SetPropOn(); CFont::SetFontStyle(FONT_HEADING); CFont::SetCentreOn(); - CFont::SetCentreSize(SCREEN_STRETCH_X(640.0f));; + CFont::SetCentreSize(HUD_STRETCH_X(640.0f));; static int32 nTime = 0; if (!CTimer::GetIsPaused() && !TheCamera.m_WideScreenOn && MusicManager.PlayerInCar()) { @@ -105,33 +106,36 @@ void cMusicManager::DisplayRadioStationName() { else { if (RadioStation > HEAD_RADIO) { if (cSampleManager.IsMP3RadioChannelAvailable()) { - if (RadioStation > USERTRACK) + if (RadioStation > USERTRACK) { RadioStation = RADIO_OFF; + return; + } } else { - if (RadioStation > CHATTERBOX) + if (RadioStation > CHATTERBOX) { RadioStation = RADIO_OFF; + return; + } } } - else { + else RadioStation = RADIO_OFF; - } } } if (RadioName) { CFont::SetColor(CRGBA(0, 0, 0, 255)); - CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_STRETCH_Y(23.0f), RadioName); + CFont::PrintString(SCREEN_WIDTH / 2, HUD_STRETCH_Y(23.0f), RadioName); if (gNumRetunePresses) CFont::SetColor(CRGBA(102, 133, 143, 255)); else CFont::SetColor(CRGBA(147, 196, 211, 255)); - CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_STRETCH_Y(22.0f), RadioName); + CFont::PrintString(SCREEN_WIDTH / 2, HUD_STRETCH_Y(22.0f), RadioName); CFont::DrawFonts(); } } } -} \ No newline at end of file +} diff --git a/src/audio/MusicManager.h b/src/audio/MusicManager.h index 48df60ba..644c3df3 100644 --- a/src/audio/MusicManager.h +++ b/src/audio/MusicManager.h @@ -1,6 +1,7 @@ #pragma once -enum eRadioStation { +enum eRadioStation +{ HEAD_RADIO, DOUBLE_CLEF, JAH_RADIO, @@ -15,7 +16,8 @@ enum eRadioStation { RADIO_OFF, }; -enum eStreamedSounds { +enum eStreamedSounds +{ STREAMED_SOUND_RADIO_HEAD = 0, STREAMED_SOUND_RADIO_CLASSIC = 1, STREAMED_SOUND_RADIO_KJAH = 2, @@ -216,7 +218,8 @@ enum eStreamedSounds { NO_STREAMED_SOUND = 197, }; -class tMP3Sample { +class tMP3Sample +{ public: uint32 m_nLength; uint32 m_nPosition; -- cgit v1.2.3