Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Client/core/CCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ void CCore::EnableChatInput(char* szCommand, DWORD dwColor)
{
if (m_pLocalGUI)
{
if (m_pGame->GetSystemState() == 9 /* GS_PLAYING_GAME */ && m_pModManager->IsLoaded() && !IsOfflineMod() && !m_pGame->IsAtMenu() &&
if (m_pGame->GetSystemState() == SystemState::GS_PLAYING_GAME && m_pModManager->IsLoaded() && !IsOfflineMod() && !m_pGame->IsAtMenu() &&
!m_pLocalGUI->GetMainMenu()->IsVisible() && !m_pLocalGUI->GetConsole()->IsVisible() && !m_pLocalGUI->IsChatBoxInputEnabled())
{
CChat* pChat = m_pLocalGUI->GetChat();
Expand Down Expand Up @@ -1232,7 +1232,7 @@ void CCore::DoPostFramePulse()
}

// This is the first frame in the menu?
if (m_pGame->GetSystemState() == 7) // GS_FRONTEND
if (m_pGame->GetSystemState() == SystemState::GS_FRONTEND)
{
if (m_menuFrame < 255)
++m_menuFrame;
Expand Down
10 changes: 5 additions & 5 deletions Client/core/CGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,17 +281,17 @@ void CLocalGUI::Draw()
{
// Get the game interface
CGame* pGame = CCore::GetSingleton().GetGame();
eSystemState SystemState = pGame->GetSystemState();
SystemState systemState = pGame->GetSystemState();
CGUI* pGUI = CCore::GetSingleton().GetGUI();

// Update mainmenu stuff
m_pMainMenu->Update();

// If we're ingame, make sure the chatbox is drawn
bool bChatVisible = (SystemState == 9 /* GS_INGAME */ && m_pMainMenu->GetIsIngame() && m_bChatboxVisible && !CCore::GetSingleton().IsOfflineMod());
bool bChatVisible = (systemState == SystemState::GS_PLAYING_GAME && m_pMainMenu->GetIsIngame() && m_bChatboxVisible && !CCore::GetSingleton().IsOfflineMod());
if (m_pChat->IsVisible() != bChatVisible)
m_pChat->SetVisible(bChatVisible, !bChatVisible);
bool bDebugVisible = (SystemState == 9 /* GS_INGAME */ && m_pMainMenu->GetIsIngame() && m_pDebugViewVisible && !CCore::GetSingleton().IsOfflineMod());
bool bDebugVisible = (systemState == SystemState::GS_PLAYING_GAME && m_pMainMenu->GetIsIngame() && m_pDebugViewVisible && !CCore::GetSingleton().IsOfflineMod());
if (m_pDebugView->IsVisible() != bDebugVisible)
m_pDebugView->SetVisible(bDebugVisible, true);

Expand All @@ -305,7 +305,7 @@ void CLocalGUI::Draw()

// If we're not at the loadingscreen
static bool bDelayedFrame = false;
if (SystemState != 8 || !bDelayedFrame /* GS_INIT_PLAYING_GAME */)
if (systemState != SystemState::GS_INIT_PLAYING_GAME || !bDelayedFrame)
{
// If we have a GUI manager, draw the GUI
if (pGUI)
Expand All @@ -314,7 +314,7 @@ void CLocalGUI::Draw()
}

// If the system state was 8, make sure we don't do another delayed frame
if (SystemState == 8)
if (systemState == SystemState::GS_INIT_PLAYING_GAME)
{
bDelayedFrame = true;
}
Expand Down
10 changes: 5 additions & 5 deletions Client/core/CKeyBinds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,15 +1872,15 @@ bool CKeyBinds::ControlLeftAndRight(CControllerState& cs)

void CKeyBinds::DoPostFramePulse()
{
eSystemState SystemState = CCore::GetSingleton().GetGame()->GetSystemState();
SystemState systemState = CCore::GetSingleton().GetGame()->GetSystemState();

if (m_bWaitingToLoadDefaults && (SystemState == 7 || SystemState == 9)) // Are GTA controls actually initialized?
if (m_bWaitingToLoadDefaults && (systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_PLAYING_GAME)) // Are GTA controls actually initialized?
{
LoadDefaultBinds();
m_bWaitingToLoadDefaults = false;
}

if (SystemState != 9 /* GS_PLAYING_GAME */)
if (systemState != SystemState::GS_PLAYING_GAME)
return;

bool bInVehicle = false, bHasDetonator = false, bIsDead = false, bAimingWeapon = false, bEnteringVehicle = false;
Expand Down Expand Up @@ -2151,10 +2151,10 @@ bool CKeyBinds::LoadFromXML(CXMLNode* pMainNode)
else
bLoadDefaults = true;

eSystemState SystemState = CCore::GetSingleton().GetGame()->GetSystemState();
SystemState systemState = CCore::GetSingleton().GetGame()->GetSystemState();
if (bLoadDefaults)
{
if (SystemState == 7 || SystemState == 9) // Are GTA controls actually initialized?
if (systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_PLAYING_GAME) // Are GTA controls actually initialized?
LoadDefaultBinds();
else
m_bWaitingToLoadDefaults = true;
Expand Down
10 changes: 5 additions & 5 deletions Client/core/CMainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ void CMainMenu::Update()

// Get the game interface and the system state
CGame* pGame = CCore::GetSingleton().GetGame();
eSystemState SystemState = pGame->GetSystemState();
SystemState systemState = pGame->GetSystemState();

m_Credits.Update();
m_Settings.Update();
Expand Down Expand Up @@ -650,7 +650,7 @@ void CMainMenu::Update()
}

// Force the mainmenu on if we're at GTA's mainmenu or not ingame
if ((SystemState == 7 || SystemState == 9) && !m_bIsIngame)
if ((systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_PLAYING_GAME) && !m_bIsIngame)
{
if (!m_bStarted)
{
Expand All @@ -671,11 +671,11 @@ void CMainMenu::Update()
}

// If we're visible
if (m_bIsVisible && SystemState != 8)
if (m_bIsVisible && systemState != SystemState::GS_INIT_PLAYING_GAME)
{
// If we're at the game's mainmenu, or ingame when m_bIsIngame is true show the background
if (SystemState == 7 || // GS_FRONTEND
SystemState == 9 && !m_bIsIngame) // GS_PLAYING_GAME
if (systemState == SystemState::GS_FRONTEND ||
systemState == SystemState::GS_PLAYING_GAME && !m_bIsIngame)
{
if (m_ucFade == FADE_INVISIBLE)
Show(false);
Expand Down
14 changes: 7 additions & 7 deletions Client/core/CMessageLoopHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ LRESULT CALLBACK CMessageLoopHook::ProcessMessage(HWND hwnd, UINT uMsg, WPARAM w
// If CTRL and Tab are pressed, Trigger a skip
if ((uMsg == WM_KEYDOWN && wParam == VK_TAB))
{
eSystemState systemState = g_pCore->GetGame()->GetSystemState();
if (systemState == 7 || systemState == 8 || systemState == 9)
SystemState systemState = g_pCore->GetGame()->GetSystemState();
if (systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_INIT_PLAYING_GAME || systemState == SystemState::GS_PLAYING_GAME)
{
short sCtrlState = GetKeyState(VK_CONTROL);
short sShiftState = GetKeyState(VK_SHIFT);
Expand All @@ -344,8 +344,8 @@ LRESULT CALLBACK CMessageLoopHook::ProcessMessage(HWND hwnd, UINT uMsg, WPARAM w
}
if ((uMsg == WM_KEYDOWN && (wParam >= VK_1 && wParam <= VK_9)))
{
eSystemState systemState = g_pCore->GetGame()->GetSystemState();
if (systemState == 7 || systemState == 8 || systemState == 9)
SystemState systemState = g_pCore->GetGame()->GetSystemState();
if (systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_INIT_PLAYING_GAME || systemState == SystemState::GS_PLAYING_GAME)
{
short sCtrlState = GetKeyState(VK_CONTROL);
if (sCtrlState & 0x8000)
Expand All @@ -368,9 +368,9 @@ LRESULT CALLBACK CMessageLoopHook::ProcessMessage(HWND hwnd, UINT uMsg, WPARAM w
// If F8 is pressed, we show/hide the console
if ((uMsg == WM_KEYDOWN && wParam == VK_F8) || (uMsg == WM_CHAR && wParam == '`'))
{
eSystemState systemState = g_pCore->GetGame()->GetSystemState();
if (CLocalGUI::GetSingleton().IsConsoleVisible() || systemState == 7 || systemState == 8 ||
systemState == 9) /* GS_FRONTEND, GS_INIT_PLAYING_GAME, GS_PLAYING_GAME */
SystemState systemState = g_pCore->GetGame()->GetSystemState();
if (CLocalGUI::GetSingleton().IsConsoleVisible() || systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_INIT_PLAYING_GAME ||
systemState == SystemState::GS_PLAYING_GAME)
{
CLocalGUI::GetSingleton().SetConsoleVisible(!CLocalGUI::GetSingleton().IsConsoleVisible());
}
Expand Down
2 changes: 1 addition & 1 deletion Client/core/CMouseControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bool CMouseControl::ProcessMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam)
if (uMsg != WM_MOUSEMOVE)
return false;

if (g_pCore->GetGame()->GetSystemState() != 9)
if (g_pCore->GetGame()->GetSystemState() != SystemState::GS_PLAYING_GAME)
return false;

// HACK: Grab our local player, and check his vehicle
Expand Down
6 changes: 3 additions & 3 deletions Client/game_sa/C3DMarkersSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ C3DMarkersSA::~C3DMarkersSA()
}
}

C3DMarker* C3DMarkersSA::CreateMarker(DWORD Identifier, e3DMarkerType dwType, CVector* vecPosition, float fSize, float fPulseFraction, BYTE r, BYTE g, BYTE b,
C3DMarker* C3DMarkersSA::CreateMarker(DWORD Identifier, T3DMarkerType dwType, CVector* vecPosition, float fSize, float fPulseFraction, BYTE r, BYTE g, BYTE b,
BYTE a)
{
/*
Expand All @@ -37,8 +37,8 @@ C3DMarker* C3DMarkersSA::CreateMarker(DWORD Identifier, e3DMarkerType dwType, CV
unsigned short nPeriod, float fPulseFrac, short nRotRate, float normalX = 0.0f,
float normalY = 0.0f, float normalZ = 0.0f, bool zCheck = FALSE);
*/
WORD wType = dwType;
dwType = (e3DMarkerType)wType;
WORD wType = (WORD)dwType;
dwType = (T3DMarkerType)wType;
bool bZCheck = true;

DWORD dwFunc = FUNC_PlaceMarker;
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/C3DMarkersSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class C3DMarkersSA : public C3DMarkers
C3DMarkersSA();
~C3DMarkersSA();

C3DMarker* CreateMarker(DWORD Identifier, e3DMarkerType dwType, CVector* vecPosition, float fSize, float fPulseFraction, BYTE r, BYTE g, BYTE b, BYTE a);
C3DMarker* CreateMarker(DWORD Identifier, T3DMarkerType dwType, CVector* vecPosition, float fSize, float fPulseFraction, BYTE r, BYTE g, BYTE b, BYTE a);
C3DMarker* FindFreeMarker();
C3DMarker* FindMarker(DWORD Identifier);
void ReinitMarkers();
Expand Down
8 changes: 4 additions & 4 deletions Client/game_sa/CCoronasSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ CRegisteredCorona* CCoronasSA::CreateCorona(DWORD Identifier, CVector* position)

if (corona)
{
RwTexture* texture = GetTexture((eCoronaType)CORONATYPE_SHINYSTAR);
RwTexture* texture = GetTexture(CoronaType::CORONATYPE_SHINYSTAR);
if (texture)
{
corona->Init(Identifier);
Expand Down Expand Up @@ -81,10 +81,10 @@ CRegisteredCorona* CCoronasSA::FindCorona(DWORD Identifier)
return (CRegisteredCorona*)NULL;
}

RwTexture* CCoronasSA::GetTexture(eCoronaType type)
RwTexture* CCoronasSA::GetTexture(CoronaType type)
{
if (type < MAX_CORONA_TEXTURES)
return (RwTexture*)(*(DWORD*)(ARRAY_CORONA_TEXTURES + type * sizeof(DWORD)));
if ((DWORD)type < MAX_CORONA_TEXTURES)
return (RwTexture*)(*(DWORD*)(ARRAY_CORONA_TEXTURES + static_cast<DWORD>(type) * sizeof(DWORD)));
else
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CCoronasSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CCoronasSA : public CCoronas
CRegisteredCorona* CreateCorona(DWORD Identifier, CVector* position);
CRegisteredCorona* FindFreeCorona();
CRegisteredCorona* FindCorona(DWORD Identifier);
RwTexture* GetTexture(eCoronaType type);
RwTexture* GetTexture(CoronaType type);

void DisableSunAndMoon(bool bDisabled);

Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CDoorSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ class CDoorSA : public CDoor
bool IsClosed();
bool IsFullyOpen();
void Open(float fOpenRatio);
eDoorState GetDoorState() { return (eDoorState)GetInterface()->m_nDoorState; };
DoorState GetDoorState() { return (DoorState)GetInterface()->m_nDoorState; };
};
36 changes: 18 additions & 18 deletions Client/game_sa/CFxSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void CFxSA::TriggerFootSplash(CVector& vecPosition)
}
}

void CFxSA::AddParticle(eFxParticleSystems eFxParticle, const CVector& vecPosition, const CVector& vecDirection, float fR, float fG, float fB, float fA, bool bRandomizeColors, std::uint32_t iCount, float fBrightness, float fSize, bool bRandomizeSizes, float fLife)
void CFxSA::AddParticle(FxParticleSystems eFxParticle, const CVector& vecPosition, const CVector& vecDirection, float fR, float fG, float fB, float fA, bool bRandomizeColors, std::uint32_t iCount, float fBrightness, float fSize, bool bRandomizeSizes, float fLife)
{
// Init our own FxPrtMult struct
FxPrtMult_c fxPrt{{fR,fG,fB,fA}, fSize, 0, fLife};
Expand All @@ -250,55 +250,55 @@ void CFxSA::AddParticle(eFxParticleSystems eFxParticle, const CVector& vecPositi

switch (eFxParticle)
{
case eFxParticleSystems::PRT_BLOOD:
case FxParticleSystems::PRT_BLOOD:
fxParticleSystem = m_pInterface->m_fxSysBlood;
break;
case eFxParticleSystems::PRT_BOATSPLASH:
case FxParticleSystems::PRT_BOATSPLASH:
fxParticleSystem = m_pInterface->m_fxSysBoatSplash;
break;
case eFxParticleSystems::PRT_BUBBLE:
case FxParticleSystems::PRT_BUBBLE:
fxParticleSystem = m_pInterface->m_fxSysBubble;
break;
case eFxParticleSystems::PRT_DEBRIS:
case FxParticleSystems::PRT_DEBRIS:
fxParticleSystem = m_pInterface->m_fxSysDebris;
break;
case eFxParticleSystems::PRT_GUNSHELL:
case FxParticleSystems::PRT_GUNSHELL:
fxParticleSystem = m_pInterface->m_fxSysGunshell;
break;
case eFxParticleSystems::PRT_SAND:
case FxParticleSystems::PRT_SAND:
fxParticleSystem = m_pInterface->m_fxSysSand;
break;
case eFxParticleSystems::PRT_SAND2:
case FxParticleSystems::PRT_SAND2:
fxParticleSystem = m_pInterface->m_fxSysSand2;
break;
case eFxParticleSystems::PRT_SMOKE:
case FxParticleSystems::PRT_SMOKE:
fxParticleSystem = m_pInterface->m_fxSysSmoke;
break;
case eFxParticleSystems::PRT_SMOKEHUGE:
case FxParticleSystems::PRT_SMOKEHUGE:
fxParticleSystem = m_pInterface->m_fxSysSmokeHuge;
break;
case eFxParticleSystems::PRT_SMOKE2:
case FxParticleSystems::PRT_SMOKE2:
fxParticleSystem = m_pInterface->m_fxSysSmoke2;
break;
case eFxParticleSystems::PRT_SPARK:
case FxParticleSystems::PRT_SPARK:
fxParticleSystem = m_pInterface->m_fxSysSpark;
break;
case eFxParticleSystems::PRT_SPARK2:
case FxParticleSystems::PRT_SPARK2:
fxParticleSystem = m_pInterface->m_fxSysSpark2;
break;
case eFxParticleSystems::PRT_SPLASH:
case FxParticleSystems::PRT_SPLASH:
fxParticleSystem = m_pInterface->m_fxSysSplash;
break;
case eFxParticleSystems::PRT_WAKE:
case FxParticleSystems::PRT_WAKE:
fxParticleSystem = m_pInterface->m_fxSysWake;
break;
case eFxParticleSystems::PRT_WATERSPLASH:
case FxParticleSystems::PRT_WATERSPLASH:
fxParticleSystem = m_pInterface->m_fxSysWaterSplash;
break;
case eFxParticleSystems::PRT_WHEELDIRT:
case FxParticleSystems::PRT_WHEELDIRT:
fxParticleSystem = m_pInterface->m_fxSysWheelDirt;
break;
case eFxParticleSystems::PRT_GLASS:
case FxParticleSystems::PRT_GLASS:
fxParticleSystem = m_pInterface->m_fxSysGlass;
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CFxSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class CFxSA : public CFx
void TriggerWaterSplash(CVector& vecPosition);
void TriggerBulletSplash(CVector& vecPosition);
void TriggerFootSplash(CVector& vecPosition);
void AddParticle(eFxParticleSystems eFxParticle, const CVector& vecPosition, const CVector& vecDirection, float fR, float fG, float fB, float fA, bool bRandomizeColors, std::uint32_t iCount, float fBrightness, float fSize, bool bRandomizeSizes, float fLife);
void AddParticle(FxParticleSystems eFxParticle, const CVector& vecPosition, const CVector& vecDirection, float fR, float fG, float fB, float fA, bool bRandomizeColors, std::uint32_t iCount, float fBrightness, float fSize, bool bRandomizeSizes, float fLife);

private:
CFxSAInterface* m_pInterface;
Expand Down
12 changes: 6 additions & 6 deletions Client/game_sa/CGameSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ CModelInfo* CGameSA::GetModelInfo(DWORD dwModelID, bool bCanBeInvalid)
*/
void CGameSA::StartGame()
{
SetSystemState(GS_INIT_PLAYING_GAME);
SetSystemState(SystemState::GS_INIT_PLAYING_GAME);
MemPutFast<BYTE>(0xB7CB49, 0); // CTimer::m_UserPause
MemPutFast<BYTE>(0xBA67A4, 0); // FrontEndMenuManager + 0x5C
}
Expand All @@ -383,14 +383,14 @@ void CGameSA::StartGame()
* Sets the part of the game loading process the game is in.
* @param dwState DWORD containing a valid state 0 - 9
*/
void CGameSA::SetSystemState(eSystemState State)
void CGameSA::SetSystemState(SystemState State)
{
MemPutFast<DWORD>(0xC8D4C0, State); // gGameState
MemPutFast<DWORD>(0xC8D4C0, (DWORD)State); // gGameState
}

eSystemState CGameSA::GetSystemState()
SystemState CGameSA::GetSystemState()
{
return *(eSystemState*)0xC8D4C0; // gGameState
return *(SystemState*)0xC8D4C0; // gGameState
}

/**
Expand Down Expand Up @@ -440,7 +440,7 @@ void CGameSA::SetGameSpeed(float fSpeed)
void CGameSA::Reset()
{
// Things to do if the game was loaded
if (GetSystemState() == GS_PLAYING_GAME)
if (GetSystemState() == SystemState::GS_PLAYING_GAME)
{
// Extinguish all fires
m_pFireManager->ExtinguishAllFires();
Expand Down
4 changes: 2 additions & 2 deletions Client/game_sa/CGameSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ class CGameSA : public CGame
bool IsAtMenu() { return *(unsigned long*)0xBA677B != 0; } // FrontEndMenuManager + 0x33

void StartGame();
void SetSystemState(eSystemState State);
eSystemState GetSystemState();
void SetSystemState(SystemState State);
SystemState GetSystemState();
void Pause(bool bPaused);

void Initialize();
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CHandlingEntrySA.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class CHandlingEntrySA : public CHandlingEntry
eLightType GetTailLight() const noexcept { return static_cast<eLightType>(m_Handling.ucTailLight); }
unsigned char GetAnimGroup() const noexcept { return m_Handling.ucAnimGroup; }

eHandlingTypes GetVehicleID() const noexcept { return static_cast<eHandlingTypes>(m_Handling.iVehicleID); }
HandlingType GetVehicleID() const noexcept { return static_cast<HandlingType>(m_Handling.iVehicleID); }

// Set functions
void SetMass(float fMass) noexcept { m_Handling.fMass = fMass; }
Expand Down
Loading
Loading