Change some class naming conventions
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
|
||||
#include "AnimQueue.h"
|
||||
|
||||
FAnimStep FAnimQueueDecoder::ReadStep() {
|
||||
FAnimStep result;
|
||||
FlxAnimStep FlxAnimQueueDecoder::ReadStep() {
|
||||
FlxAnimStep result;
|
||||
result.Hash = Decoder.read_uint64();
|
||||
result.Body = Decoder.read_string_view();
|
||||
return result;
|
||||
}
|
||||
|
||||
FAnimField FAnimStepDecoder::ReadField() {
|
||||
FAnimField result;
|
||||
FlxAnimField FlxAnimStepDecoder::ReadField() {
|
||||
FlxAnimField result;
|
||||
result.Name = Decoder.read_string_view();
|
||||
result.Persistent = Decoder.read_bool();
|
||||
result.Type = (EAnimValueType)Decoder.read_uint8();
|
||||
result.Type = (ElxAnimValueType)Decoder.read_uint8();
|
||||
switch (result.Type) {
|
||||
case T_STRING: {
|
||||
result.S = Decoder.read_string_view();
|
||||
@@ -42,39 +42,39 @@ FAnimField FAnimStepDecoder::ReadField() {
|
||||
return result;
|
||||
}
|
||||
|
||||
FString FAnimQueueDecoder::DebugString(std::string_view queue) {
|
||||
FString FlxAnimQueueDecoder::DebugString(std::string_view queue) {
|
||||
FString result;
|
||||
FAnimQueueDecoder decoder(queue);
|
||||
FlxAnimQueueDecoder decoder(queue);
|
||||
while (!decoder.AtEOF()) {
|
||||
FAnimStep step = decoder.ReadStep();
|
||||
FString stepdebug = FAnimStepDecoder::DebugString(step);
|
||||
FlxAnimStep step = decoder.ReadStep();
|
||||
FString stepdebug = FlxAnimStepDecoder::DebugString(step);
|
||||
result.Appendf(TEXT("%s\n"), *stepdebug);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
FString FAnimStepDecoder::DebugString(const FAnimStep& step) {
|
||||
FString FlxAnimStepDecoder::DebugString(const FlxAnimStep& step) {
|
||||
FString result;
|
||||
FAnimStepDecoder decoder(step);
|
||||
FlxAnimStepDecoder decoder(step);
|
||||
bool first = true;
|
||||
while (!decoder.AtEOF()) {
|
||||
FAnimField field = decoder.ReadField();
|
||||
FlxAnimField 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:
|
||||
case ElxAnimValueType::T_STRING:
|
||||
result.Append(FString(field.S.size(), (const UTF8CHAR*)field.S.data()));
|
||||
break;
|
||||
case EAnimValueType::T_NUMBER:
|
||||
case ElxAnimValueType::T_NUMBER:
|
||||
result.Appendf(TEXT("%lf"), field.X);
|
||||
break;
|
||||
case EAnimValueType::T_BOOLEAN:
|
||||
case ElxAnimValueType::T_BOOLEAN:
|
||||
result.Append((field.X) == 1.0 ? TEXT("true") : TEXT("false"));
|
||||
break;
|
||||
case EAnimValueType::T_XYZ:
|
||||
case ElxAnimValueType::T_XYZ:
|
||||
result.Appendf(TEXT("%lf,%lf,%lf"), field.X, field.Y, field.Z);
|
||||
break;
|
||||
}
|
||||
@@ -88,7 +88,7 @@ FString FAnimStepDecoder::DebugString(const FAnimStep& step) {
|
||||
//// store the hashes, not the steps. The First element
|
||||
//// of the queue is the oldest item.
|
||||
////
|
||||
//TDeque<FAnimStoredStep> AQ;
|
||||
//TDeque<FlxAnimStoredStep> AQ;
|
||||
|
||||
//// The sequence number of the first item in AQ.
|
||||
////
|
||||
@@ -106,7 +106,7 @@ FString FAnimStepDecoder::DebugString(const FAnimStep& step) {
|
||||
//TArray<uint64> AbortedHashes;
|
||||
|
||||
|
||||
FAnimTracker::FAnimTracker() {
|
||||
FlxAnimTracker::FlxAnimTracker() {
|
||||
AQ.Empty();
|
||||
FirstSeqno = 0;
|
||||
HashToSeqno.Empty();
|
||||
@@ -114,7 +114,7 @@ FAnimTracker::FAnimTracker() {
|
||||
AbortedHashes.Empty();
|
||||
}
|
||||
|
||||
void FAnimTracker::Update(std::string_view encqueue) {
|
||||
void FlxAnimTracker::Update(std::string_view encqueue) {
|
||||
// Check for an exact match. If the most recent entry
|
||||
// in encqueue has the same hash as the most recent
|
||||
// entry in AQ, then that's an exact match. Or,
|
||||
@@ -128,7 +128,7 @@ void FAnimTracker::Update(std::string_view encqueue) {
|
||||
}
|
||||
} else {
|
||||
if (!AQ.IsEmpty()) {
|
||||
FStringDecoder qdecoder(encqueue);
|
||||
FlxStringDecoder qdecoder(encqueue);
|
||||
uint64 hash = qdecoder.read_uint64();
|
||||
if (hash == AQ.Last().Hash) {
|
||||
return;
|
||||
@@ -143,11 +143,11 @@ void FAnimTracker::Update(std::string_view encqueue) {
|
||||
// At the same time, push all non-matching records
|
||||
// after the matching record onto a stack of new records.
|
||||
//
|
||||
FAnimQueueDecoder decoder(encqueue);
|
||||
TArray<FAnimStep> newsteps;
|
||||
FlxAnimQueueDecoder decoder(encqueue);
|
||||
TArray<FlxAnimStep> newsteps;
|
||||
int32 matchingseqno = -1;
|
||||
while (!decoder.AtEOF()) {
|
||||
FAnimStep step = decoder.ReadStep();
|
||||
FlxAnimStep step = decoder.ReadStep();
|
||||
int32* stepseq = HashToSeqno.Find(step.Hash);
|
||||
if (stepseq == nullptr) {
|
||||
newsteps.Emplace(step);
|
||||
@@ -172,7 +172,7 @@ void FAnimTracker::Update(std::string_view encqueue) {
|
||||
// Transfer the new animations onto the queue.
|
||||
//
|
||||
while (!newsteps.IsEmpty()) {
|
||||
FAnimStep step = newsteps.Pop();
|
||||
FlxAnimStep step = newsteps.Pop();
|
||||
int32 seqno = FirstSeqno + AQ.Num();
|
||||
AQ.EmplaceLast(step.Hash, step.Body);
|
||||
HashToSeqno.Emplace(step.Hash, seqno);
|
||||
@@ -202,25 +202,25 @@ void FAnimTracker::Update(std::string_view encqueue) {
|
||||
}
|
||||
}
|
||||
|
||||
TArray<uint64> FAnimTracker::GetAborted() {
|
||||
TArray<uint64> FlxAnimTracker::GetAborted() {
|
||||
TArray<uint64> result;
|
||||
result = std::move(AbortedHashes);
|
||||
AbortedHashes.Empty();
|
||||
return result;
|
||||
}
|
||||
|
||||
bool FAnimTracker::AnyUnstarted() {
|
||||
bool FlxAnimTracker::AnyUnstarted() {
|
||||
int offset = UnstartedSeqno - FirstSeqno;
|
||||
return (offset < AQ.Num());
|
||||
}
|
||||
|
||||
FAnimStoredStep FAnimTracker::GetUnstarted() {
|
||||
FlxAnimStoredStep FlxAnimTracker::GetUnstarted() {
|
||||
int offset = UnstartedSeqno - FirstSeqno;
|
||||
check(offset < AQ.Num());
|
||||
return AQ[offset];
|
||||
}
|
||||
|
||||
void FAnimTracker::Started(uint64 hash) {
|
||||
void FlxAnimTracker::Started(uint64 hash) {
|
||||
int offset = UnstartedSeqno - FirstSeqno;
|
||||
check(offset < AQ.Num());
|
||||
check(AQ[offset].Hash == hash);
|
||||
|
||||
Reference in New Issue
Block a user