Remove unused SnapInvalidateItem

suggested by @Robyt3 <3
This commit is contained in:
ChillerDragon 2022-10-09 12:56:55 +02:00
parent 31b0c0a6cd
commit b2285855f5
4 changed files with 1 additions and 17 deletions

View file

@ -222,7 +222,6 @@ public:
virtual void *SnapFindItem(int SnapID, int Type, int ID) const = 0;
virtual void *SnapGetItem(int SnapID, int Index, CSnapItem *pItem) 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;

View file

@ -995,20 +995,6 @@ int CClient::SnapItemSize(int SnapID, int Index) const
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
{
if(!m_aapSnapshots[g_Config.m_ClDummy][SnapID])

View file

@ -376,7 +376,6 @@ public:
int GetPredictionTime() override;
void *SnapGetItem(int SnapID, int Index, CSnapItem *pItem) 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;
int SnapNumItems(int SnapID) const override;
void SnapSetStaticsize(int ItemType, int Size) override;

View file

@ -24,7 +24,7 @@ Items can be added when <mods_snap> is called using the <snap_new_item> function
Section: Client Side
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
DOCTODO