Moved some tempmodels code to cg_tempmodels.cpp and implemented FreeSomeTempModels()

This commit is contained in:
smallmodel 2023-09-06 23:25:48 +02:00
parent 9a104566ba
commit dda79e7f27
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
4 changed files with 103 additions and 27 deletions

View file

@ -2706,8 +2706,7 @@ void ClientGameCommandManager::DeleteEmitters(dtiki_t *tiki)
for (i = m_emitters.NumObjects(); i > 0; i--) {
spawnthing = m_emitters.ObjectAt(i);
if (spawnthing->cgd.tiki == tiki) {
m_emitters.RemoveObjectAt(i);
delete spawnthing;
FreeSpawnthing(spawnthing);
}
}
}
@ -4538,28 +4537,6 @@ bool ClientGameCommandManager::GetTagPositionAndOrientation(str tagname, orienta
return ClientGameCommandManager::GetTagPositionAndOrientation(tagnum, new_or);
}
//===============
// FreeAllTempModels
//===============
void ClientGameCommandManager::FreeAllTempModels(void)
{
ctempmodel_t *p, *next;
// Go through all the temp models and run the physics if necessary,
// then add them to the ref
p = m_active_tempmodels.prev;
for (; p != &m_active_tempmodels; p = next) {
// grab next now, so if the local entity is freed we still have it
next = p->prev;
FreeTempModel(p);
}
}
void ClientGameCommandManager::FreeSomeTempModels(void)
{
// FIXME: unimplemented
}
//===============
// FreeAllEmitters
//===============
@ -4576,6 +4553,9 @@ void CG_RestartCommandManager()
commandManager.FreeAllTempModels();
}
//=================
// CG_CleanUpTempModels
//=================
void CG_CleanUpTempModels()
{
commandManager.FreeSomeTempModels();