Skip to content
Open
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
10 changes: 10 additions & 0 deletions Client/mods/deathmatch/logic/CClientGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,16 @@ CClientGame::~CClientGame()
// ...and restore the buffer size too
g_pGame->GetStreaming()->SetStreamingBufferSize(g_pClientGame->GetManager()->GetIMGManager()->GetLargestFileSizeBlocks());

// Reset streamer limits
g_pClientGame->GetManager()->GetObjectStreamer()->ResetStreamerLimits();
g_pClientGame->GetManager()->GetObjectStreamer()->ResetStreamerMaxSwaps();
g_pClientGame->GetManager()->GetObjectStreamer()->ResetStreamerFurthestInLimit();

// Reset streamer limits
CClientObjectManager* pObjectManager = g_pClientGame->GetObjectManager();
if (pObjectManager)
pObjectManager->ResetMaxObjectStreamCount();

// Reset camera shaking
g_pGame->GetCamera()->SetShakeForce(0.0f);

Expand Down
27 changes: 26 additions & 1 deletion Client/mods/deathmatch/logic/CClientObjectManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,12 @@ bool CClientObjectManager::StaticIsLowLodObjectLimitReached()

bool CClientObjectManager::IsObjectLimitReached()
{
if (IsHardObjectLimitReached() || m_uiStreamedInCount >= m_uiMaxStreamedInCount)
if (IsHardObjectLimitReached() || (m_uiCustomMaxStreamedInCount > 0 && m_uiStreamedInCount >= m_uiCustomMaxStreamedInCount) ||
m_uiStreamedInCount >= m_uiMaxStreamedInCount)
{
return true;
}

return false;
}

Expand Down Expand Up @@ -333,3 +337,24 @@ bool CClientObjectManager::Exists(CClientObject* pObject)
{
return ListContains(m_Objects, pObject);
}

void CClientObjectManager::SetMaxObjectStreamCount(int cValue)
{
if (cValue < m_uiMaxStreamedInCount)
throw std::invalid_argument("Custom limit must be greater than or equal to default limit");

m_uiCustomMaxStreamedInCount = cValue;
}

void CClientObjectManager::ResetMaxObjectStreamCount()
{
m_uiCustomMaxStreamedInCount = 0;
}

int CClientObjectManager::GetMaxObjectStreamCount()
{
if (m_uiCustomMaxStreamedInCount > 0)
return m_uiCustomMaxStreamedInCount;

return m_uiMaxStreamedInCount;
}
4 changes: 4 additions & 0 deletions Client/mods/deathmatch/logic/CClientObjectManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class CClientObjectManager
bool IsObjectLimitReached();
bool IsLowLodObjectLimitReached();
bool IsHardObjectLimitReached();
int GetMaxObjectStreamCount();
void SetMaxObjectStreamCount(int customCount);
void ResetMaxObjectStreamCount();

void RestreamObjects(unsigned short usModel);
void RestreamAllObjects();
Expand All @@ -58,6 +61,7 @@ class CClientObjectManager
int m_iEntryInfoNodeEntries;
int m_iPointerNodeDoubleLinkEntries;
uint m_uiMaxStreamedInCount;
uint m_uiCustomMaxStreamedInCount;
uint m_uiMaxLowLodStreamedInCount;
uint m_uiStreamedInCount;
uint m_uiLowLodStreamedInCount;
Expand Down
1 change: 1 addition & 0 deletions Client/mods/deathmatch/logic/CClientStreamSector.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class CClientStreamSector
void Remove(CClientStreamElement* pElement) { m_Elements.remove(pElement); }
std::list<CClientStreamElement*>::iterator Begin() { return m_Elements.begin(); }
std::list<CClientStreamElement*>::iterator End() { return m_Elements.end(); }
std::list<CClientStreamElement*>& GetElements() { return m_Elements; }

void AddElements(std::list<CClientStreamElement*>* pList);
void RemoveElements(std::list<CClientStreamElement*>* pList);
Expand Down
1 change: 1 addition & 0 deletions Client/mods/deathmatch/logic/CClientStreamSectorRow.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class CClientStreamSectorRow
std::list<CClientStreamSector*>::iterator Begin() { return m_Sectors.begin(); }
std::list<CClientStreamSector*>::iterator End() { return m_Sectors.end(); }
CClientStreamSector* Front() { return m_Sectors.front(); }
std::list<CClientStreamSector*>& GetList() { return m_Sectors; }
void Add(CClientStreamSector* pSector);
void Remove(CClientStreamSector* pSector);
unsigned int CountSectors() { return m_Sectors.size(); }
Expand Down
Loading