Skip to content

Commit 96e3825

Browse files
authored
Merge branch 'master' into 061024_onClientBrowserConsoleMessage
2 parents 10ff47b + c0376c9 commit 96e3825

File tree

109 files changed

+2014
-1470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2014
-1470
lines changed

Client/cefweb/CWebView.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -936,10 +936,10 @@ void CWebView::OnBeforeClose(CefRefPtr<CefBrowser> browser)
936936
// //
937937
// //
938938
////////////////////////////////////////////////////////////////////
939-
bool CWebView::OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& target_url, const CefString& target_frame_name,
940-
CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture, const CefPopupFeatures& popupFeatures,
941-
CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings, CefRefPtr<CefDictionaryValue>& extra_info,
942-
bool* no_javascript_access)
939+
bool CWebView::OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int popup_id, const CefString& target_url,
940+
const CefString& target_frame_name, CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture,
941+
const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings,
942+
CefRefPtr<CefDictionaryValue>& extra_info, bool* no_javascript_access)
943943
{
944944
// ATTENTION: This method is called on the IO thread
945945

Client/cefweb/CWebView.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ class CWebView : public CWebViewInterface,
152152

153153
// CefLifeSpawnHandler methods
154154
virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) override;
155-
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& target_url, const CefString& target_frame_name,
156-
CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture, const CefPopupFeatures& popupFeatures,
157-
CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings, CefRefPtr<CefDictionaryValue>& extra_info,
158-
bool* no_javascript_access) override;
155+
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int popup_id, const CefString& target_url,
156+
const CefString& target_frame_name, CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture,
157+
const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings,
158+
CefRefPtr<CefDictionaryValue>& extra_info, bool* no_javascript_access) override;
159159
virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser) override;
160160

161161
// CefJSDialogHandler methods

Client/core/CConsole.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class CConsole : public CConsoleInterface
4141
bool IsInputActive();
4242
void ActivateInput();
4343

44-
void HandleTextAccepted(bool bHandled);
4544
void GetCommandInfo(const std::string& strIn, std::string& strCmdOut, std::string& strCmdLineOut);
4645

4746
void ResetHistoryChanges();

Client/core/CQueryReceiver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ SQueryInfo CQueryReceiver::GetServerResponse()
183183

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

188188
// Recover server http port if present
189189
const SString strNetRoute = strPingStatus.Right(strPingStatus.length() - strlen(strPingStatus) - 1);

