From 40b9efd47f57966bda0882de7df2d846349a9caf Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Wed, 11 Jan 2023 16:34:08 -0800 Subject: [PATCH] Match and link CTransitionManager Former-commit-id: dbc36c5b231662d316c17cc6fe8ad965c4c52a96 --- configure.py | 2 +- include/Kyoto/Animation/CAnimSysContext.hpp | 24 +++++++++++++++++++ .../Kyoto/Animation/CTransitionManager.hpp | 16 +++++++++++++ include/Kyoto/Animation/CTreeUtils.hpp | 15 ++++++++++++ src/Kyoto/Animation/CTransitionManager.cpp | 9 +++++++ 5 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 include/Kyoto/Animation/CAnimSysContext.hpp create mode 100644 include/Kyoto/Animation/CTransitionManager.hpp create mode 100644 include/Kyoto/Animation/CTreeUtils.hpp create mode 100644 src/Kyoto/Animation/CTransitionManager.cpp diff --git a/configure.py b/configure.py index 661b7100..3ca67bf8 100755 --- a/configure.py +++ b/configure.py @@ -500,7 +500,7 @@ LIBS = [ ["Kyoto/Animation/CPrimitive", True], "Kyoto/Animation/CSequenceHelper", ["Kyoto/Animation/CTransition", True], - "Kyoto/Animation/CTransitionManager", + ["Kyoto/Animation/CTransitionManager", True], "Kyoto/Animation/CTreeUtils", "Kyoto/Animation/IMetaAnim", ["Kyoto/Audio/CSfxHandle", True], diff --git a/include/Kyoto/Animation/CAnimSysContext.hpp b/include/Kyoto/Animation/CAnimSysContext.hpp new file mode 100644 index 00000000..af47c6c0 --- /dev/null +++ b/include/Kyoto/Animation/CAnimSysContext.hpp @@ -0,0 +1,24 @@ +#ifndef _CANIMSYSCONTEXT +#define _CANIMSYSCONTEXT + +#include "Kyoto/TToken.hpp" + +#include "rstl/rc_ptr.hpp" + +class CTransitionDatabaseGame; +class CRandom16; +class CSimplePool; + +class CAnimSysContext { +public: + CAnimSysContext(const TToken< CTransitionDatabaseGame >& transDb, + const rstl::ncrc_ptr< CRandom16 >& random, CSimplePool& store) + : x0_transDb(transDb), x8_random(random), xc_store(store) {} + +private: + TToken< CTransitionDatabaseGame > x0_transDb; + rstl::rc_ptr< CRandom16 > x8_random; + CSimplePool& xc_store; +}; + +#endif // _CANIMSYSCONTEXT diff --git a/include/Kyoto/Animation/CTransitionManager.hpp b/include/Kyoto/Animation/CTransitionManager.hpp new file mode 100644 index 00000000..9d3682d3 --- /dev/null +++ b/include/Kyoto/Animation/CTransitionManager.hpp @@ -0,0 +1,16 @@ +#ifndef _CTRANSITIONMANAGER +#define _CTRANSITIONMANAGER + +#include "Kyoto/Animation/CAnimSysContext.hpp" + +class CAnimTreeNode; +class CTransitionManager { +public: + rstl::rc_ptr< CAnimTreeNode > GetTransitionTree(const rstl::ncrc_ptr< CAnimTreeNode >& a, + const rstl::ncrc_ptr< CAnimTreeNode >& b) const; + +private: + CAnimSysContext x0_context; +}; + +#endif // _CTRANSITIONMANAGER diff --git a/include/Kyoto/Animation/CTreeUtils.hpp b/include/Kyoto/Animation/CTreeUtils.hpp new file mode 100644 index 00000000..99e53094 --- /dev/null +++ b/include/Kyoto/Animation/CTreeUtils.hpp @@ -0,0 +1,15 @@ +#ifndef _CTREEUTILS +#define _CTREEUTILS + +#include "rstl/rc_ptr.hpp" + +class CAnimTreeNode; +class CAnimSysContext; +class CTreeUtils { +public: + static rstl::rc_ptr< CAnimTreeNode > GetTransitionTree(const rstl::ncrc_ptr< CAnimTreeNode >& a, + const rstl::ncrc_ptr< CAnimTreeNode >& b, + const CAnimSysContext& animCtx); +}; + +#endif // _CTREEUTILS diff --git a/src/Kyoto/Animation/CTransitionManager.cpp b/src/Kyoto/Animation/CTransitionManager.cpp new file mode 100644 index 00000000..d0f5fa2c --- /dev/null +++ b/src/Kyoto/Animation/CTransitionManager.cpp @@ -0,0 +1,9 @@ +#include "Kyoto/Animation/CTransitionManager.hpp" +#include "Kyoto/Animation/CTreeUtils.hpp" + +rstl::rc_ptr< CAnimTreeNode > +CTransitionManager::GetTransitionTree(const rstl::ncrc_ptr< CAnimTreeNode >& a, + const rstl::ncrc_ptr< CAnimTreeNode >& b) const { + + return CTreeUtils::GetTransitionTree(a, b, x0_context); +}