Tested animation queue parsing in Unreal
This commit is contained in:
@@ -43,12 +43,43 @@ FAnimField FAnimStepDecoder::ReadField() {
|
||||
}
|
||||
|
||||
FString FAnimQueueDecoder::DebugString(std::string_view queue) {
|
||||
// IMPLEMENT ME
|
||||
return FString();
|
||||
FString result;
|
||||
FAnimQueueDecoder decoder(queue);
|
||||
while (!decoder.AtEOF()) {
|
||||
FAnimStep step = decoder.ReadStep();
|
||||
FString stepdebug = FAnimStepDecoder::DebugString(step);
|
||||
result.Appendf(TEXT("%s\n"), *stepdebug);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
FString FAnimStepDecoder::DebugString(const FAnimStep& step) {
|
||||
// IMPLEMENT ME
|
||||
return FString();
|
||||
FString result;
|
||||
FAnimStepDecoder decoder(step);
|
||||
bool first = true;
|
||||
while (!decoder.AtEOF()) {
|
||||
FAnimField field = decoder.ReadField();
|
||||
if (!first) {
|
||||
result.Append(TEXT(" "));
|
||||
}
|
||||
result.Append(FString(field.Name.size(), (const UTF8CHAR*)field.Name.data()));
|
||||
result.Append(field.Persistent ? TEXT("=") : TEXT(":"));
|
||||
switch (field.Type) {
|
||||
case EAnimValueType::T_STRING:
|
||||
result.Append(FString(field.S.size(), (const UTF8CHAR*)field.S.data()));
|
||||
break;
|
||||
case EAnimValueType::T_NUMBER:
|
||||
result.Appendf(TEXT("%lf"), field.X);
|
||||
break;
|
||||
case EAnimValueType::T_BOOLEAN:
|
||||
result.Append((field.X) == 1.0 ? TEXT("true") : TEXT("false"));
|
||||
break;
|
||||
case EAnimValueType::T_XYZ:
|
||||
result.Appendf(TEXT("%lf,%lf,%lf"), field.X, field.Y, field.Z);
|
||||
break;
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,13 @@
|
||||
#include "lpx-drvutil.hpp"
|
||||
#include "DebugPrint.h"
|
||||
#include "TangibleManager.h"
|
||||
#include "CommonTypes.h"
|
||||
#include "AnimQueue.h"
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
using namespace DebugPrint;
|
||||
using namespace CommonTypes;
|
||||
|
||||
AIntegrationGameModeBase::AIntegrationGameModeBase()
|
||||
{
|
||||
@@ -111,6 +114,11 @@ 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]);
|
||||
}
|
||||
}
|
||||
|
||||
void AIntegrationGameModeBase::ConsoleSendInput(const FString& fs)
|
||||
|
||||
Reference in New Issue
Block a user