From e9a5e4b7f6647c77a33a1b8b6d82509b6f0f65d3 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 16 Aug 2016 19:09:34 -1000 Subject: [PATCH] Add handy TagFromPath shortcut method in ProjectManager --- Editor/ProjectManager.hpp | 2 ++ Editor/ViewManager.cpp | 11 ++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Editor/ProjectManager.hpp b/Editor/ProjectManager.hpp index 9278b6a05..7f88e4874 100644 --- a/Editor/ProjectManager.hpp +++ b/Editor/ProjectManager.hpp @@ -43,6 +43,8 @@ public: hecl::Database::Project* project() {return m_proj.get();} ProjectResourcePool& objectStore() {return m_objStore;} ProjectResourceFactoryMP1& resourceFactoryMP1() {return m_factoryMP1;} + SObjectTag TagFromPath(const hecl::SystemChar* path) const + { return m_factoryMP1.ProjectResourceFactoryBase::TagFromPath(path); } bool newProject(const hecl::SystemString& path); bool openProject(const hecl::SystemString& path); diff --git a/Editor/ViewManager.cpp b/Editor/ViewManager.cpp index bb3b4994f..05261e50f 100644 --- a/Editor/ViewManager.cpp +++ b/Editor/ViewManager.cpp @@ -29,19 +29,16 @@ URDE_DECL_SPECIALIZE_SHADER(CSpaceWarpFilter) void ViewManager::BuildTestPART(urde::IObjectStore& objStore) { #if 0 - SObjectTag samusCharSet = m_projManager.resourceFactoryMP1().ProjectResourceFactoryBase::TagFromPath( - _S("MP1/Shared/ANCS_77289A4A.blend")); - SObjectTag platModel = m_projManager.resourceFactoryMP1().ProjectResourceFactoryBase::TagFromPath( - _S("MP1/Shared/CMDL_6FA561D0.blend")); - SObjectTag bgModel = m_projManager.resourceFactoryMP1().ProjectResourceFactoryBase::TagFromPath( - _S("MP1/Shared/CMDL_BC34D54C.blend")); + SObjectTag samusCharSet = m_projManager.TagFromPath(_S("MP1/Shared/ANCS_77289A4A.blend")); + SObjectTag platModel = m_projManager.TagFromPath(_S("MP1/Shared/CMDL_6FA561D0.blend")); + SObjectTag bgModel = m_projManager.TagFromPath(_S("MP1/Shared/CMDL_BC34D54C.blend")); CAnimRes samusAnimRes(samusCharSet.id, -1, zeus::CVector3f::skOne, -1, true); g_GameState->GetWorldTransitionManager()->EnableTransition(samusAnimRes, platModel.id, zeus::CVector3f::skOne, bgModel.id, zeus::CVector3f::skOne, false); #endif - SObjectTag areaTag = m_projManager.resourceFactoryMP1().ProjectResourceFactoryBase::TagFromPath( + SObjectTag areaTag = m_projManager.TagFromPath( _S("MP1/Metroid1/!1IntroLevel1027/00 Exterior Docking Hangar/!area.blend")); auto areaData = m_projManager.resourceFactoryMP1().LoadResourceSync(areaTag);