Update HUD stuff, bug and format fixes.

Added environment variables to premake5.lua.
Update README.md
This commit is contained in:
_AG
2019-06-17 02:10:55 +02:00
parent d92c9085da
commit f299e9ebd5
17 changed files with 291 additions and 190 deletions

View File

@ -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();
}
}
}
}
}

View File

@ -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;