From 309ef4bda9affd814cf60fd9c9a92f45771ddc7e Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 16 Feb 2023 11:17:47 -0800 Subject: [PATCH] Add Legacy CStateMachine --- CLegacyStateMachine.bt | 41 +++++++++++++++++++++++++++++++++++++++++ Run.bt | 8 ++++++++ 2 files changed, 49 insertions(+) create mode 100644 CLegacyStateMachine.bt diff --git a/CLegacyStateMachine.bt b/CLegacyStateMachine.bt new file mode 100644 index 0000000..b85a702 --- /dev/null +++ b/CLegacyStateMachine.bt @@ -0,0 +1,41 @@ +#ifndef _CLEGACYSTATEMACHINE +#define _CLEGACYSTATEMACHINE + +struct NameEntry { + string name; +}; + +struct State +{ + local byte firstIndex = true; + int triggerCount; + if (triggerCount > 0) + { + struct + { + uint triggerCount; + struct + { + string actionName; + float actionTime; + if (firstIndex) + { + int stateIndex; + firstIndex = false; + } + } triggers[triggerCount] ; + firstIndex = true; + } subTrigger[triggerCount] ; + } +}; + +struct CLegacyStateMachine +{ + uint stateCount; + NameEntry states[stateCount] ; + uint triggerCount; + State triggers[stateCount] ; +}; + + +#endif// _CLEGACYSTATEMACHINE diff --git a/Run.bt b/Run.bt index c94dcef..f25d32b 100644 --- a/Run.bt +++ b/Run.bt @@ -22,6 +22,7 @@ if (!exists(isDKCTF)) { #include "CVectorField.bt" #include "CAABoxCollisionTree.bt" #include "CReflectionProbeData.bt" +#include "CLegacyStateMachine.bt" //#include "CRuleSet.bt" #include "CScaleformFlashLibrary.bt" @@ -46,6 +47,13 @@ typedef struct case "LTPB": CLightProbeData lightProbe(form.size); break; + case "LFSM": + if (!isDKCTF) + BigEndian(); + CLegacyStateMachine legacyStateMachine; + if (!isDKCTF) + LittleEndian(); + break; case "CLSN": CAABoxCollisionTree aaboxCollisionTree(form.size); break;