2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-11-30 16:27:47 +00:00

chore: implement obj loading skeleton with localize asset

This commit is contained in:
Jan
2024-12-23 22:55:58 +01:00
parent 673db0592f
commit c524cb007a
64 changed files with 1238 additions and 1038 deletions

View File

@@ -1,36 +0,0 @@
#include "AssetLoaderLocalizeEntry.h"
#include "Localize/LocalizeCommonAssetLoader.h"
using namespace IW5;
XAssetInfoGeneric* AssetLoaderLocalizeEntry::LoadFromGlobalAssetPools(const std::string& assetName) const
{
return nullptr;
}
void* AssetLoaderLocalizeEntry::CreateEmptyAsset(const std::string& assetName, MemoryManager* memory)
{
return nullptr;
}
bool AssetLoaderLocalizeEntry::CanLoadFromRaw() const
{
return true;
}
bool AssetLoaderLocalizeEntry::LoadFromRaw(
const std::string& assetName, ISearchPath* searchPath, MemoryManager* memory, IAssetLoadingManager* manager, Zone* zone) const
{
const LocalizeCommonAssetLoader commonLoader(
[memory, manager](const CommonLocalizeEntry& entry)
{
auto* localizeEntry = memory->Create<LocalizeEntry>();
localizeEntry->name = memory->Dup(entry.m_key.c_str());
localizeEntry->value = memory->Dup(entry.m_value.c_str());
manager->AddAsset<AssetLocalize>(entry.m_key, localizeEntry);
});
return commonLoader.LoadLocalizeAsset(assetName, searchPath, manager, zone);
}

View File

@@ -1,19 +0,0 @@
#pragma once
#include "AssetLoading/BasicAssetLoader.h"
#include "AssetLoading/IAssetLoadingManager.h"
#include "Game/IW5/IW5.h"
#include "SearchPath/ISearchPath.h"
namespace IW5
{
class AssetLoaderLocalizeEntry final : public BasicAssetLoader<AssetLocalize>
{
public:
_NODISCARD XAssetInfoGeneric* LoadFromGlobalAssetPools(const std::string& assetName) const override;
_NODISCARD void* CreateEmptyAsset(const std::string& assetName, MemoryManager* memory) override;
_NODISCARD bool CanLoadFromRaw() const override;
bool
LoadFromRaw(const std::string& assetName, ISearchPath* searchPath, MemoryManager* memory, IAssetLoadingManager* manager, Zone* zone) const override;
};
} // namespace IW5