Some progress toward tangible GC:

This commit is contained in:
2023-09-26 19:26:09 -04:00
parent 0efd0dd3ad
commit 9116a7b8fe
4 changed files with 60 additions and 47 deletions

View File

@@ -121,22 +121,17 @@ void AIntegrationGameModeBase::MaybeTriggerUpdateTask(float deltaseconds) {
#pragma optimize("", off)
void AIntegrationGameModeBase::UpdateTangibles() {
using TanArray = UlxTangibleManager::TanArray;
if (!Playing) return;
FlxLockedWrapper w(LockableWrapper);
int64 actor = w.GetActor();
TangibleManager->SetPlayer(actor);
IdView near = w.GetNear(actor, 100, 100, 100);
TangibleManager->SetNear(near);
for (int64 id : near) {
TangibleManager->MakeTangible(id);
}
// Update animation queues of live tangibles.
IdArray tanids = TangibleManager->GetLive();
StringViewVec aqueues = w.GetAnimationQueues(tanids);
for (int i = 0; i < tanids.Num(); i++) {
uint64_t tanid = tanids[i];
UlxTangible *t = TangibleManager->GetTangible(tanid);
t->AnimTracker.Update(aqueues[i]);
int64 player = w.GetActor();
TangibleManager->UpdateNear(w.GetNear(player, 100, 100, 100));
TanArray alltans = TangibleManager->GetAllTangibles();
IdArray allids = TangibleManager->GetIds(alltans);
StringViewVec allqueues = w.GetAnimationQueues(allids);
for (int i = 0; i < alltans.Num(); i++) {
UlxTangible *t = alltans[i];
t->AnimTracker.Update(allqueues[i]);
TArray<uint64> aborted = t->AnimTracker.GetAborted();
for (uint64 hash : aborted) {
IlxTangibleInterface::Execute_AbortAnimation(t->GetActor(), hash);