mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 22:18:19 +00:00
Remove unused SnapInvalidateItem
suggested by @Robyt3 <3
This commit is contained in:
parent
31b0c0a6cd
commit
b2285855f5
|
@ -222,7 +222,6 @@ public:
|
||||||
virtual void *SnapFindItem(int SnapID, int Type, int ID) const = 0;
|
virtual void *SnapFindItem(int SnapID, int Type, int ID) const = 0;
|
||||||
virtual void *SnapGetItem(int SnapID, int Index, CSnapItem *pItem) const = 0;
|
virtual void *SnapGetItem(int SnapID, int Index, CSnapItem *pItem) const = 0;
|
||||||
virtual int SnapItemSize(int SnapID, int Index) const = 0;
|
virtual int SnapItemSize(int SnapID, int Index) const = 0;
|
||||||
virtual void SnapInvalidateItem(int SnapID, int Index) = 0;
|
|
||||||
|
|
||||||
virtual void SnapSetStaticsize(int ItemType, int Size) = 0;
|
virtual void SnapSetStaticsize(int ItemType, int Size) = 0;
|
||||||
|
|
||||||
|
|
|
@ -995,20 +995,6 @@ int CClient::SnapItemSize(int SnapID, int Index) const
|
||||||
return m_aapSnapshots[g_Config.m_ClDummy][SnapID]->m_pAltSnap->GetItemSize(Index);
|
return m_aapSnapshots[g_Config.m_ClDummy][SnapID]->m_pAltSnap->GetItemSize(Index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::SnapInvalidateItem(int SnapID, int Index)
|
|
||||||
{
|
|
||||||
dbg_assert(SnapID >= 0 && SnapID < NUM_SNAPSHOT_TYPES, "invalid SnapID");
|
|
||||||
CSnapshotItem *pSnapshotItem = m_aapSnapshots[g_Config.m_ClDummy][SnapID]->m_pAltSnap->GetItem(Index);
|
|
||||||
if(pSnapshotItem)
|
|
||||||
{
|
|
||||||
if((char *)pSnapshotItem < (char *)m_aapSnapshots[g_Config.m_ClDummy][SnapID]->m_pAltSnap || (char *)pSnapshotItem > (char *)m_aapSnapshots[g_Config.m_ClDummy][SnapID]->m_pAltSnap + m_aapSnapshots[g_Config.m_ClDummy][SnapID]->m_AltSnapSize)
|
|
||||||
m_pConsole->Print(IConsole::OUTPUT_LEVEL_DEBUG, "client", "snap invalidate problem");
|
|
||||||
if((char *)pSnapshotItem >= (char *)m_aapSnapshots[g_Config.m_ClDummy][SnapID]->m_pSnap && (char *)pSnapshotItem < (char *)m_aapSnapshots[g_Config.m_ClDummy][SnapID]->m_pSnap + m_aapSnapshots[g_Config.m_ClDummy][SnapID]->m_SnapSize)
|
|
||||||
m_pConsole->Print(IConsole::OUTPUT_LEVEL_DEBUG, "client", "snap invalidate problem");
|
|
||||||
pSnapshotItem->m_TypeAndID = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void *CClient::SnapFindItem(int SnapID, int Type, int ID) const
|
void *CClient::SnapFindItem(int SnapID, int Type, int ID) const
|
||||||
{
|
{
|
||||||
if(!m_aapSnapshots[g_Config.m_ClDummy][SnapID])
|
if(!m_aapSnapshots[g_Config.m_ClDummy][SnapID])
|
||||||
|
|
|
@ -376,7 +376,6 @@ public:
|
||||||
int GetPredictionTime() override;
|
int GetPredictionTime() override;
|
||||||
void *SnapGetItem(int SnapID, int Index, CSnapItem *pItem) const override;
|
void *SnapGetItem(int SnapID, int Index, CSnapItem *pItem) const override;
|
||||||
int SnapItemSize(int SnapID, int Index) const override;
|
int SnapItemSize(int SnapID, int Index) const override;
|
||||||
void SnapInvalidateItem(int SnapID, int Index) override;
|
|
||||||
void *SnapFindItem(int SnapID, int Type, int ID) const override;
|
void *SnapFindItem(int SnapID, int Type, int ID) const override;
|
||||||
int SnapNumItems(int SnapID) const override;
|
int SnapNumItems(int SnapID) const override;
|
||||||
void SnapSetStaticsize(int ItemType, int Size) override;
|
void SnapSetStaticsize(int ItemType, int Size) override;
|
||||||
|
|
|
@ -24,7 +24,7 @@ Items can be added when <mods_snap> is called using the <snap_new_item> function
|
||||||
Section: Client Side
|
Section: Client Side
|
||||||
|
|
||||||
Topic: Inspection
|
Topic: Inspection
|
||||||
<modc_newsnapshot> is called when a new snapshot has arrived for processing. <snap_num_items>, <snap_get_item> and <snap_find_item> can be used to inspect the current and previous snapshot. This can be done anywhere while the client is running and not just in the <modc_newsnapshot> function. The client can also call <snap_invalidate_item> if an item contains improper information that could harm the operation of the client. This should however be done in <modc_newsnapshot> to assure that no bad data propagates into the rest of the client.
|
<modc_newsnapshot> is called when a new snapshot has arrived for processing. <snap_num_items>, <snap_get_item> and <snap_find_item> can be used to inspect the current and previous snapshot. This can be done anywhere while the client is running and not just in the <modc_newsnapshot> function.
|
||||||
|
|
||||||
Topic: Rendering
|
Topic: Rendering
|
||||||
DOCTODO
|
DOCTODO
|
||||||
|
|
Loading…
Reference in a new issue