Client/game_sa/CBuildingsPoolSA.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ CBuilding* CBuildingsPoolSA::AddBuilding(CClientBuilding* pClientBuilding, uint1
5353
if (!HasFreeBuildingSlot())
5454
return nullptr;
5555

56+
auto modelInfo = pGame->GetModelInfo(modelId);
57+
58+
// Change the properties group to force dynamic models to be created as buildings instead of dummies
59+
auto prevGroup = modelInfo->GetObjectPropertiesGroup();
60+
if (prevGroup != MODEL_PROPERTIES_GROUP_STATIC)
61+
modelInfo->SetObjectPropertiesGroup(MODEL_PROPERTIES_GROUP_STATIC);
62+
5663
// Load building
5764
SFileObjectInstance instance;
5865
instance.modelID = modelId;
@@ -70,9 +77,12 @@ CBuilding* CBuildingsPoolSA::AddBuilding(CClientBuilding* pClientBuilding, uint1
7077
pBuilding->m_pLod = nullptr;
7178
pBuilding->m_iplIndex = 0;
7279

80+
// Restore changed properties group
81+
if (prevGroup != MODEL_PROPERTIES_GROUP_STATIC)
82+
modelInfo->SetObjectPropertiesGroup(prevGroup);
83+
7384
// Always stream model collosion
7485
// TODO We can setup collison bounding box and use GTA streamer for it
75-
auto modelInfo = pGame->GetModelInfo(modelId);
7686
modelInfo->AddColRef();
7787

7888
// Add building in world

Client/game_sa/CEntitySA.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ bool CEntitySA::GetBonePosition(eBone boneId, CVector& position)
679679
return false;
680680

681681
const RwV3d& pos = rwBoneMatrix->pos;
682-
position = {pos.x, pos.y, pos.z};
682+
position = CVector(pos.x, pos.y, pos.z);
683683
return true;
684684
}
685685

Client/game_sa/CGameSA.cpp

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ CGameSA::CGameSA()
104104
m_pAESoundManager = new CAESoundManagerSA((CAESoundManagerSAInterface*)CLASS_CAESoundManager);
105105
m_pAudioContainer = new CAudioContainerSA();
106106
m_pWorld = new CWorldSA();
107-
m_pPools = new CPoolsSA();
107+
m_Pools = std::make_unique<CPoolsSA>();
108108
m_pClock = new CClockSA();
109109
m_pRadar = new CRadarSA();
110110
m_pCamera = new CCameraSA((CCameraSAInterface*)CLASS_CCamera);
@@ -125,7 +125,7 @@ CGameSA::CGameSA()
125125
m_pControllerConfigManager = new CControllerConfigManagerSA();
126126
m_pProjectileInfo = new CProjectileInfoSA();
127127
m_pRenderWare = new CRenderWareSA();
128-
m_pHandlingManager = new CHandlingManagerSA();
128+
m_HandlingManager = std::make_unique<CHandlingManagerSA>();
129129
m_pEventList = new CEventListSA();
130130
m_pGarages = new CGaragesSA((CGaragesSAInterface*)CLASS_CGarages);
131131
m_pTasks = new CTasksSA((CTaskManagementSystemSA*)m_pTaskManagementSystem);
@@ -208,17 +208,17 @@ CGameSA::CGameSA()
208208
m_Cheats[CHEAT_HEALTARMORMONEY] = new SCheatSA((BYTE*)VAR_HealthArmorMoney, false);
209209

210210
// Change pool sizes here
211-
m_pPools->SetPoolCapacity(TASK_POOL, 5000); // Default is 500
212-
m_pPools->SetPoolCapacity(OBJECT_POOL, MAX_OBJECTS); // Default is 350
213-
m_pPools->SetPoolCapacity(EVENT_POOL, 5000); // Default is 200
214-
m_pPools->SetPoolCapacity(COL_MODEL_POOL, 12000); // Default is 10150
215-
m_pPools->SetPoolCapacity(ENV_MAP_MATERIAL_POOL, 16000); // Default is 4096
216-
m_pPools->SetPoolCapacity(ENV_MAP_ATOMIC_POOL, 4000); // Default is 1024
217-
m_pPools->SetPoolCapacity(SPEC_MAP_MATERIAL_POOL, 16000); // Default is 4096
218-
m_pPools->SetPoolCapacity(ENTRY_INFO_NODE_POOL, MAX_ENTRY_INFO_NODES); // Default is 500
219-
m_pPools->SetPoolCapacity(POINTER_SINGLE_LINK_POOL, MAX_POINTER_SINGLE_LINKS); // Default is 70000
220-
m_pPools->SetPoolCapacity(POINTER_DOUBLE_LINK_POOL, MAX_POINTER_DOUBLE_LINKS); // Default is 3200
221-
dassert(m_pPools->GetPoolCapacity(POINTER_SINGLE_LINK_POOL) == MAX_POINTER_SINGLE_LINKS);
211+
m_Pools->SetPoolCapacity(TASK_POOL, 5000); // Default is 500
212+
m_Pools->SetPoolCapacity(OBJECT_POOL, MAX_OBJECTS); // Default is 350
213+
m_Pools->SetPoolCapacity(EVENT_POOL, 5000); // Default is 200
214+
m_Pools->SetPoolCapacity(COL_MODEL_POOL, 12000); // Default is 10150
215+
m_Pools->SetPoolCapacity(ENV_MAP_MATERIAL_POOL, 16000); // Default is 4096
216+
m_Pools->SetPoolCapacity(ENV_MAP_ATOMIC_POOL, 4000); // Default is 1024
217+
m_Pools->SetPoolCapacity(SPEC_MAP_MATERIAL_POOL, 16000); // Default is 4096
218+
m_Pools->SetPoolCapacity(ENTRY_INFO_NODE_POOL, MAX_ENTRY_INFO_NODES); // Default is 500
219+
m_Pools->SetPoolCapacity(POINTER_SINGLE_LINK_POOL, MAX_POINTER_SINGLE_LINKS); // Default is 70000
220+
m_Pools->SetPoolCapacity(POINTER_DOUBLE_LINK_POOL, MAX_POINTER_DOUBLE_LINKS); // Default is 3200
221+
dassert(m_Pools->GetPoolCapacity(POINTER_SINGLE_LINK_POOL) == MAX_POINTER_SINGLE_LINKS);
222222

223223
// Increase streaming object instances list size
224224
MemPut<WORD>(0x05B8E55, MAX_RWOBJECT_INSTANCES * 12); // Default is 1000 * 12
@@ -261,7 +261,6 @@ CGameSA::~CGameSA()
261261
delete reinterpret_cast<CAnimManagerSA*>(m_pAnimManager);
262262
delete reinterpret_cast<CTasksSA*>(m_pTasks);
263263
delete reinterpret_cast<CTaskManagementSystemSA*>(m_pTaskManagementSystem);
264-
delete reinterpret_cast<CHandlingManagerSA*>(m_pHandlingManager);
265264
delete reinterpret_cast<CStatsSA*>(m_pStats);
266265
delete reinterpret_cast<CWeatherSA*>(m_pWeather);
267266
delete reinterpret_cast<CAERadioTrackManagerSA*>(m_pCAERadioTrackManager);
@@ -276,7 +275,6 @@ CGameSA::~CGameSA()
276275
delete reinterpret_cast<CCameraSA*>(m_pCamera);
277276
delete reinterpret_cast<CRadarSA*>(m_pRadar);
278277
delete reinterpret_cast<CClockSA*>(m_pClock);
279-
delete reinterpret_cast<CPoolsSA*>(m_pPools);
280278
delete reinterpret_cast<CWorldSA*>(m_pWorld);
281279
delete reinterpret_cast<CAudioEngineSA*>(m_pAudioEngine);
282280
delete reinterpret_cast<CAEAudioHardwareSA*>(m_pAEAudioHardware);
@@ -848,6 +846,34 @@ void CGameSA::SetRoadSignsTextEnabled(bool isEnabled)
848846
m_isRoadSignsTextEnabled = isEnabled;
849847
}
850848

