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

refactor: streamline T6 asset loading

This commit is contained in:
Jan Laupetin
2025-08-04 23:48:30 +02:00
parent 472e59991f
commit a5024d40b0
59 changed files with 380 additions and 383 deletions

View File

@@ -2,6 +2,7 @@
#include "Game/T6/CommonT6.h"
#include "Game/T6/T6.h"
#include "Image/ImageCommon.h"
#include "Image/IwiLoader.h"
#include <cstring>
@@ -11,6 +12,7 @@
#include <zlib.h>
using namespace T6;
using namespace ::image;
namespace
{
@@ -25,7 +27,7 @@ namespace
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
{
const auto fileName = std::format("images/{}.iwi", assetName);
const auto fileName = GetFileNameForAsset(assetName, ".iwi");
const auto file = m_search_path.Open(fileName);
if (!file.IsOpen())
return AssetCreationResult::NoAction();
@@ -68,10 +70,10 @@ namespace
};
} // namespace
namespace T6
namespace T6::image
{
std::unique_ptr<AssetCreator<AssetImage>> CreateImageLoader(MemoryManager& memory, ISearchPath& searchPath)
std::unique_ptr<AssetCreator<AssetImage>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
{
return std::make_unique<ImageLoader>(memory, searchPath);
}
} // namespace T6
} // namespace T6::image