Skip to content

Commit

Permalink
Merge branch 'master' into add-vehicle-sirens
Browse files Browse the repository at this point in the history
  • Loading branch information
Proxy-99 authored Oct 12, 2024
2 parents bf5598d + 55d3922 commit 42617b9
Show file tree
Hide file tree
Showing 67 changed files with 2,658 additions and 2,133 deletions.
2 changes: 0 additions & 2 deletions Client/cefweb/CWebApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ CefRefPtr<CefResourceHandler> CWebApp::HandleError(const SString& strError, unsi

void CWebApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line)
{
command_line->AppendSwitch("disable-gpu-compositing");
command_line->AppendSwitch("disable-gpu");
// command_line->AppendSwitch("disable-d3d11");
command_line->AppendSwitch("enable-begin-frame-scheduling");

Expand Down
7 changes: 7 additions & 0 deletions Client/core/CCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,13 @@ void CCore::RecalculateFrameRateLimit(uint uiServerFrameRateLimit, bool bLogToCo
if ((m_uiFrameRateLimit == 0 || uiClientScriptRate < m_uiFrameRateLimit) && uiClientScriptRate > 0)
m_uiFrameRateLimit = uiClientScriptRate;

// Removes Limiter from Frame Graph if limit is zero and skips frame limit
if (m_uiFrameRateLimit == 0)
{
m_bQueuedFrameRateValid = false;
GetGraphStats()->RemoveTimingPoint("Limiter");
}

// Print new limits to the console
if (bLogToConsole)
{
Expand Down
16 changes: 16 additions & 0 deletions Client/core/CGraphStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class CGraphStats : public CGraphStatsInterface
virtual void SetEnabled(bool bEnabled);
virtual bool IsEnabled();
virtual void AddTimingPoint(const char* szName);
virtual void RemoveTimingPoint(const char* szName);

protected:
bool m_bEnabled;
Expand Down Expand Up @@ -189,6 +190,21 @@ void CGraphStats::AddTimingPoint(const char* szName)
pLine->dataHistory[pLine->iDataPos] = AvgData;
}

///////////////////////////////////////////////////////////////
//
// CGraphStats::RemoveTimingPoint
//
//
//
///////////////////////////////////////////////////////////////
void CGraphStats::RemoveTimingPoint(const char* szName)
{
if (!IsEnabled() || szName[0] == 0)
return;

MapRemove(m_LineList, szName);
}

///////////////////////////////////////////////////////////////
//
// CGraphStats::Draw
Expand Down
1 change: 1 addition & 0 deletions Client/core/CGraphStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class CGraphStatsInterface
virtual void SetEnabled(bool bEnabled) = 0;
virtual bool IsEnabled() = 0;
virtual void AddTimingPoint(const char* szName) = 0;
virtual void RemoveTimingPoint(const char* szName) = 0;
};

CGraphStatsInterface* GetGraphStats();
340 changes: 169 additions & 171 deletions Client/core/CNickGen.cpp

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion Client/core/CQueryReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ SQueryInfo CQueryReceiver::GetServerResponse()

// Recover server ping status if present
const SString strPingStatus = strBuildNumber.Right(strBuildNumber.length() - strlen(strBuildNumber) - 1);
CCore::GetSingleton().GetNetwork()->UpdatePingStatus(*strPingStatus, info.players);
CCore::GetSingleton().GetNetwork()->UpdatePingStatus(*strPingStatus, info.players, info.isStatusVerified);

// Recover server http port if present
const SString strNetRoute = strPingStatus.Right(strPingStatus.length() - strlen(strPingStatus) - 1);
Expand Down Expand Up @@ -213,7 +213,15 @@ SQueryInfo CQueryReceiver::GetServerResponse()
return info;
}
}

InvalidateSocket();

if (info.players > info.playerSlot)
{
info.players = info.playerSlot;
info.isStatusVerified = false;
}

info.containingInfo = true;
}

