From f2635f449c6460e86035a32667285007ca8d6438 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Fri, 9 Sep 2016 21:50:00 -0700 Subject: [PATCH] Various cleanups and minor imps --- DataSpec/DNACommon/DNACommon.hpp | 2 +- DataSpec/DNAMP1/HINT.hpp | 10 +++ DataSpec/SpecMP1.cpp | 7 ++ Editor/ProjectResourceFactoryMP1.cpp | 78 ++++++++++++---------- Editor/ViewManager.hpp | 2 + Runtime/Character/CAnimTreeDoubleChild.cpp | 6 +- Runtime/Character/CAnimTreeDoubleChild.hpp | 5 +- Runtime/Character/CAnimTreeTransition.cpp | 47 +++++++++++++ Runtime/Character/CAnimTreeTransition.hpp | 20 +++++- Runtime/Character/CAnimTreeTweenBase.cpp | 27 ++------ Runtime/Character/CAnimTreeTweenBase.hpp | 5 +- Runtime/Character/CAnimationSet.hpp | 18 ++--- Runtime/Character/CEffectComponent.cpp | 26 ++++---- Runtime/Character/CEffectComponent.hpp | 8 ++- Runtime/Character/CMetaAnimFactory.cpp | 2 +- Runtime/Character/CMetaAnimPlay.hpp | 2 +- Runtime/Character/CMetaTransFactory.cpp | 4 +- Runtime/Character/CMetaTransPhaseTrans.cpp | 2 +- Runtime/Character/CMetaTransTrans.cpp | 14 ++-- Runtime/Character/CMetaTransTrans.hpp | 4 +- Runtime/Character/IMetaAnim.hpp | 2 +- Runtime/RetroTypes.hpp | 33 +++++++-- Runtime/World/CScriptDoor.hpp | 1 + Runtime/rstl.hpp | 1 + 24 files changed, 210 insertions(+), 116 deletions(-) diff --git a/DataSpec/DNACommon/DNACommon.hpp b/DataSpec/DNACommon/DNACommon.hpp index b001ebdc9..3ac0bef75 100644 --- a/DataSpec/DNACommon/DNACommon.hpp +++ b/DataSpec/DNACommon/DNACommon.hpp @@ -95,7 +95,7 @@ public: PAKRouterBase* pakRouter = g_PakRouter.get(); if (!pakRouter) LogDNACommon.report(logvisor::Fatal, - "g_Project must be set to non-null before calling UniqueIDBridge::TranslatePakIdToPath"); + "g_PakRouter must be set to non-null before calling UniqueIDBridge::TranslatePakIdToPath"); return pakRouter->getWorking(id, silenceWarnings); } static hecl::ProjectPath MakePathFromString(const std::string& str) diff --git a/DataSpec/DNAMP1/HINT.hpp b/DataSpec/DNAMP1/HINT.hpp index 1a6c2cc0b..0eea5ecef 100644 --- a/DataSpec/DNAMP1/HINT.hpp +++ b/DataSpec/DNAMP1/HINT.hpp @@ -46,6 +46,16 @@ struct HINT : BigYAML hint.toYAMLStream(writer); return true; } + + static bool Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) + { + HINT hint; + athena::io::FileReader reader(inPath.getAbsolutePath()); + hint.fromYAMLStream(reader); + athena::io::FileWriter ws(outPath.getAbsolutePath()); + hint.write(ws); + return true; + } }; } } diff --git a/DataSpec/SpecMP1.cpp b/DataSpec/SpecMP1.cpp index f88482d8e..cd0fcc16c 100644 --- a/DataSpec/SpecMP1.cpp +++ b/DataSpec/SpecMP1.cpp @@ -5,6 +5,7 @@ #include "SpecBase.hpp" #include "DNAMP1/DNAMP1.hpp" +#include "DNAMP1/HINT.hpp" #include "DNAMP1/MLVL.hpp" #include "DNAMP1/STRG.hpp" #include "DNAMP1/CMDL.hpp" @@ -353,6 +354,8 @@ struct SpecMP1 : SpecBase return true; else if (!strcmp(classType, DNAMP1::CTweakGunRes::DNAType())) return true; + else if (!strcmp(classType, DNAMP1::HINT::DNAType())) + return true; return false; }); } @@ -504,6 +507,10 @@ struct SpecMP1 : SpecBase gunRes.read(reader); WriteTweak(gunRes, out); } + else if (!classStr.compare(DNAMP1::HINT::DNAType())) + { + DNAMP1::HINT::Cook(in, out); + } } progress(_S("Done")); } diff --git a/Editor/ProjectResourceFactoryMP1.cpp b/Editor/ProjectResourceFactoryMP1.cpp index d820c971c..d92cdd7fe 100644 --- a/Editor/ProjectResourceFactoryMP1.cpp +++ b/Editor/ProjectResourceFactoryMP1.cpp @@ -1,6 +1,7 @@ #include "ProjectResourceFactoryMP1.hpp" #include "Runtime/IOStreams.hpp" +#include "Runtime/CGameHintInfo.hpp" #include "Runtime/Particle/CParticleDataFactory.hpp" #include "Runtime/Particle/CGenDescription.hpp" #include "Runtime/Particle/CElectricDescription.hpp" @@ -46,6 +47,7 @@ ProjectResourceFactoryMP1::ProjectResourceFactoryMP1(hecl::ClientProcess& client m_factoryMgr.AddFactory(FOURCC('DGRP'), FFactoryFunc(FDependencyGroupFactory)); m_factoryMgr.AddFactory(FOURCC('AGSC'), FMemFactoryFunc(FAudioGroupSetDataFactory)); m_factoryMgr.AddFactory(FOURCC('STRG'), FFactoryFunc(FStringTableFactory)); + m_factoryMgr.AddFactory(FOURCC('HINT'), FFactoryFunc(FHintFactory)); } void ProjectResourceFactoryMP1::IndexMP1Resources(hecl::Database::Project& proj) @@ -111,41 +113,46 @@ SObjectTag ProjectResourceFactoryMP1::TagFromPath(const hecl::ProjectPath& path, yaml_parser_set_input_file(reader.getParser(), fp); SObjectTag resTag; - if (reader.ClassTypeOperation([&](const char* className) -> bool - { - if (!strcmp(className, "GPSM")) - { - resTag.type = SBIG('PART'); - return true; - } - else if (!strcmp(className, "FONT")) - { - resTag.type = SBIG('FONT'); - return true; - } - else if (!strcmp(className, "urde::DNAMP1::EVNT")) - { - resTag.type = SBIG('EVNT'); - return true; - } - else if (!strcmp(className, "urde::DGRP")) - { - resTag.type = SBIG('DGRP'); - return true; - } - else if (!strcmp(className, "urde::DNAMP1::STRG")) - { - resTag.type = SBIG('STRG'); - return true; - } - else if (!strcmp(className, "DataSpec::DNAMP1::CTweakPlayerRes") || - !strcmp(className, "DataSpec::DNAMP1::CTweakGunRes")) - { - resTag.type = SBIG('CTWK'); - return true; - } - return false; - })) + if (reader.ClassTypeOperation([&](const char* className) -> bool { + if (!strcmp(className, "GPSM")) + { + resTag.type = SBIG('PART'); + return true; + } + else if (!strcmp(className, "FONT")) + { + resTag.type = SBIG('FONT'); + return true; + } + else if (!strcmp(className, "urde::DNAMP1::EVNT")) + { + resTag.type = SBIG('EVNT'); + return true; + } + else if (!strcmp(className, "urde::DGRP")) + { + resTag.type = SBIG('DGRP'); + return true; + } + else if (!strcmp(className, "urde::DNAMP1::STRG")) + { + resTag.type = SBIG('STRG'); + return true; + } + else if (!strcmp(className, "DataSpec::DNAMP1::CTweakPlayerRes") || + !strcmp(className, "DataSpec::DNAMP1::CTweakGunRes")) + { + resTag.type = SBIG('CTWK'); + return true; + } + else if (!strcmp(className, "DataSpec::DNAMP1::HINT")) + { + resTag.type = SBIG('HINT'); + return true; + } + + return false; + })) { resTag.id = path.hash().val32(); fclose(fp); @@ -155,5 +162,4 @@ SObjectTag ProjectResourceFactoryMP1::TagFromPath(const hecl::ProjectPath& path, } return {}; } - } diff --git a/Editor/ViewManager.hpp b/Editor/ViewManager.hpp index d86e6c4ff..81ea511c5 100644 --- a/Editor/ViewManager.hpp +++ b/Editor/ViewManager.hpp @@ -6,6 +6,7 @@ #include "ProjectManager.hpp" #include "Space.hpp" +#include "Runtime/CGameHintInfo.hpp" #include "Runtime/Particle/CElementGen.hpp" #include "Runtime/Graphics/CLineRenderer.hpp" #include "Runtime/Graphics/CMoviePlayer.hpp" @@ -66,6 +67,7 @@ class ViewManager : public specter::IViewManager std::unique_ptr m_particleView; urde::TLockedToken m_modelTest; urde::TLockedToken m_partGenDesc; + TLockedToken m_hints; std::unique_ptr m_partGen; std::unique_ptr m_lineRenderer; std::unique_ptr m_moviePlayer; diff --git a/Runtime/Character/CAnimTreeDoubleChild.cpp b/Runtime/Character/CAnimTreeDoubleChild.cpp index 616516629..a055a0bed 100644 --- a/Runtime/Character/CAnimTreeDoubleChild.cpp +++ b/Runtime/Character/CAnimTreeDoubleChild.cpp @@ -3,10 +3,10 @@ namespace urde { -CAnimTreeDoubleChild::CAnimTreeDoubleChild(const std::shared_ptr& a, - const std::shared_ptr& b, +CAnimTreeDoubleChild::CAnimTreeDoubleChild(const std::weak_ptr& a, + const std::weak_ptr& b, const std::string& name) -: CAnimTreeNode(name), x14_a(a), x18_b(b) +: CAnimTreeNode(name), x14_a(a.lock()), x18_b(b.lock()) { } diff --git a/Runtime/Character/CAnimTreeDoubleChild.hpp b/Runtime/Character/CAnimTreeDoubleChild.hpp index 846576df9..7a9be9d69 100644 --- a/Runtime/Character/CAnimTreeDoubleChild.hpp +++ b/Runtime/Character/CAnimTreeDoubleChild.hpp @@ -8,11 +8,12 @@ namespace urde class CAnimTreeDoubleChild : public CAnimTreeNode { +protected: std::shared_ptr x14_a; std::shared_ptr x18_b; public: - CAnimTreeDoubleChild(const std::shared_ptr& a, - const std::shared_ptr& b, + CAnimTreeDoubleChild(const std::weak_ptr& a, + const std::weak_ptr& b, const std::string& name); SAdvancementResults VAdvanceView(const CCharAnimTime& a); u32 VGetBoolPOIList(const CCharAnimTime& time, CBoolPOINode* listOut, u32 capacity, u32 iterator, u32) const; diff --git a/Runtime/Character/CAnimTreeTransition.cpp b/Runtime/Character/CAnimTreeTransition.cpp index e69de29bb..d6cf49741 100644 --- a/Runtime/Character/CAnimTreeTransition.cpp +++ b/Runtime/Character/CAnimTreeTransition.cpp @@ -0,0 +1,47 @@ +#include "CAnimTreeTransition.hpp" + +namespace urde +{ + +std::string CAnimTreeTransition::CreatePrimitiveName(const std::weak_ptr&, + const std::weak_ptr&, float) +{ + return {}; +} + +CAnimTreeTransition::CAnimTreeTransition(bool b1, const std::weak_ptr& a, + const std::weak_ptr& b, const CCharAnimTime& time1, + const CCharAnimTime& time2, bool b2, bool b3, int flags, + const std::string& name, bool b4) +: CAnimTreeTweenBase(b1, a, b, flags, name), x24_(time1), x2c_(time2), x34_(b2), x35_(b3), x36_(b4) +{ +} + +CAnimTreeTransition::CAnimTreeTransition(bool b1, const std::weak_ptr& a, + const std::weak_ptr& b, const CCharAnimTime& time, bool b2, + int flags, const std::string& name) +: CAnimTreeTweenBase(b1, a, b, flags, name), x24_(time), x34_(b2), x35_(a.lock()->VGetBoolPOIState("Loop")) +{ +} + +CCharAnimTime CAnimTreeTransition::VGetTimeRemaining() const { return {}; } + +CSteadyStateAnimInfo CAnimTreeTransition::VGetSteadyStateAnimInfo() const +{ + return {}; +} + +std::shared_ptr CAnimTreeTransition::VClone() const { return {}; } + +void CAnimTreeTransition::SetBlendingWeight(float w) +{ + static_cast(x18_b.get())->SetBlendingWeight(w); +} + +float CAnimTreeTransition::VGetBlendingWeight() const +{ + if (x24_.GreaterThanZero()) + return (1.f / x24_) * x2c_; + return 0.f; +} +} diff --git a/Runtime/Character/CAnimTreeTransition.hpp b/Runtime/Character/CAnimTreeTransition.hpp index 7f6047ff0..3d877812c 100644 --- a/Runtime/Character/CAnimTreeTransition.hpp +++ b/Runtime/Character/CAnimTreeTransition.hpp @@ -9,10 +9,26 @@ namespace urde class CAnimTreeTransition : public CAnimTreeTweenBase { +protected: + CCharAnimTime x24_; + CCharAnimTime x2c_; + bool x34_; + bool x35_; + bool x36_ = false; public: - static std::string CreatePrimitiveName(); -}; + static std::string CreatePrimitiveName(const std::weak_ptr&, const std::weak_ptr&, + float); + CAnimTreeTransition(bool, const std::weak_ptr&, const std::weak_ptr&, + const CCharAnimTime&, const CCharAnimTime&, bool, bool, int, const std::string&, bool); + CAnimTreeTransition(bool, const std::weak_ptr&, const std::weak_ptr&, + const CCharAnimTime&, bool, int, const std::string&); + CCharAnimTime VGetTimeRemaining() const; + CSteadyStateAnimInfo VGetSteadyStateAnimInfo() const; + std::shared_ptr VClone() const; + void SetBlendingWeight(float w); + float VGetBlendingWeight() const; +}; } #endif // __URDE_CANIMTREETRANSITION_HPP__ diff --git a/Runtime/Character/CAnimTreeTweenBase.cpp b/Runtime/Character/CAnimTreeTweenBase.cpp index 18a71c39a..01bffcaa0 100644 --- a/Runtime/Character/CAnimTreeTweenBase.cpp +++ b/Runtime/Character/CAnimTreeTweenBase.cpp @@ -3,37 +3,24 @@ namespace urde { -CAnimTreeTweenBase::CAnimTreeTweenBase(bool b1, - const std::shared_ptr& a, - const std::shared_ptr& b, - int flags, const std::string& name) +CAnimTreeTweenBase::CAnimTreeTweenBase(bool b1, const std::weak_ptr& a, + const std::weak_ptr& b, int flags, const std::string& name) : CAnimTreeDoubleChild(a, b, name), x1c_flags(flags), x20_31_b1(b1) { } -void CAnimTreeTweenBase::VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut) const -{ -} +void CAnimTreeTweenBase::VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut) const {} void CAnimTreeTweenBase::VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut, const CCharAnimTime& time) const { } -bool CAnimTreeTweenBase::VHasOffset(const CSegId& seg) const -{ -} +bool CAnimTreeTweenBase::VHasOffset(const CSegId& seg) const {} -zeus::CVector3f CAnimTreeTweenBase::VGetOffset(const CSegId& seg) const -{ -} +zeus::CVector3f CAnimTreeTweenBase::VGetOffset(const CSegId& seg) const {} -zeus::CQuaternion CAnimTreeTweenBase::VGetRotation(const CSegId& seg) const -{ -} - -std::shared_ptr CAnimTreeTweenBase::VSimplified() -{ -} +zeus::CQuaternion CAnimTreeTweenBase::VGetRotation(const CSegId& seg) const {} +std::shared_ptr CAnimTreeTweenBase::VSimplified() {} } diff --git a/Runtime/Character/CAnimTreeTweenBase.hpp b/Runtime/Character/CAnimTreeTweenBase.hpp index 0edc8d298..b291caf94 100644 --- a/Runtime/Character/CAnimTreeTweenBase.hpp +++ b/Runtime/Character/CAnimTreeTweenBase.hpp @@ -8,13 +8,14 @@ namespace urde class CAnimTreeTweenBase : public CAnimTreeDoubleChild { +protected: int x1c_flags; bool x20_31_b1; bool x20_30_b2 = false; public: CAnimTreeTweenBase(bool, - const std::shared_ptr& a, - const std::shared_ptr& b, + const std::weak_ptr& a, + const std::weak_ptr& b, int, const std::string& name); virtual void SetBlendingWeight(float w)=0; diff --git a/Runtime/Character/CAnimationSet.hpp b/Runtime/Character/CAnimationSet.hpp index 45a9e681b..e9432f3d0 100644 --- a/Runtime/Character/CAnimationSet.hpp +++ b/Runtime/Character/CAnimationSet.hpp @@ -24,18 +24,14 @@ class CAnimationSet public: CAnimationSet(CInputStream& in); - const std::vector& GetAnimations() const {return x4_animations;} - const std::vector& GetTransitions() const {return x14_transitions;} - const std::shared_ptr& GetDefaultTransition() const {return x24_defaultTransition;} - const std::vector& GetHalfTransitions() const {return x40_halfTransitions;} - const std::vector>& - GetAdditiveInfo() const {return x28_additiveInfo;} - const CAdditiveAnimationInfo& - GetDefaultAdditiveInfo() const {return x38_defaultAdditiveInfo;} - const std::vector>& - GetAnimResIds() const {return x50_animRes;} + const std::vector& GetAnimations() const { return x4_animations; } + const std::vector& GetTransitions() const { return x14_transitions; } + const std::shared_ptr& GetDefaultTransition() const { return x24_defaultTransition; } + const std::vector& GetHalfTransitions() const { return x40_halfTransitions; } + const std::vector>& GetAdditiveInfo() const { return x28_additiveInfo; } + const CAdditiveAnimationInfo& GetDefaultAdditiveInfo() const { return x38_defaultAdditiveInfo; } + const std::vector>& GetAnimResIds() const { return x50_animRes; } }; - } #endif // __URDE_CANIMATIONSET_HPP__ diff --git a/Runtime/Character/CEffectComponent.cpp b/Runtime/Character/CEffectComponent.cpp index 4bbd397dd..445d3327f 100644 --- a/Runtime/Character/CEffectComponent.cpp +++ b/Runtime/Character/CEffectComponent.cpp @@ -3,10 +3,7 @@ namespace urde { -SObjectTag CEffectComponent::GetSObjectTagFromStream(CInputStream& in) -{ - return SObjectTag(in); -} +SObjectTag CEffectComponent::GetSObjectTagFromStream(CInputStream& in) { return SObjectTag(in); } CEffectComponent::CEffectComponent(CInputStream& in) { @@ -14,18 +11,19 @@ CEffectComponent::CEffectComponent(CInputStream& in) x10_tag = GetSObjectTagFromStream(in); x18_boneName = in.readString(); x28_scale = in.readFloatBig(); - x2c_ = in.readUint32Big(); - x30_ = in.readUint32Big(); + x2c_parentedMode = in.readUint32Big(); + x30_flags = in.readUint32Big(); } -const std::string& CEffectComponent::GetComponentName() const -{ - return x0_name; -} +const std::string& CEffectComponent::GetComponentName() const { return x0_name; } -const SObjectTag& CEffectComponent::GetParticleTag() const -{ - return x10_tag; -} +const SObjectTag& CEffectComponent::GetParticleTag() const { return x10_tag; } +const std::string& CEffectComponent::GetSegmentName() const { return x18_boneName; } + +float CEffectComponent::GetScale() const { return x28_scale; } + +u32 CEffectComponent::GetParentedMode() const { return x2c_parentedMode; } + +u32 CEffectComponent::GetFlags() const { return x30_flags; } } diff --git a/Runtime/Character/CEffectComponent.hpp b/Runtime/Character/CEffectComponent.hpp index 487e89c68..0871cbd96 100644 --- a/Runtime/Character/CEffectComponent.hpp +++ b/Runtime/Character/CEffectComponent.hpp @@ -13,14 +13,18 @@ class CEffectComponent SObjectTag x10_tag; std::string x18_boneName; float x28_scale; - u32 x2c_; - u32 x30_; + u32 x2c_parentedMode; + u32 x30_flags; static SObjectTag GetSObjectTagFromStream(CInputStream& in); public: CEffectComponent(CInputStream& in); const std::string& GetComponentName() const; const SObjectTag& GetParticleTag() const; + const std::string& GetSegmentName() const; + float GetScale() const; + u32 GetParentedMode() const; + u32 GetFlags() const; }; } diff --git a/Runtime/Character/CMetaAnimFactory.cpp b/Runtime/Character/CMetaAnimFactory.cpp index 811132e2a..403be16d0 100644 --- a/Runtime/Character/CMetaAnimFactory.cpp +++ b/Runtime/Character/CMetaAnimFactory.cpp @@ -14,7 +14,7 @@ std::shared_ptr CMetaAnimFactory::CreateMetaAnim(CInputStream& in) switch (type) { - case EMetaAnimType::Primitive: + case EMetaAnimType::Play: return std::make_shared(in); case EMetaAnimType::Blend: return std::make_shared(in); diff --git a/Runtime/Character/CMetaAnimPlay.hpp b/Runtime/Character/CMetaAnimPlay.hpp index dd13e351d..3e0c5de76 100644 --- a/Runtime/Character/CMetaAnimPlay.hpp +++ b/Runtime/Character/CMetaAnimPlay.hpp @@ -14,7 +14,7 @@ class CMetaAnimPlay : public IMetaAnim CCharAnimTime x1c_startTime; public: CMetaAnimPlay(CInputStream& in); - EMetaAnimType GetType() const {return EMetaAnimType::Primitive;} + EMetaAnimType GetType() const {return EMetaAnimType::Play;} void GetUniquePrimitives(std::set& primsOut) const; std::shared_ptr VGetAnimationTree(const CAnimSysContext& animSys, diff --git a/Runtime/Character/CMetaTransFactory.cpp b/Runtime/Character/CMetaTransFactory.cpp index e57e4d11c..2682382c3 100644 --- a/Runtime/Character/CMetaTransFactory.cpp +++ b/Runtime/Character/CMetaTransFactory.cpp @@ -21,10 +21,10 @@ std::shared_ptr CMetaTransFactory::CreateMetaTrans(CInputStream& in) return std::make_shared(in); case EMetaTransType::Snap: return std::make_shared(); - default: break; + default: + break; } return {}; } - } diff --git a/Runtime/Character/CMetaTransPhaseTrans.cpp b/Runtime/Character/CMetaTransPhaseTrans.cpp index 9956c4b5e..943ec0dca 100644 --- a/Runtime/Character/CMetaTransPhaseTrans.cpp +++ b/Runtime/Character/CMetaTransPhaseTrans.cpp @@ -1,4 +1,5 @@ #include "CMetaTransPhaseTrans.hpp" +#include "CAnimTreeNode.hpp" namespace urde { @@ -17,7 +18,6 @@ CMetaTransPhaseTrans::VGetTransitionTree(const std::weak_ptr& a, const std::weak_ptr& b, const CAnimSysContext& animSys) const { - return {}; } } diff --git a/Runtime/Character/CMetaTransTrans.cpp b/Runtime/Character/CMetaTransTrans.cpp index 7ce48ef59..94d4a1a3e 100644 --- a/Runtime/Character/CMetaTransTrans.cpp +++ b/Runtime/Character/CMetaTransTrans.cpp @@ -6,19 +6,17 @@ namespace urde CMetaTransTrans::CMetaTransTrans(CInputStream& in) { - x4_ = in.readFloatBig(); - x8_ = in.readUint32Big(); + x4_animTime = CCharAnimTime(in); xc_ = in.readBool(); xd_ = in.readBool(); x10_ = in.readUint32Big(); } -std::shared_ptr -CMetaTransTrans::VGetTransitionTree(const std::weak_ptr& a, - const std::weak_ptr& b, - const CAnimSysContext& animSys) const +std::shared_ptr CMetaTransTrans::VGetTransitionTree(const std::weak_ptr& a, + const std::weak_ptr& b, + const CAnimSysContext& animSys) const { - return {}; + return std::make_shared(xc_, a, b, x4_animTime, xd_, x10_, + CAnimTreeTransition::CreatePrimitiveName(a, b, x4_animTime)); } - } diff --git a/Runtime/Character/CMetaTransTrans.hpp b/Runtime/Character/CMetaTransTrans.hpp index 12477d2c0..100ce03d7 100644 --- a/Runtime/Character/CMetaTransTrans.hpp +++ b/Runtime/Character/CMetaTransTrans.hpp @@ -3,14 +3,14 @@ #include "IMetaTrans.hpp" #include "IOStreams.hpp" +#include "CCharAnimTime.hpp" namespace urde { class CMetaTransTrans : public IMetaTrans { - float x4_; - u32 x8_; + CCharAnimTime x4_animTime; bool xc_; bool xd_; u32 x10_; diff --git a/Runtime/Character/IMetaAnim.hpp b/Runtime/Character/IMetaAnim.hpp index 9190ebc2a..ef29774da 100644 --- a/Runtime/Character/IMetaAnim.hpp +++ b/Runtime/Character/IMetaAnim.hpp @@ -15,7 +15,7 @@ class IAnimReader; enum class EMetaAnimType { - Primitive, + Play, Blend, PhaseBlend, Random, diff --git a/Runtime/RetroTypes.hpp b/Runtime/RetroTypes.hpp index 7d750bf21..2184c6cea 100644 --- a/Runtime/RetroTypes.hpp +++ b/Runtime/RetroTypes.hpp @@ -19,9 +19,9 @@ struct SObjectTag { FourCC type; ResId id = -1; - operator bool() const {return id != -1;} - bool operator!=(const SObjectTag& other) const {return id != other.id;} - bool operator==(const SObjectTag& other) const {return id == other.id;} + operator bool() const { return id != -1; } + bool operator!=(const SObjectTag& other) const { return id != other.id; } + bool operator==(const SObjectTag& other) const { return id == other.id; } SObjectTag() = default; SObjectTag(FourCC tp, ResId rid) : type(tp), id(rid) {} SObjectTag(CInputStream& in) @@ -56,16 +56,35 @@ struct TEditorId #define kInvalidEditorId TEditorId() #define kInvalidUniqueId TUniqueId(-1) #define kInvalidAreaId TAreaId(-1) - } +#if 0 +template +class TRoundRobin +{ + rstl::reserved_vector vals; + +public: + TRoundRobin(const T& val) : vals(N, val) {} + + void PushBack(const T& val) { vals.push_back(val); } + + size_t Size() const { return vals.size(); } + + const T& GetLastValue() const { return vals.back(); } + + void Clear() { vals.clear(); } + + const T& GetValue(s32) const {} +}; +#endif + namespace std { -template<> +template <> struct hash { - inline size_t operator()(const urde::SObjectTag& tag) const - {return tag.id;} + inline size_t operator()(const urde::SObjectTag& tag) const { return tag.id; } }; } diff --git a/Runtime/World/CScriptDoor.hpp b/Runtime/World/CScriptDoor.hpp index 4caeb0a79..427042aa6 100644 --- a/Runtime/World/CScriptDoor.hpp +++ b/Runtime/World/CScriptDoor.hpp @@ -40,6 +40,7 @@ public: { struct { + bool x2a8_24_ : 1; bool x2a8_25_ : 1; bool x2a8_26_ : 1; bool x2a8_27_ : 1; diff --git a/Runtime/rstl.hpp b/Runtime/rstl.hpp index 4973b0449..444f65a0c 100644 --- a/Runtime/rstl.hpp +++ b/Runtime/rstl.hpp @@ -19,6 +19,7 @@ class reserved_vector : public std::vector { public: reserved_vector() {this->reserve(N);} + reserved_vector(size_t n, const T& val) : std::vector(n, val) { } }; }