Skip to content

Commit

Permalink
Merge pull request ddnet#9424 from Robyt3/Client-Tuning-Graph-Fix
Browse files Browse the repository at this point in the history
Fix tuning velramp graphs not being updated when tuning changed
  • Loading branch information
def- authored Dec 26, 2024
2 parents f5bebc6 + 3131283 commit 9a157e8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/engine/client/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ CGraph::CGraph(int MaxEntries) :

void CGraph::Init(float Min, float Max)
{
m_Entries.Clear();
m_pFirstScaled = nullptr;
m_RenderedTotalTime = 0;
SetMin(Min);
SetMax(Max);
}
Expand Down
12 changes: 9 additions & 3 deletions src/engine/shared/ringbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,22 @@ CRingBufferBase::CItem *CRingBufferBase::MergeBack(CItem *pItem)

void CRingBufferBase::Init(void *pMemory, int Size, int Flags)
{
m_Size = (Size) / sizeof(CItem) * sizeof(CItem);
m_pFirst = (CItem *)pMemory;
m_Size = Size / sizeof(CItem) * sizeof(CItem);
m_pBuffer = static_cast<CItem *>(pMemory);
m_Flags = Flags;
Clear();
}

void CRingBufferBase::Clear()
{
m_pFirst = m_pBuffer;
m_pFirst->m_pPrev = nullptr;
m_pFirst->m_pNext = nullptr;
m_pFirst->m_Free = 1;
m_pFirst->m_Size = m_Size;
m_pLast = m_pFirst;
m_pProduce = m_pFirst;
m_pConsume = m_pFirst;
m_Flags = Flags;
}

void *CRingBufferBase::Allocate(int Size)
Expand Down
4 changes: 4 additions & 0 deletions src/engine/shared/ringbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class CRingBufferBase
int m_Size;
};

CItem *m_pBuffer;

CItem *m_pProduce;
CItem *m_pConsume;

Expand Down Expand Up @@ -52,6 +54,8 @@ class CRingBufferBase
FLAG_RECYCLE = 1
};
static constexpr int ITEM_SIZE = sizeof(CItem);

void Clear();
};

template<typename T>
Expand Down

0 comments on commit 9a157e8

Please sign in to comment.