2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 21:47:42 +00:00

Plenty of dependency stubs for CStateManager

This commit is contained in:
Jack Andersen
2016-08-14 11:11:44 -10:00
parent 91b5b3ed73
commit 24bfc47d1a
58 changed files with 983 additions and 30 deletions

View File

@@ -11,14 +11,14 @@ void CObjectList::AddObject(CEntity& entity)
{
if (IsQualified())
{
if (m_lastId != -1)
m_list[m_lastId].next = entity.GetUniqueId() & 0x3ff;
TUniqueId prevLast = m_lastId;
m_lastId = entity.GetUniqueId() & 0x3ff;
SObjectListEntry& newEnt = m_list[m_lastId];
if (m_firstId != -1)
m_list[m_firstId].prev = entity.GetUniqueId() & 0x3ff;
TUniqueId prevFirst = m_firstId;
m_firstId = entity.GetUniqueId() & 0x3ff;
SObjectListEntry& newEnt = m_list[m_firstId];
newEnt.entity = &entity;
newEnt.prev = prevLast;
newEnt.next = -1;
newEnt.next = prevFirst;
newEnt.prev = -1;
++m_count;
}
}
@@ -29,21 +29,21 @@ void CObjectList::RemoveObject(TUniqueId uid)
SObjectListEntry& ent = m_list[uid];
if (!ent.entity || ent.entity->GetUniqueId() != uid)
return;
if (uid == m_lastId)
if (uid == m_firstId)
{
m_lastId = ent.prev;
if (ent.prev != -1)
m_list[ent.prev].next = -1;
m_firstId = ent.next;
if (ent.next != -1)
m_list[ent.next].prev = -1;
}
else
{
if (ent.prev != -1)
m_list[ent.prev].next = -1;
m_list[ent.next].prev = -1;
if (ent.next != -1)
m_list[ent.next].prev = -1;
m_list[ent.prev].next = -1;
}
ent.entity = nullptr;
ent.prev = -1;
ent.next = -1;
ent.prev = -1;
--m_count;
}
@@ -51,14 +51,20 @@ const CEntity* CObjectList::GetObjectById(TUniqueId uid) const
{
if (!uid)
return nullptr;
return m_list[uid & 0x3ff].entity;
const SObjectListEntry& ent = m_list[uid & 0x3ff];
if (ent.entity->x30_26_scriptingBlocked)
return nullptr;
return ent.entity;
}
CEntity* CObjectList::GetObjectById(TUniqueId uid)
{
if (!uid)
return nullptr;
return m_list[uid & 0x3ff].entity;
SObjectListEntry& ent = m_list[uid & 0x3ff];
if (ent.entity->x30_26_scriptingBlocked)
return nullptr;
return ent.entity;
}
bool CObjectList::IsQualified() {return true;}