Expand Down
2 changes: 2 additions & 0 deletions Client/core/CQueryReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct SQueryInfo
{
containingInfo = false;
port = 0;
isStatusVerified = true;
isPassworded = false;
serials = false;
players = 0;
Expand All @@ -33,6 +34,7 @@ struct SQueryInfo
SString gameType;
SString mapName;
SString versionText;
bool isStatusVerified;
bool isPassworded;
bool serials;
ushort players;
Expand Down
2 changes: 1 addition & 1 deletion Client/core/CVersionUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ void CVersionUpdater::_DialogUpdateQueryError()
// Display message
GetQuestionBox().Reset();
GetQuestionBox().SetTitle(_("UPDATE CHECK"));
GetQuestionBox().SetMessage(_("Update not currently avalable.\n\nPlease check www.mtasa.com"));
GetQuestionBox().SetMessage(_("An update is currently not available.\n\nPlease check www.mtasa.com"));
GetQuestionBox().SetButton(0, _("OK"));
GetQuestionBox().Show();
_PollAnyButton();
Expand Down
9 changes: 8 additions & 1 deletion Client/core/ServerBrowser/CServerBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,8 @@ void CServerBrowser::AddServerToList(CServerListItem* pServer, const ServerBrows
const SString strVersion = !bIncludeOtherVersions ? "" : pServer->strVersion;
const SString strVersionSortKey = pServer->strVersionSortKey + pServer->strTieBreakSortKey;

const SString strPlayers = pServer->nMaxPlayers == 0 ? "" : SString("%d / %d", pServer->nPlayers, pServer->nMaxPlayers);
const SString strVerified = pServer->isStatusVerified ? "" : "*";
const SString strPlayers = pServer->nMaxPlayers == 0 ? "" : SString("%d / %d %s", pServer->nPlayers, pServer->nMaxPlayers, *strVerified);
const SString strPlayersSortKey = SString("%04d-", pServer->nMaxPlayers ? pServer->nPlayers + 1 : 0) + pServer->strTieBreakSortKey;

const SString strPing = pServer->nPing == 9999 ? "" : SString("%d", pServer->nPing);
Expand Down Expand Up @@ -1125,6 +1126,12 @@ void CServerBrowser::AddServerToList(CServerListItem* pServer, const ServerBrows
m_pServerList[Type]->SetItemColor(iIndex, m_hPing[Type], color.R, color.G, color.B, color.A);
m_pServerList[Type]->SetItemColor(iIndex, m_hGame[Type], color.R, color.G, color.B, color.A);

if (!pServer->isStatusVerified)
{
SColor orange = SColorRGBA(230, 200, 180, color.A);
m_pServerList[Type]->SetItemColor(iIndex, m_hPlayers[Type], orange.R, orange.G, orange.B, orange.A);
}

// If the index was modified from the original, then update all indexes because it means there was some sort
if (pServer->iRowIndex != iIndex)
UpdateRowIndexMembers(Type);
Expand Down
6 changes: 4 additions & 2 deletions Client/core/ServerBrowser/CServerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,15 @@ void CServerInfo::Connect()

void CServerInfo::ResetServerGUI(CServerListItem* pServer)
{
const SString strVerified = pServer->isStatusVerified ? "" : "*";

// Set our GUI elements to display the server information
m_pServerNameLabel->SetText(pServer->strName.c_str());
m_pServerAddressLabel->SetText(pServer->strEndpoint.c_str());
m_pGamemodeLabel->SetText(pServer->strGameMode.c_str());
m_pMapLabel->SetText(pServer->strMap.c_str());
m_pPlayersLabel->SetText(SString("%i/%i", pServer->nPlayers, pServer->nMaxPlayers).c_str());

m_pPlayersLabel->SetText(SString("%d / %d %s", pServer->nPlayers, pServer->nMaxPlayers, *strVerified).c_str());
m_pPasswordedLabel->SetText(pServer->bPassworded ? _("Yes") : _("No"));
m_pLatencyLabel->SetText(SString("%i", pServer->nPing));

Expand Down
1 change: 1 addition & 0 deletions Client/core/ServerBrowser/CServerList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ bool CServerListItem::ParseQuery()
if ((uiMasterServerSaysRestrictions & RESTRICTION_PLAYER_LIST) == false)
vecPlayers = info.playersPool;

isStatusVerified = info.isStatusVerified;
bScanned = true;

PostChange();
Expand Down
2 changes: 2 additions & 0 deletions Client/core/ServerBrowser/CServerList.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class CServerListItem
bScanned = false;
bSkipped = false;
bSerials = false;
isStatusVerified = true;
bPassworded = false;
bKeepFlag = false;
iRowIndex = -1;
Expand Down Expand Up @@ -182,6 +183,7 @@ class CServerListItem
unsigned short nPlayers; // Current players
unsigned short nMaxPlayers; // Maximum players
unsigned short nPing; // Ping time
bool isStatusVerified; // Ping status verified
bool bPassworded; // Password protected
bool bSerials; // Serial verification on
bool bScanned;
Expand Down
35 changes: 1 addition & 34 deletions Client/game_sa/CAutomobileSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,6 @@
#define MAX_PASSENGER_COUNT 8
#define MAX_DOORS 6 // also in CDamageManager

namespace eCarNode
{
enum
{
NONE = 0,
CHASSIS = 1,
WHEEL_RF = 2,
WHEEL_RM = 3,
WHEEL_RB = 4,
WHEEL_LF = 5,
WHEEL_LM = 6,
WHEEL_LB = 7,
DOOR_RF = 8,
DOOR_RR = 9,
DOOR_LF = 10,
DOOR_LR = 11,
BUMP_FRONT = 12,
BUMP_REAR = 13,
WING_RF = 14,
WING_LF = 15,
BONNET = 16,
BOOT = 17,
WINDSCREEN = 18,
EXHAUST = 19,
MISC_A = 20,
MISC_B = 21,
MISC_C = 22,
MISC_D = 23,
MISC_E = 24,
NUM_NODES
};
};

class CBouncingPanelSAInterface
{
public:
Expand All @@ -70,7 +37,7 @@ class CAutomobileSAInterface : public CVehicleSAInterface
public:
CDamageManagerSAInterface m_damageManager;
CDoorSAInterface m_doors[MAX_DOORS];
RwFrame* m_aCarNodes[eCarNode::NUM_NODES];
RwFrame* m_aCarNodes[static_cast<std::size_t>(eCarNodes::NUM_NODES)];
CBouncingPanelSAInterface m_panels[3];
CDoorSAInterface m_swingingChassis;
CColPointSAInterface m_wheelColPoint[MAX_WHEELS];
Expand Down
18 changes: 17 additions & 1 deletion Client/game_sa/CBikeSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@
#include <game/CBike.h>
#include "CVehicleSA.h"

enum class eBikeNodes
{
NONE = 0,
CHASSIS,
FORKS_FRONT,
FORKS_REAR,
WHEEL_FRONT,
WHEEL_REAR,
MUDGUARD,
HANDLEBARS,
MISC_A,
MISC_B,

NUM_NODES
};

struct sRideAnimData
{
int32 iAnimGroup;
Expand All @@ -29,7 +45,7 @@ static_assert(sizeof(sRideAnimData) == 0x1C, "Invalid size for sRideAnimData");
class CBikeSAInterface : public CVehicleSAInterface
{
public:
int32 m_apModelNodes[10];
RwFrame* m_apModelNodes[static_cast<std::size_t>(eBikeNodes::NUM_NODES)];
int8 m_bLeanMatrixCalculated;
int8 pad0[3]; // Maybe prev value is int32
int8 m_mLeanMatrix[72];
Expand Down
16 changes: 16 additions & 0 deletions Client/game_sa/CBmxSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@
#include <game/CBmx.h>
#include "CBikeSA.h"

enum class eBmxNodes
{
NONE = 0,
CHASSIS,
FORKS_FRONT,
FORKS_REAR,
WHEEL_FRONT,
WHEEL_REAR,
HANDLEBARS,
CHAINSET,
PEDAL_R,
PEDAL_L,

NUM_NODES
};

class CBmxSAInterface : public CBikeSAInterface
{
// fill this
Expand Down
20 changes: 19 additions & 1 deletion Client/game_sa/CBoatSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,30 @@
#include <game/CBoat.h>
#include "CVehicleSA.h"

enum class eBoatNodes
{
NONE = 0,
MOVING,
WINDSCREEN,
RUDDER,
FLAP_LEFT,
FLAP_RIGHT,
REARFLAP_LEFT,
REARFLAP_RIGHT,
STATIC_PROP,
MOVING_PROP,
STATIC_PROP2,
MOVING_PROP2,

NUM_NODES
};

class CBoatSAInterface : public CVehicleSAInterface
{
public:
uint32 pad1[3]; // 1440
uint32 BoatFlags; // 1452
RwFrame* pBoatParts[11]; // 1456 [[ find out correct size
RwFrame* pBoatParts[static_cast<std::size_t>(eBoatNodes::NUM_NODES)]; // 1456
uint32 pad2[3]; // 1500
uint16 pad3; // 1512
uint8 pad4[2]; // 1514
Expand Down
3 changes: 3 additions & 0 deletions Client/game_sa/CBuildingsPoolSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ void CBuildingsPoolSA::RemoveAllBuildings()

RemoveBuildingFromWorld(building);

if (building->HasMatrix())
building->RemoveMatrix();

pBuildsingsPool->Release(i);

(*m_pOriginalBuildingsBackup)[i].first = true;
Expand Down
5 changes: 5 additions & 0 deletions Client/game_sa/CCameraSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,3 +458,8 @@ void CCameraSA::ResetShakeCamera() noexcept
{
GetInterface()->m_fCamShakeForce = 0.0f;
}

std::uint8_t CCameraSA::GetTransitionState()
{
return GetInterface()->m_uiTransitionState;
}
13 changes: 3 additions & 10 deletions Client/game_sa/CCameraSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class CCameraSAInterface
public:
// CPlaceable
CPlaceableSAInterface Placeable;
std::uint8_t specialPadding[4]; // Temporary padding due to incorrect CPlaceableSAInterface class
// End CPlaceable

// move these out the class, have decided to set up a mirrored enumerated type thingy at the top
Expand Down Expand Up @@ -131,16 +132,6 @@ class CCameraSAInterface
bool m_bCooperativeCamMode;
bool m_bAllowShootingWith2PlayersInCar;
bool m_bDisableFirstPersonInCar;
static bool m_bUseMouse3rdPerson;
#ifndef FINALBUILD
bool bStaticFrustum;
#endif

// for debug keyboard stuff
#ifndef MASTER
unsigned char display_kbd_debug;
float kbd_fov_value;
#endif // MASTER

// The following fields allow the level designers to specify the camera for 2 player games.
short m_ModeForTwoPlayersSeparateCars;
Expand Down Expand Up @@ -430,4 +421,6 @@ class CCameraSA : public CCamera

void ShakeCamera(float radius, float x, float y, float z) noexcept override;
void ResetShakeCamera() noexcept override;

std::uint8_t GetTransitionState();
};
Loading

0 comments on commit 42617b9

Please sign in to comment.