diff options
| author | MegaMech <7255464+MegaMech@users.noreply.github.com> | 2025-01-05 16:29:06 -0700 |
|---|---|---|
| committer | MegaMech <7255464+MegaMech@users.noreply.github.com> | 2025-01-05 16:29:06 -0700 |
| commit | ec5eb3c1b91514687f1086da9263fb094ba15557 (patch) | |
| tree | 6a21c6c31f507ace66facf43338d98b2929530ed /src/port/Engine.cpp | |
| parent | abec30850763e78bf51cac39792323b02c13a3f5 (diff) | |
Update lus
Diffstat (limited to 'src/port/Engine.cpp')
| -rw-r--r-- | src/port/Engine.cpp | 66 |
1 files changed, 41 insertions, 25 deletions
diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index 6c43b48bb..23c5dbdbe 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -62,10 +62,26 @@ GameEngine::GameEngine() { } } - this->context = Ship::Context::CreateInstance("Spaghettify", "skart64", "spaghettify.cfg.json", OTRFiles, {}, 3, - { 26800, 512, 1100 }); + this->context = + Ship::Context::CreateUninitializedInstance("Spaghetti Kart", "spaghettify", "spaghettify.cfg.json"); + + this->context->InitConfiguration(); // without this line InitConsoleVariables fails at Config::Reload() + this->context->InitConsoleVariables(); // without this line the controldeck constructor failes in ShipDeviceIndexMappingManager::UpdateControllerNamesFromConfig() + + auto controlDeck = std::make_shared<LUS::ControlDeck>(); + + this->context->InitResourceManager(OTRFiles, {}, 3); // without this line InitWindow fails in Gui::Init() + this->context->InitConsole(); // without this line the GuiWindow constructor fails in ConsoleWindow::InitElement() + + auto wnd = std::make_shared<Fast::Fast3dWindow>(std::vector<std::shared_ptr<Ship::GuiWindow>>({})); + //auto wnd = std::dynamic_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow()); + + this->context->Init(OTRFiles, {}, 3, { 26800, 512, 1100 }, wnd, controlDeck); + + + // this->context = Ship::Context::CreateInstance("Spaghettify", "skart64", "spaghettify.cfg.json", OTRFiles, {}, 3, + // { 26800, 512, 1100 }); - auto wnd = std::dynamic_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow()); wnd->SetRendererUCode(ucode_f3dex); this->context->InitGfxDebugger(); @@ -84,27 +100,27 @@ GameEngine::GameEngine() { loader->RegisterResourceFactory(std::make_shared<SF64::ResourceFactoryBinaryGenericArrayV0>(), RESOURCE_FORMAT_BINARY, "GenericArray", static_cast<uint32_t>(SF64::ResourceType::GenericArray), 0); - loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryTextureV0>(), RESOURCE_FORMAT_BINARY, - "Texture", static_cast<uint32_t>(LUS::ResourceType::Texture), 0); - loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryTextureV1>(), RESOURCE_FORMAT_BINARY, - "Texture", static_cast<uint32_t>(LUS::ResourceType::Texture), 1); - - loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryVertexV0>(), RESOURCE_FORMAT_BINARY, - "Vertex", static_cast<uint32_t>(LUS::ResourceType::Vertex), 0); - loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryXMLVertexV0>(), RESOURCE_FORMAT_XML, "Vertex", - static_cast<uint32_t>(LUS::ResourceType::Vertex), 0); - - loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryDisplayListV0>(), RESOURCE_FORMAT_BINARY, - "DisplayList", static_cast<uint32_t>(LUS::ResourceType::DisplayList), 0); - loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryXMLDisplayListV0>(), RESOURCE_FORMAT_XML, - "DisplayList", static_cast<uint32_t>(LUS::ResourceType::DisplayList), 0); - - loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryMatrixV0>(), RESOURCE_FORMAT_BINARY, - "Matrix", static_cast<uint32_t>(LUS::ResourceType::Matrix), 0); - loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryBlobV0>(), RESOURCE_FORMAT_BINARY, - "Blob", static_cast<uint32_t>(LUS::ResourceType::Blob), 0); - loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryLightV0>(), RESOURCE_FORMAT_BINARY, - "Lights1", static_cast<uint32_t>(LUS::ResourceType::Light), 0); + loader->RegisterResourceFactory(std::make_shared<Fast::ResourceFactoryBinaryTextureV0>(), RESOURCE_FORMAT_BINARY, + "Texture", static_cast<uint32_t>(Fast::ResourceType::Texture), 0); + loader->RegisterResourceFactory(std::make_shared<Fast::ResourceFactoryBinaryTextureV1>(), RESOURCE_FORMAT_BINARY, + "Texture", static_cast<uint32_t>(Fast::ResourceType::Texture), 1); + + loader->RegisterResourceFactory(std::make_shared<Fast::ResourceFactoryBinaryVertexV0>(), RESOURCE_FORMAT_BINARY, + "Vertex", static_cast<uint32_t>(Fast::ResourceType::Vertex), 0); + loader->RegisterResourceFactory(std::make_shared<Fast::ResourceFactoryXMLVertexV0>(), RESOURCE_FORMAT_XML, "Vertex", + static_cast<uint32_t>(Fast::ResourceType::Vertex), 0); + + loader->RegisterResourceFactory(std::make_shared<Fast::ResourceFactoryBinaryDisplayListV0>(), RESOURCE_FORMAT_BINARY, + "DisplayList", static_cast<uint32_t>(Fast::ResourceType::DisplayList), 0); + loader->RegisterResourceFactory(std::make_shared<Fast::ResourceFactoryXMLDisplayListV0>(), RESOURCE_FORMAT_XML, + "DisplayList", static_cast<uint32_t>(Fast::ResourceType::DisplayList), 0); + + loader->RegisterResourceFactory(std::make_shared<Fast::ResourceFactoryBinaryMatrixV0>(), RESOURCE_FORMAT_BINARY, + "Matrix", static_cast<uint32_t>(Fast::ResourceType::Matrix), 0); + loader->RegisterResourceFactory(std::make_shared<Ship::ResourceFactoryBinaryBlobV0>(), RESOURCE_FORMAT_BINARY, + "Blob", static_cast<uint32_t>(Ship::ResourceType::Blob), 0); + loader->RegisterResourceFactory(std::make_shared<Fast::ResourceFactoryBinaryLightV0>(), RESOURCE_FORMAT_BINARY, + "Lights1", static_cast<uint32_t>(Fast::ResourceType::Light), 0); loader->RegisterResourceFactory(std::make_shared<MK64::ResourceFactoryBinaryArrayV0>(), RESOURCE_FORMAT_BINARY, "Array", static_cast<uint32_t>(MK64::ResourceType::MK_Array), 0); loader->RegisterResourceFactory(std::make_shared<MK64::ResourceFactoryBinaryKartAIV0>(), RESOURCE_FORMAT_BINARY, @@ -233,7 +249,7 @@ void GameEngine::EndAudioFrame() { void GameEngine::AudioInit() { const auto resourceMgr = Ship::Context::GetInstance()->GetResourceManager(); - resourceMgr->LoadDirectory("sound"); + resourceMgr->LoadResources("sound"); const auto banksFiles = resourceMgr->GetArchiveManager()->ListFiles("sound/banks/*"); const auto sequences_files = resourceMgr->GetArchiveManager()->ListFiles("sound/sequences/*"); |