849+
void CGameSA::SetIgnoreFireStateEnabled(bool isEnabled)
850+
{
851+
if (isEnabled == m_isIgnoreFireStateEnabled)
852+
return;
853+
854+
if (isEnabled)
855+
{
856+
MemSet((void*)0x6511B9, 0x90, 10); // CCarEnterExit::IsVehicleStealable
857+
MemSet((void*)0x643A95, 0x90, 14); // CTaskComplexEnterCar::CreateFirstSubTask
858+
MemSet((void*)0x6900B5, 0x90, 14); // CTaskComplexCopInCar::ControlSubTask
859+
MemSet((void*)0x64F3DB, 0x90, 14); // CCarEnterExit::IsPlayerToQuitCarEnter
860+
861+
MemSet((void*)0x685A7F, 0x90, 14); // CTaskSimplePlayerOnFoot::ProcessPlayerWeapon
862+
}
863+
else
864+
{
865+
// Restore original bytes
866+
MemCpy((void*)0x6511B9, "\x88\x86\x90\x04\x00\x00\x85\xC0\x75\x3E", 10);
867+
MemCpy((void*)0x643A95, "\x8B\x88\x90\x04\x00\x00\x85\xC9\x0F\x85\x99\x01\x00\x00", 14);
868+
MemCpy((void*)0x6900B5, "\x8B\x81\x90\x04\x00\x00\x85\xC0\x0F\x85\x1A\x01\x00\x00", 14);
869+
MemCpy((void*)0x64F3DB, "\x8B\x85\x90\x04\x00\x00\x85\xC0\x0F\x85\x1B\x01\x00\x00", 14);
870+
871+
MemCpy((void*)0x685A7F, "\x8B\x86\x30\x07\x00\x00\x85\xC0\x0F\x85\x1D\x01\x00\x00", 14);
872+
}
873+
874+
m_isIgnoreFireStateEnabled = isEnabled;
875+
}
876+
851877
bool CGameSA::PerformChecks()
852878
{
853879
std::map<std::string, SCheatSA*>::iterator it;
@@ -1011,8 +1037,8 @@ void CGameSA::RemoveAllBuildings()
10111037
{
10121038
m_pIplStore->SetDynamicIplStreamingEnabled(false);
10131039

1014-
m_pPools->GetDummyPool().RemoveAllBuildingLods();
1015-
m_pPools->GetBuildingsPool().RemoveAllBuildings();
1040+
m_Pools->GetDummyPool().RemoveAllBuildingLods();
1041+
m_Pools->GetBuildingsPool().RemoveAllBuildings();
10161042

10171043
auto pBuildingRemoval = static_cast<CBuildingRemovalSA*>(m_pBuildingRemoval);
10181044
pBuildingRemoval->DropCaches();
@@ -1022,8 +1048,8 @@ void CGameSA::RemoveAllBuildings()
10221048

10231049
void CGameSA::RestoreGameBuildings()
10241050
{
1025-
m_pPools->GetBuildingsPool().RestoreAllBuildings();
1026-
m_pPools->GetDummyPool().RestoreAllBuildingsLods();
1051+
m_Pools->GetBuildingsPool().RestoreAllBuildings();
1052+
m_Pools->GetDummyPool().RestoreAllBuildingsLods();
10271053

10281054
m_pIplStore->SetDynamicIplStreamingEnabled(true, [](CIplSAInterface* ipl) { return memcmp("barriers", ipl->name, 8) != 0; });
10291055
m_isBuildingsRemoved = false;
@@ -1041,7 +1067,7 @@ bool CGameSA::SetBuildingPoolSize(size_t size)
10411067
static_cast<CBuildingRemovalSA*>(m_pBuildingRemoval)->DropCaches();
10421068
}
10431069

1044-
bool status = m_pPools->GetBuildingsPool().Resize(size);
1070+
bool status = m_Pools->GetBuildingsPool().Resize(size);
10451071

10461072
if (shouldRemoveBuilding)
10471073
{

Client/game_sa/CGameSA.h

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class CGameSA : public CGame
125125
CGameSA();
126126
~CGameSA();
127127

128-
CPools* GetPools() { return m_pPools; }
128+
CPools* GetPools() const noexcept { return m_Pools.get(); }
129129
CPlayerInfo* GetPlayerInfo() { return m_pPlayerInfo; }
130130
CProjectileInfo* GetProjectileInfo() { return m_pProjectileInfo; }
131131
CRadar* GetRadar() { return m_pRadar; }
@@ -155,7 +155,7 @@ class CGameSA : public CGame
155155
CCarEnterExit* GetCarEnterExit() { return m_pCarEnterExit; }
156156
CControllerConfigManager* GetControllerConfigManager() { return m_pControllerConfigManager; }
157157
CRenderWare* GetRenderWare() { return m_pRenderWare; }
158-
CHandlingManager* GetHandlingManager() { return m_pHandlingManager; }
158+
CHandlingManager* GetHandlingManager() const noexcept { return m_HandlingManager.get(); }
159159
CAnimManager* GetAnimManager() { return m_pAnimManager; }
160160
CStreaming* GetStreaming() { return m_pStreaming; }
161161
CVisibilityPlugins* GetVisibilityPlugins() { return m_pVisibilityPlugins; }
@@ -249,6 +249,8 @@ class CGameSA : public CGame
249249
bool IsTunnelWeatherBlendEnabled() const noexcept override { return m_isTunnelWeatherBlendEnabled; }
250250
void SetTunnelWeatherBlendEnabled(bool isEnabled) override;
251251

252+
bool IsIgnoreFireStateEnabled() const noexcept override { return m_isIgnoreFireStateEnabled; }
253+
void SetIgnoreFireStateEnabled(bool isEnabled) override;
252254

253255
unsigned long GetMinuteDuration();
254256
void SetMinuteDuration(unsigned long ulTime);
@@ -311,42 +313,42 @@ class CGameSA : public CGame
311313
bool SetBuildingPoolSize(size_t size);
312314

313315
private:
314-
CPools* m_pPools;
315-
CPlayerInfo* m_pPlayerInfo;
316-
CProjectileInfo* m_pProjectileInfo;
317-
CRadar* m_pRadar;
318-
CClock* m_pClock;
319-
CCoronas* m_pCoronas;
320-
CCheckpoints* m_pCheckpoints;
321-
CEventList* m_pEventList;
322-
CFireManager* m_pFireManager;
323-
CGarages* m_pGarages;
324-
CHud* m_pHud;
325-
CWeather* m_pWeather;
326-
CWorld* m_pWorld;
327-
CCamera* m_pCamera;
328-
CModelInfo* m_pModelInfo;
329-
CPickups* m_pPickups;
330-
CWeaponInfo* m_pWeaponInfo;
331-
CExplosionManager* m_pExplosionManager;
332-
C3DMarkers* m_p3DMarkers;
333-
CRenderWareSA* m_pRenderWare;
334-
CHandlingManager* m_pHandlingManager;
335-
CAnimManager* m_pAnimManager;
336-
CStreaming* m_pStreaming;
337-
CVisibilityPlugins* m_pVisibilityPlugins;
338-
CKeyGen* m_pKeyGen;
339-
CRopes* m_pRopes;
340-
CFx* m_pFx;
341-
CFxManagerSA* m_pFxManager;
342-
CWaterManager* m_pWaterManager;
343-
CWeaponStatManager* m_pWeaponStatsManager;
344-
CPointLights* m_pPointLights;
345-
CColStore* m_collisionStore;
346-
CObjectGroupPhysicalProperties* m_pObjectGroupPhysicalProperties;
347-
CCoverManagerSA* m_pCoverManager;
348-
CPlantManagerSA* m_pPlantManager;
349-
CBuildingRemoval* m_pBuildingRemoval;
316+
std::unique_ptr<CPools> m_Pools;
317+
CPlayerInfo* m_pPlayerInfo;
318+
CProjectileInfo* m_pProjectileInfo;
319+
CRadar* m_pRadar;
320+
CClock* m_pClock;
321+
CCoronas* m_pCoronas;
322+
CCheckpoints* m_pCheckpoints;
323+
CEventList* m_pEventList;
324+
CFireManager* m_pFireManager;
325+
CGarages* m_pGarages;
326+
CHud* m_pHud;
327+
CWeather* m_pWeather;
328+
CWorld* m_pWorld;
329+
CCamera* m_pCamera;
330+
CModelInfo* m_pModelInfo;
331+
CPickups* m_pPickups;
332+
CWeaponInfo* m_pWeaponInfo;
333+
CExplosionManager* m_pExplosionManager;
334+
C3DMarkers* m_p3DMarkers;
335+
CRenderWareSA* m_pRenderWare;
336+
std::unique_ptr<CHandlingManager> m_HandlingManager;
337+
CAnimManager* m_pAnimManager;
338+
CStreaming* m_pStreaming;
339+
CVisibilityPlugins* m_pVisibilityPlugins;
340+
CKeyGen* m_pKeyGen;
341+
CRopes* m_pRopes;
342+
CFx* m_pFx;
343+
CFxManagerSA* m_pFxManager;
344+
CWaterManager* m_pWaterManager;
345+
CWeaponStatManager* m_pWeaponStatsManager;
346+
CPointLights* m_pPointLights;
347+
CColStore* m_collisionStore;
348+
CObjectGroupPhysicalProperties* m_pObjectGroupPhysicalProperties;
349+
CCoverManagerSA* m_pCoverManager;
350+
CPlantManagerSA* m_pPlantManager;
351+
CBuildingRemoval* m_pBuildingRemoval;
350352

351353
std::unique_ptr<CRendererSA> m_pRenderer;
352354

@@ -378,6 +380,7 @@ class CGameSA : public CGame
378380
bool m_isRoadSignsTextEnabled{true};
379381
bool m_isBuildingsRemoved{false};
380382
bool m_isExtendedWaterCannonsEnabled{false};
383+
bool m_isIgnoreFireStateEnabled{false};
381384

382385
static unsigned int& ClumpOffset;
383386

0 commit comments

Comments
 (0)