2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-06 00:37:26 +00:00

refactor: template remaining xmodel files for iw5,t5,t6

This commit is contained in:
Jan
2025-07-09 21:57:22 +01:00
parent 1b8eff17f0
commit a9c693d04d
10 changed files with 99 additions and 235 deletions

View File

@@ -1,55 +0,0 @@
// #include "LoaderXModelIW5.h"
// #include "Game/IW5/IW5.h"
// #include "Game/IW5/XModel/XModelLoaderIW5.h"
// #include "Pool/GlobalAssetPool.h"
// #include <cstring>
// #include <format>
// #include <iostream>
// using namespace IW5;
// namespace
// {
// class XModelLoader final : public AssetCreator<AssetXModel>
// {
// public:
// XModelLoader(MemoryManager& memory, ISearchPath& searchPath)
// : m_memory(memory),
// m_search_path(searchPath)
// {
// }
// AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
// {
// const auto file = m_search_path.Open(std::format("xmodel/{}.json", assetName));
// if (!file.IsOpen())
// return AssetCreationResult::NoAction();
// auto* xmodel = m_memory.Alloc<XModel>();
// xmodel->name = m_memory.Dup(assetName.c_str());
// AssetRegistration<AssetXModel> registration(assetName, xmodel);
// if (!LoadXModel(*file.m_stream, *xmodel, m_memory, context, registration))
// {
// std::cerr << std::format("Failed to load xmodel \"{}\"\n", assetName);
// return AssetCreationResult::Failure();
// }
// return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
// }
// private:
// MemoryManager& m_memory;
// ISearchPath& m_search_path;
// };
// } // namespace
// namespace IW5
// {
// std::unique_ptr<AssetCreator<AssetXModel>> CreateXModelLoader(MemoryManager& memory, ISearchPath& searchPath)
// {
// return std::make_unique<XModelLoader>(memory, searchPath);
// }
// } // namespace IW5

View File

@@ -1,13 +0,0 @@
// #pragma once
// #include "Asset/IAssetCreator.h"
// #include "Game/IW5/IW5.h"
// #include "SearchPath/ISearchPath.h"
// #include "Utils/MemoryManager.h"
// #include <memory>
// namespace IW5
// {
// std::unique_ptr<AssetCreator<AssetXModel>> CreateXModelLoader(MemoryManager& memory, ISearchPath& searchPath);
// } // namespace IW5