diff --git a/Editor/ViewManager.cpp b/Editor/ViewManager.cpp index ecb4c0372..f2050e580 100644 --- a/Editor/ViewManager.cpp +++ b/Editor/ViewManager.cpp @@ -28,7 +28,7 @@ namespace urde void ViewManager::BuildTestPART(urde::IObjectStore& objStore) { m_modelTest = objStore.GetObj("MP1/Shared/CMDL_B2B41738.blend"); -#if 1 +#if 0 SObjectTag samusCharSet = m_projManager.TagFromPath(_S("MP1/Shared/ANCS_77289A4A.*")); SObjectTag platModel = m_projManager.TagFromPath(_S("MP1/Shared/CMDL_6FA561D0.blend")); SObjectTag bgModel = m_projManager.TagFromPath(_S("MP1/Shared/CMDL_BC34D54C.blend")); @@ -36,11 +36,11 @@ void ViewManager::BuildTestPART(urde::IObjectStore& objStore) g_GameState->GetWorldTransitionManager()->EnableTransition(samusAnimRes, platModel.id, zeus::CVector3f::skOne, bgModel.id, zeus::CVector3f::skOne, true); -#endif SObjectTag areaTag = m_projManager.TagFromPath( _S("MP1/Metroid1/!1IntroLevel1027/00 Exterior Docking Hangar/!area.blend")); auto areaData = m_projManager.resourceFactoryMP1().LoadResourceSync(areaTag); +#endif //m_modelTest = objStore.GetObj("gun_cmdl"); @@ -73,7 +73,7 @@ void ViewManager::BuildTestPART(urde::IObjectStore& objStore) //m_newAudioPlayer.emplace(*m_voiceEngine, "Audio/frontend_1.rsf", 416480, 1973664); //m_newAudioPlayer->StartMixing(); - //m_rootView->accessContentViews().clear(); + m_rootView->accessContentViews().clear(); m_rootView->accessContentViews().push_back(m_particleView.get()); m_rootView->updateSize(); } @@ -98,7 +98,7 @@ void ViewManager::ParticleView::draw(boo::IGraphicsCommandQueue *gfxQ) if (m_vm.m_modelTest.IsLoaded()) { -#if 1 +#if 0 CModelFlags flags; flags.m_extendedShaderIdx = 0; @@ -354,6 +354,16 @@ void ViewManager::init(boo::IApplication* app) m_mainWindow->setWaitCursor(false); m_voiceEngine = boo::NewAudioVoiceEngine(); m_amuseAllocWrapper.emplace(*m_voiceEngine); + + for (const auto& arg : app->getArgs()) + { + if (hecl::SearchForProject(arg)) + { + m_deferedProject = arg; + break; + } + } + /* CGraphics::InitializeBoo(gf, m_mainWindow->getCommandQueue(), root->renderTex()); CModelShaders::Initialize(m_fileStoreManager, gf); @@ -365,6 +375,12 @@ void ViewManager::init(boo::IApplication* app) bool ViewManager::proc() { + if (!m_deferedProject.empty() && m_viewResources.fontCacheReady()) + { + m_projManager.openProject(m_deferedProject); + m_deferedProject.clear(); + } + boo::IGraphicsCommandQueue* gfxQ = m_mainWindow->getCommandQueue(); if (m_rootView->isDestroyed()) return false; @@ -412,7 +428,6 @@ bool ViewManager::proc() m_mainWindow->waitForRetrace(); CBooModel::ClearModelUniformCounters(); CGraphics::TickRenderTimings(); - return true; } diff --git a/Editor/ViewManager.hpp b/Editor/ViewManager.hpp index 8e7956016..60be50147 100644 --- a/Editor/ViewManager.hpp +++ b/Editor/ViewManager.hpp @@ -124,6 +124,7 @@ class ViewManager : public specter::IViewManager specter::SplitView::Axis m_deferSplitAxis; int m_deferSplitThisSlot; boo::SWindowCoord m_deferSplitCoord; + hecl::SystemString m_deferedProject; public: ViewManager(hecl::Runtime::FileStoreManager& fileMgr, hecl::CVarManager& cvarMgr); diff --git a/Editor/main.cpp b/Editor/main.cpp index 181de48ee..5f2010312 100644 --- a/Editor/main.cpp +++ b/Editor/main.cpp @@ -56,12 +56,31 @@ struct Application : boo::IApplicationCallback { m_running = false; } - void appFilesOpen(boo::IApplication*, const std::vector&); + void appFilesOpen(boo::IApplication*, const std::vector& paths) + { + for (const auto& path : paths) + { + hecl::ProjectRootPath projPath = hecl::SearchForProject(path); + if (projPath) + { + m_viewManager->projectManager().openProject(path); + break; + } + } + } - void initialize(boo::IApplication* /*app*/) + void initialize(boo::IApplication* app) { zeus::detectCPU(); - hecl::VerbosityLevel = 1; + for (const boo::SystemString& arg : app->getArgs()) + { + if (arg.find(_S("--verbosity=")) == 0) + { + hecl::SystemUTF8View utf8Arg(arg.substr(arg.find_last_of('=') + 1)); + hecl::VerbosityLevel = atoi(utf8Arg.c_str()); + hecl::LogModule.report(logvisor::Info, "Set verbosity level to %i", hecl::VerbosityLevel); + } + } const zeus::CPUInfo& cpuInf = zeus::cpuFeatures(); Log.report(logvisor::Info, "CPU Name: %s", cpuInf.cpuBrand); @@ -102,12 +121,6 @@ struct Application : boo::IApplicationCallback } }; -/* This is here to prevent a vtable being dumped into every translation unit */ -void Application::appFilesOpen(boo::IApplication *, const std::vector &) -{ - -} - } #if _WIN32