Skip to content

Commit 7302aaa

Browse files
Synchronize changes from 1.6 master branch [ci skip]
1e21c53 Revert "Make engineRestreamWorld more aggressive (#3602)" (#3605)
2 parents a32a2dd + 1e21c53 commit 7302aaa

File tree

7 files changed

+7
-22
lines changed

7 files changed

+7
-22
lines changed

Client/game_sa/CGameSA.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,21 +1053,6 @@ bool CGameSA::SetBuildingPoolSize(size_t size)
10531053
return status;
10541054
}
10551055

1056-
void CGameSA::UnloadUnusedModels()
1057-
{
1058-
for (size_t id = 0; id < GetBaseIDforCOL(); id++)
1059-
{
1060-
CStreamingInfo* streamingInfo = m_pStreaming->GetStreamingInfo(id);
1061-
if (streamingInfo->loadState != 0 && streamingInfo->sizeInBlocks > 0)
1062-
{
1063-
if (ModelInfo[id].GetRefCount() == 0)
1064-
{
1065-
m_pStreaming->RemoveModel(id);
1066-
}
1067-
};
1068-
}
1069-
}
1070-
10711056
// Ensure models have the default lod distances
10721057
void CGameSA::ResetModelLodDistances()
10731058
{

Client/game_sa/CGameSA.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,6 @@ class CGameSA : public CGame
308308

309309
bool SetBuildingPoolSize(size_t size);
310310

311-
void UnloadUnusedModels();
312-
313311
private:
314312
CPools* m_pPools;
315313
CPlayerInfo* m_pPlayerInfo;

Client/game_sa/CModelInfoSA.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,11 @@ void CModelInfoSA::ModelAddRef(EModelRequestType requestType, const char* szTag)
10671067
m_dwReferences++;
10681068
}
10691069

1070+
int CModelInfoSA::GetRefCount()
1071+
{
1072+
return static_cast<int>(m_dwReferences);
1073+
}
1074+
10701075
void CModelInfoSA::RemoveRef(bool bRemoveExtraGTARef)
10711076
{
10721077
// Decrement the references

Client/game_sa/CModelInfoSA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ class CModelInfoSA : public CModelInfo
396396
static void StaticResetAlphaTransparencies();
397397

398398
void ModelAddRef(EModelRequestType requestType, const char* szTag);
399-
int GetRefCount() const override { return static_cast<int>(m_dwReferences); };
399+
int GetRefCount();
400400
void RemoveRef(bool bRemoveExtraGTARef = false);
401401
bool ForceUnload();
402402

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6829,8 +6829,6 @@ void CClientGame::RestreamWorld(bool removeBigBuildings)
68296829
g_pGame->GetStreaming()->RemoveBigBuildings();
68306830

68316831
g_pGame->GetStreaming()->ReinitStreaming();
6832-
6833-
g_pGame->UnloadUnusedModels();
68346832
}
68356833

68366834
void CClientGame::ReinitMarkers()

Client/sdk/game/CGame.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,5 +273,4 @@ class __declspec(novtable) CGame
273273

274274
virtual bool SetBuildingPoolSize(size_t size) = 0;
275275

276-
virtual void UnloadUnusedModels() = 0;
277276
};

Client/sdk/game/CModelInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class CModelInfo
177177

178178
virtual void ModelAddRef(EModelRequestType requestType, const char* szTag /* = NULL*/) = 0;
179179
virtual void RemoveRef(bool bRemoveExtraGTARef = false) = 0;
180-
virtual int GetRefCount() const = 0;
180+
virtual int GetRefCount() = 0;
181181
virtual bool ForceUnload() = 0;
182182
virtual void DeallocateModel() = 0;
183183

0 commit comments

Comments
 (0)