metaforce/Runtime/CSortedLists.cpp

40 lines
918 B
C++
Raw Normal View History

#include "CSortedLists.hpp"
2017-01-15 03:59:37 +00:00
#include "World/CActor.hpp"
namespace urde
{
CSortedListManager::CSortedListManager()
{
Reset();
}
void CSortedListManager::Reset()
{
std::fill(std::begin(x0_nodes), std::end(x0_nodes), SNode());
for (int i=0 ; i<6 ; ++i)
xb000_sortedLists[i].Reset();
}
void CSortedListManager::RemoveFromList(ESortedList list, s16 id)
{
SSortedList& sl = xb000_sortedLists[u32(list)];
}
2017-01-15 03:59:37 +00:00
void CSortedListManager::Remove(const CActor* act)
{
2017-01-15 03:59:37 +00:00
SNode& node = x0_nodes[act->GetUniqueId() & 0x3ff];
if (node.x2a_full == false)
return;
2017-01-15 03:59:37 +00:00
RemoveFromList(ESortedList::Zero, node.x1c_);
RemoveFromList(ESortedList::Three, node.x22_);
RemoveFromList(ESortedList::One, node.x1e_);
RemoveFromList(ESortedList::Four, node.x24_);
RemoveFromList(ESortedList::Two, node.x20_);
RemoveFromList(ESortedList::Five, node.x26_);
node.x2a_full = false;
}
}