From 1bdaf47b23838e7aba6869528256b56e9d10a28c Mon Sep 17 00:00:00 2001 From: teppy999 Date: Fri, 15 Sep 2023 00:21:31 -0400 Subject: [PATCH] A few more steps toward anim queue handling --- Source/Integration/AnimQueue.h | 6 ++--- .../Integration/IntegrationGameModeBase.cpp | 22 ++++++++----------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/Source/Integration/AnimQueue.h b/Source/Integration/AnimQueue.h index 305e849e..11ab0f0c 100644 --- a/Source/Integration/AnimQueue.h +++ b/Source/Integration/AnimQueue.h @@ -31,11 +31,11 @@ enum EAnimValueType { //////////////////////////////////////////////// struct FAnimStep { - uint32 Hash; + uint64 Hash; std::string_view Body; FAnimStep() : Hash(0), Body("") {} - FAnimStep(uint32 h, std::string_view b) : Hash(h), Body(b) {} + FAnimStep(uint64 h, std::string_view b) : Hash(h), Body(b) {} }; struct FAnimStoredStep { @@ -43,7 +43,7 @@ struct FAnimStoredStep { std::string Body; FAnimStoredStep() : Hash(0), Body("") {} - FAnimStoredStep(uint32 h, std::string_view b) : Hash(h), Body(b) {} + FAnimStoredStep(uint64 h, std::string_view b) : Hash(h), Body(b) {} }; //////////////////////////////////////////////// diff --git a/Source/Integration/IntegrationGameModeBase.cpp b/Source/Integration/IntegrationGameModeBase.cpp index eed35467..ba780ecd 100644 --- a/Source/Integration/IntegrationGameModeBase.cpp +++ b/Source/Integration/IntegrationGameModeBase.cpp @@ -113,19 +113,15 @@ void AIntegrationGameModeBase::UpdateTangibles() { for (int64 id : TangibleManager.GetNear()) { TangibleManager.MakeTangible(id); } - IdArray live = TangibleManager.GetLive(); - StringViewVec aqueues = w.GetAnimationQueues(live); - for (int i = 0; i < aqueues.Num(); i++) { - FString debugq = FAnimQueueDecoder::DebugString(aqueues[i]); - } - // Tick all the tangibles. - if (EngineSeconds > NextRotateCube) { - for (int i = 0; i < live.Num(); i++) { - UTangible *t = TangibleManager.GetTangible(live[i]); - check(t != nullptr); - ITangibleInterface::Execute_TurnFromCXX(t->Actor); - } - NextRotateCube += 0.5; + // 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]; + std::string_view aqueue = aqueues[i]; + UTangible* t = TangibleManager.GetTangible(tanid); + check(t != nullptr); + t->AnimTracker.Update(aqueue); } }