mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-09-12 19:47:27 +00:00
refactor: do not nest asset namespaces in game namespaces
* Duplicated namespace names are kind of annoying
This commit is contained in:
@@ -282,10 +282,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::font_icon
|
||||
namespace font_icon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetFontIcon>> CreateCsvLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetFontIcon>> CreateCsvLoaderT6(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<CsvFontIconLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T6::font_icon
|
||||
} // namespace font_icon
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::font_icon
|
||||
namespace font_icon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetFontIcon>> CreateCsvLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T6::font_icon
|
||||
std::unique_ptr<AssetCreator<T6::AssetFontIcon>> CreateCsvLoaderT6(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace font_icon
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "JsonLoaderFontIconT6.h"
|
||||
|
||||
#include "FontIcon/FontIconCommon.h"
|
||||
#include "Game/T6/CommonT6.h"
|
||||
#include "Game/T6/FontIcon/FontIconCommonT6.h"
|
||||
#include "Game/T6/FontIcon/JsonFontIconT6.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
@@ -141,10 +141,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::font_icon
|
||||
namespace font_icon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetFontIcon>> CreateJsonLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetFontIcon>> CreateJsonLoaderT6(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<JsonFontIconLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T6::font_icon
|
||||
} // namespace font_icon
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::font_icon
|
||||
namespace font_icon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetFontIcon>> CreateJsonLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T6::font_icon
|
||||
std::unique_ptr<AssetCreator<T6::AssetFontIcon>> CreateJsonLoaderT6(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace font_icon
|
||||
|
@@ -12,7 +12,6 @@
|
||||
#include <zlib.h>
|
||||
|
||||
using namespace T6;
|
||||
using namespace ::image;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -27,7 +26,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto fileName = GetFileNameForAsset(assetName, ".iwi");
|
||||
const auto fileName = image::GetFileNameForAsset(assetName, ".iwi");
|
||||
const auto file = m_search_path.Open(fileName);
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
@@ -70,10 +69,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::image
|
||||
namespace image
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetImage>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetImage>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<ImageLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T6::image
|
||||
} // namespace image
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::image
|
||||
namespace image
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetImage>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T6::image
|
||||
std::unique_ptr<AssetCreator<T6::AssetImage>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace image
|
||||
|
@@ -12,7 +12,6 @@
|
||||
|
||||
using namespace nlohmann;
|
||||
using namespace T6;
|
||||
using namespace ::leaderboard;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -140,7 +139,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto file = m_search_path.Open(GetJsonFileNameForAsset(assetName));
|
||||
const auto file = m_search_path.Open(leaderboard::GetJsonFileNameForAsset(assetName));
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
|
||||
@@ -163,10 +162,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::leaderboard
|
||||
namespace leaderboard
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLeaderboard>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetLeaderboard>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<LeaderboardLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T6::leaderboard
|
||||
} // namespace leaderboard
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::leaderboard
|
||||
namespace leaderboard
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLeaderboard>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T6::leaderboard
|
||||
std::unique_ptr<AssetCreator<T6::AssetLeaderboard>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace leaderboard
|
||||
|
@@ -35,10 +35,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::localize
|
||||
namespace localize
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<LocalizeLoader>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace T6::localize
|
||||
} // namespace localize
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::localize
|
||||
namespace localize
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace T6::localize
|
||||
std::unique_ptr<AssetCreator<T6::AssetLocalize>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace localize
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace T6;
|
||||
using namespace ::material;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -23,7 +22,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto file = m_search_path.Open(GetFileNameForAssetName(assetName));
|
||||
const auto file = m_search_path.Open(material::GetFileNameForAssetName(assetName));
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
|
||||
@@ -46,10 +45,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::material
|
||||
namespace material
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<MaterialLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T6::material
|
||||
} // namespace material
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::material
|
||||
namespace material
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T6::material
|
||||
std::unique_ptr<AssetCreator<T6::AssetMaterial>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace material
|
||||
|
@@ -393,17 +393,17 @@ namespace T6
|
||||
{
|
||||
auto& memory = zone.Memory();
|
||||
|
||||
collection.AddAssetCreator(phys_preset::CreateRawLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(phys_preset::CreateGdtLoader(memory, gdt, zone));
|
||||
collection.AddAssetCreator(phys_constraints::CreateRawLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(phys_constraints::CreateGdtLoader(memory, searchPath, gdt, zone));
|
||||
collection.AddAssetCreator(phys_preset::CreateRawLoaderT6(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(phys_preset::CreateGdtLoaderT6(memory, gdt, zone));
|
||||
collection.AddAssetCreator(phys_constraints::CreateRawLoaderT6(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(phys_constraints::CreateGdtLoaderT6(memory, searchPath, gdt, zone));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderDestructibleDef>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderXAnim>(memory));
|
||||
collection.AddAssetCreator(xmodel::CreateXModelLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(material::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(xmodel::CreateLoaderT6(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(material::CreateLoaderT6(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderTechniqueSet>(memory));
|
||||
collection.AddAssetCreator(image::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(sound::CreateSoundBankLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(image::CreateLoaderT6(memory, searchPath));
|
||||
collection.AddAssetCreator(sound::CreateSoundBankLoaderT6(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderSoundPatch>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderClipMapPvs>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderComWorld>(memory));
|
||||
@@ -413,41 +413,41 @@ namespace T6
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderGfxWorld>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderLightDef>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderFont>(memory));
|
||||
collection.AddAssetCreator(font_icon::CreateCsvLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(font_icon::CreateJsonLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(font_icon::CreateCsvLoaderT6(memory, searchPath));
|
||||
collection.AddAssetCreator(font_icon::CreateJsonLoaderT6(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderMenuList>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderMenu>(memory));
|
||||
collection.AddAssetCreator(localize::CreateLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(weapon::CreateRawLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(weapon::CreateGdtLoader(memory, searchPath, gdt, zone));
|
||||
collection.AddAssetCreator(attachment::CreateRawLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(attachment::CreateGdtLoader(memory, searchPath, gdt, zone));
|
||||
collection.AddAssetCreator(attachment_unique::CreateRawLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(attachment_unique::CreateGdtLoader(memory, searchPath, gdt, zone));
|
||||
collection.AddAssetCreator(camo::CreateJsonLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(localize::CreateLoaderT6(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(weapon::CreateRawLoaderT6(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(weapon::CreateGdtLoaderT6(memory, searchPath, gdt, zone));
|
||||
collection.AddAssetCreator(attachment::CreateRawLoaderT6(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(attachment::CreateGdtLoaderT6(memory, searchPath, gdt, zone));
|
||||
collection.AddAssetCreator(attachment_unique::CreateRawLoaderT6(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(attachment_unique::CreateGdtLoaderT6(memory, searchPath, gdt, zone));
|
||||
collection.AddAssetCreator(camo::CreateJsonLoaderT6(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderSoundDriverGlobals>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderFx>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderImpactFx>(memory));
|
||||
collection.AddAssetCreator(raw_file::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(string_table::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(leaderboard::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(raw_file::CreateLoaderT6(memory, searchPath));
|
||||
collection.AddAssetCreator(string_table::CreateLoaderT6(memory, searchPath));
|
||||
collection.AddAssetCreator(leaderboard::CreateLoaderT6(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderXGlobals>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderDDL>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderGlasses>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderEmblemSet>(memory));
|
||||
collection.AddAssetCreator(script::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(vehicle::CreateRawLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(vehicle::CreateGdtLoader(memory, searchPath, gdt, zone));
|
||||
collection.AddAssetCreator(script::CreateLoaderT6(memory, searchPath));
|
||||
collection.AddAssetCreator(vehicle::CreateRawLoaderT6(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(vehicle::CreateGdtLoaderT6(memory, searchPath, gdt, zone));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderMemoryBlock>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderAddonMapEnts>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderTracer>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderSkinnedVerts>(memory));
|
||||
collection.AddAssetCreator(qdb::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(slug::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(qdb::CreateLoaderT6(memory, searchPath));
|
||||
collection.AddAssetCreator(slug::CreateLoaderT6(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderFootstepTable>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderFootstepFxTable>(memory));
|
||||
collection.AddAssetCreator(z_barrier::CreateRawLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(z_barrier::CreateGdtLoader(memory, searchPath, gdt, zone));
|
||||
collection.AddAssetCreator(z_barrier::CreateRawLoaderT6(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(z_barrier::CreateGdtLoaderT6(memory, searchPath, gdt, zone));
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
@@ -40,14 +40,14 @@ namespace
|
||||
|
||||
private:
|
||||
IGdtQueryable& m_gdt;
|
||||
T6::phys_constraints::InfoStringLoader m_info_string_loader;
|
||||
phys_constraints::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::phys_constraints
|
||||
namespace phys_constraints
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPhysConstraints>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetPhysConstraints>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
{
|
||||
return std::make_unique<GdtLoaderPhysConstraints>(memory, searchPath, gdt, zone);
|
||||
}
|
||||
} // namespace T6::phys_constraints
|
||||
} // namespace phys_constraints
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::phys_constraints
|
||||
namespace phys_constraints
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPhysConstraints>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace T6::phys_constraints
|
||||
std::unique_ptr<AssetCreator<T6::AssetPhysConstraints>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace phys_constraints
|
||||
|
@@ -76,16 +76,16 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace T6::phys_constraints
|
||||
namespace phys_constraints
|
||||
{
|
||||
InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
InfoStringLoaderT6::InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
: m_memory(memory),
|
||||
m_search_path(searchPath),
|
||||
m_zone(zone)
|
||||
{
|
||||
}
|
||||
|
||||
AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
AssetCreationResult InfoStringLoaderT6::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
{
|
||||
auto* physConstraints = m_memory.Alloc<PhysConstraints>();
|
||||
physConstraints->name = m_memory.Dup(assetName.c_str());
|
||||
@@ -110,4 +110,4 @@ namespace T6::phys_constraints
|
||||
|
||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
||||
}
|
||||
} // namespace T6::phys_constraints
|
||||
} // namespace phys_constraints
|
||||
|
@@ -4,12 +4,12 @@
|
||||
#include "Asset/AssetCreationResult.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace T6::phys_constraints
|
||||
namespace phys_constraints
|
||||
{
|
||||
class InfoStringLoader
|
||||
class InfoStringLoaderT6
|
||||
{
|
||||
public:
|
||||
InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context);
|
||||
|
||||
@@ -18,4 +18,4 @@ namespace T6::phys_constraints
|
||||
ISearchPath& m_search_path;
|
||||
Zone& m_zone;
|
||||
};
|
||||
} // namespace T6::phys_constraints
|
||||
} // namespace phys_constraints
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace T6;
|
||||
using namespace ::phys_constraints;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -26,7 +25,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto fileName = GetFileNameForAssetName(assetName);
|
||||
const auto fileName = phys_constraints::GetFileNameForAssetName(assetName);
|
||||
const auto file = m_search_path.Open(fileName);
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
@@ -43,14 +42,14 @@ namespace
|
||||
|
||||
private:
|
||||
ISearchPath& m_search_path;
|
||||
T6::phys_constraints::InfoStringLoader m_info_string_loader;
|
||||
phys_constraints::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::phys_constraints
|
||||
namespace phys_constraints
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPhysConstraints>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetPhysConstraints>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<RawLoaderPhysConstraints>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace T6::phys_constraints
|
||||
} // namespace phys_constraints
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::phys_constraints
|
||||
namespace phys_constraints
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPhysConstraints>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace T6::phys_constraints
|
||||
std::unique_ptr<AssetCreator<T6::AssetPhysConstraints>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace phys_constraints
|
||||
|
@@ -40,14 +40,14 @@ namespace
|
||||
|
||||
private:
|
||||
IGdtQueryable& m_gdt;
|
||||
T6::phys_preset::InfoStringLoader m_info_string_loader;
|
||||
phys_preset::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPhysPreset>> CreateGdtLoader(MemoryManager& memory, IGdtQueryable& gdt, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetPhysPreset>> CreateGdtLoaderT6(MemoryManager& memory, IGdtQueryable& gdt, Zone& zone)
|
||||
{
|
||||
return std::make_unique<GdtLoaderPhysPreset>(memory, gdt, zone);
|
||||
}
|
||||
} // namespace T6::phys_preset
|
||||
} // namespace phys_preset
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPhysPreset>> CreateGdtLoader(MemoryManager& memory, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace T6::phys_preset
|
||||
std::unique_ptr<AssetCreator<T6::AssetPhysPreset>> CreateGdtLoaderT6(MemoryManager& memory, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace phys_preset
|
||||
|
@@ -60,15 +60,15 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace T6::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
InfoStringLoader::InfoStringLoader(MemoryManager& memory, Zone& zone)
|
||||
InfoStringLoaderT6::InfoStringLoaderT6(MemoryManager& memory, Zone& zone)
|
||||
: m_memory(memory),
|
||||
m_zone(zone)
|
||||
{
|
||||
}
|
||||
|
||||
AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
AssetCreationResult InfoStringLoaderT6::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
{
|
||||
auto* physPreset = m_memory.Alloc<PhysPreset>();
|
||||
physPreset->name = m_memory.Dup(assetName.c_str());
|
||||
@@ -95,4 +95,4 @@ namespace T6::phys_preset
|
||||
|
||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
||||
}
|
||||
} // namespace T6::phys_preset
|
||||
} // namespace phys_preset
|
||||
|
@@ -4,12 +4,12 @@
|
||||
#include "Asset/AssetCreationResult.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace T6::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
class InfoStringLoader
|
||||
class InfoStringLoaderT6
|
||||
{
|
||||
public:
|
||||
InfoStringLoader(MemoryManager& memory, Zone& zone);
|
||||
InfoStringLoaderT6(MemoryManager& memory, Zone& zone);
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context);
|
||||
|
||||
@@ -17,4 +17,4 @@ namespace T6::phys_preset
|
||||
MemoryManager& m_memory;
|
||||
Zone& m_zone;
|
||||
};
|
||||
} // namespace T6::phys_preset
|
||||
} // namespace phys_preset
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace T6;
|
||||
using namespace ::phys_preset;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -26,7 +25,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto fileName = GetFileNameForAssetName(assetName);
|
||||
const auto fileName = phys_preset::GetFileNameForAssetName(assetName);
|
||||
const auto file = m_search_path.Open(fileName);
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
@@ -43,14 +42,14 @@ namespace
|
||||
|
||||
private:
|
||||
ISearchPath& m_search_path;
|
||||
T6::phys_preset::InfoStringLoader m_info_string_loader;
|
||||
phys_preset::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPhysPreset>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetPhysPreset>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<RawLoaderPhysPreset>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace T6::phys_preset
|
||||
} // namespace phys_preset
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPhysPreset>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace T6::phys_preset
|
||||
std::unique_ptr<AssetCreator<T6::AssetPhysPreset>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace phys_preset
|
||||
|
@@ -44,10 +44,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::qdb
|
||||
namespace qdb
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetQdb>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetQdb>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<QdbLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T6::qdb
|
||||
} // namespace qdb
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::qdb
|
||||
namespace qdb
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetQdb>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T6::qdb
|
||||
std::unique_ptr<AssetCreator<T6::AssetQdb>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace qdb
|
||||
|
@@ -114,10 +114,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<RawFileLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T6::raw_file
|
||||
} // namespace raw_file
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T6::raw_file
|
||||
std::unique_ptr<AssetCreator<T6::AssetRawFile>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace raw_file
|
||||
|
@@ -44,10 +44,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::script
|
||||
namespace script
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetScript>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetScript>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<ScriptLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T6::script
|
||||
} // namespace script
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::script
|
||||
namespace script
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetScript>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T6::script
|
||||
std::unique_ptr<AssetCreator<T6::AssetScript>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace script
|
||||
|
@@ -44,10 +44,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::slug
|
||||
namespace slug
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetSlug>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetSlug>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<SlugLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T6::slug
|
||||
} // namespace slug
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::slug
|
||||
namespace slug
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetSlug>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T6::slug
|
||||
std::unique_ptr<AssetCreator<T6::AssetSlug>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace slug
|
||||
|
@@ -1079,10 +1079,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::sound
|
||||
namespace sound
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetSoundBank>> CreateSoundBankLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetSoundBank>> CreateSoundBankLoaderT6(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<SoundBankLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T6::sound
|
||||
} // namespace sound
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::sound
|
||||
namespace sound
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetSoundBank>> CreateSoundBankLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T6::sound
|
||||
std::unique_ptr<AssetCreator<T6::AssetSoundBank>> CreateSoundBankLoaderT6(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace sound
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#include <cstring>
|
||||
|
||||
using namespace T6;
|
||||
using namespace ::string_table;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -27,7 +26,7 @@ namespace
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
|
||||
StringTableLoaderV3<StringTable, Common::Com_HashString> loader;
|
||||
string_table::StringTableLoaderV3<StringTable, Common::Com_HashString> loader;
|
||||
auto* stringTable = loader.LoadFromStream(assetName, m_memory, *file.m_stream);
|
||||
|
||||
return AssetCreationResult::Success(context.AddAsset<AssetStringTable>(assetName, stringTable));
|
||||
@@ -39,10 +38,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::string_table
|
||||
namespace string_table
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<StringTableLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T6::string_table
|
||||
} // namespace string_table
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::string_table
|
||||
namespace string_table
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T6::string_table
|
||||
std::unique_ptr<AssetCreator<T6::AssetStringTable>> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace string_table
|
||||
|
@@ -40,14 +40,14 @@ namespace
|
||||
|
||||
private:
|
||||
IGdtQueryable& m_gdt;
|
||||
T6::tracer::InfoStringLoader m_info_string_loader;
|
||||
tracer::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::tracer
|
||||
namespace tracer
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetTracer>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetTracer>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
{
|
||||
return std::make_unique<GdtLoaderTracer>(memory, searchPath, gdt, zone);
|
||||
}
|
||||
} // namespace T6::tracer
|
||||
} // namespace tracer
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::tracer
|
||||
namespace tracer
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetTracer>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace T6::tracer
|
||||
std::unique_ptr<AssetCreator<T6::AssetTracer>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace tracer
|
||||
|
@@ -12,7 +12,6 @@
|
||||
#include <limits>
|
||||
|
||||
using namespace T6;
|
||||
using namespace ::tracer;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -48,16 +47,16 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::tracer
|
||||
namespace tracer
|
||||
{
|
||||
InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
InfoStringLoaderT6::InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
: m_memory(memory),
|
||||
m_search_path(searchPath),
|
||||
m_zone(zone)
|
||||
{
|
||||
}
|
||||
|
||||
AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
AssetCreationResult InfoStringLoaderT6::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
{
|
||||
auto* tracer = m_memory.Alloc<TracerDef>();
|
||||
tracer->name = m_memory.Dup(assetName.c_str());
|
||||
@@ -75,4 +74,4 @@ namespace T6::tracer
|
||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
||||
}
|
||||
|
||||
} // namespace T6::tracer
|
||||
} // namespace tracer
|
||||
|
@@ -4,12 +4,12 @@
|
||||
#include "Asset/AssetCreationResult.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace T6::tracer
|
||||
namespace tracer
|
||||
{
|
||||
class InfoStringLoader
|
||||
class InfoStringLoaderT6
|
||||
{
|
||||
public:
|
||||
InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context);
|
||||
|
||||
@@ -18,4 +18,4 @@ namespace T6::tracer
|
||||
ISearchPath& m_search_path;
|
||||
Zone& m_zone;
|
||||
};
|
||||
} // namespace T6::tracer
|
||||
} // namespace tracer
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace T6;
|
||||
using namespace ::tracer;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -26,7 +25,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto fileName = GetFileNameForAssetName(assetName);
|
||||
const auto fileName = tracer::GetFileNameForAssetName(assetName);
|
||||
const auto file = m_search_path.Open(fileName);
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
@@ -43,14 +42,14 @@ namespace
|
||||
|
||||
private:
|
||||
ISearchPath& m_search_path;
|
||||
T6::tracer::InfoStringLoader m_info_string_loader;
|
||||
tracer::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::tracer
|
||||
namespace tracer
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetTracer>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetTracer>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<RawLoaderTracer>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace T6::tracer
|
||||
} // namespace tracer
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::tracer
|
||||
namespace tracer
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetTracer>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace T6::tracer
|
||||
std::unique_ptr<AssetCreator<T6::AssetTracer>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace tracer
|
||||
|
@@ -40,14 +40,14 @@ namespace
|
||||
|
||||
private:
|
||||
IGdtQueryable& m_gdt;
|
||||
T6::vehicle::InfoStringLoader m_info_string_loader;
|
||||
vehicle::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::vehicle
|
||||
namespace vehicle
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetVehicle>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetVehicle>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
{
|
||||
return std::make_unique<GdtLoaderVehicle>(memory, searchPath, gdt, zone);
|
||||
}
|
||||
} // namespace T6::vehicle
|
||||
} // namespace vehicle
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::vehicle
|
||||
namespace vehicle
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetVehicle>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace T6::vehicle
|
||||
std::unique_ptr<AssetCreator<T6::AssetVehicle>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace vehicle
|
||||
|
@@ -107,16 +107,16 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::vehicle
|
||||
namespace vehicle
|
||||
{
|
||||
InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
InfoStringLoaderT6::InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
: m_memory(memory),
|
||||
m_search_path(searchPath),
|
||||
m_zone(zone)
|
||||
{
|
||||
}
|
||||
|
||||
AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
AssetCreationResult InfoStringLoaderT6::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
{
|
||||
auto* vehicleDef = m_memory.Alloc<VehicleDef>();
|
||||
vehicleDef->name = m_memory.Dup(assetName.c_str());
|
||||
@@ -133,4 +133,4 @@ namespace T6::vehicle
|
||||
|
||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
||||
}
|
||||
} // namespace T6::vehicle
|
||||
} // namespace vehicle
|
||||
|
@@ -4,12 +4,12 @@
|
||||
#include "Asset/AssetCreationResult.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace T6::vehicle
|
||||
namespace vehicle
|
||||
{
|
||||
class InfoStringLoader
|
||||
class InfoStringLoaderT6
|
||||
{
|
||||
public:
|
||||
InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context);
|
||||
|
||||
@@ -18,4 +18,4 @@ namespace T6::vehicle
|
||||
ISearchPath& m_search_path;
|
||||
Zone& m_zone;
|
||||
};
|
||||
} // namespace T6::vehicle
|
||||
} // namespace vehicle
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace T6;
|
||||
using namespace ::vehicle;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -26,7 +25,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto fileName = GetFileNameForAssetName(assetName);
|
||||
const auto fileName = vehicle::GetFileNameForAssetName(assetName);
|
||||
const auto file = m_search_path.Open(fileName);
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
@@ -43,14 +42,14 @@ namespace
|
||||
|
||||
private:
|
||||
ISearchPath& m_search_path;
|
||||
T6::vehicle::InfoStringLoader m_info_string_loader;
|
||||
vehicle::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::vehicle
|
||||
namespace vehicle
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetVehicle>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetVehicle>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<RawLoaderVehicle>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace T6::vehicle
|
||||
} // namespace vehicle
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::vehicle
|
||||
namespace vehicle
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetVehicle>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace T6::vehicle
|
||||
std::unique_ptr<AssetCreator<T6::AssetVehicle>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace vehicle
|
||||
|
@@ -40,14 +40,14 @@ namespace
|
||||
|
||||
private:
|
||||
IGdtQueryable& m_gdt;
|
||||
T6::attachment::InfoStringLoader m_info_string_loader;
|
||||
attachment::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::attachment
|
||||
namespace attachment
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetAttachment>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetAttachment>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
{
|
||||
return std::make_unique<GdtLoaderAttachment>(memory, searchPath, gdt, zone);
|
||||
}
|
||||
} // namespace T6::attachment
|
||||
} // namespace attachment
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::attachment
|
||||
namespace attachment
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetAttachment>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace T6::attachment
|
||||
std::unique_ptr<AssetCreator<T6::AssetAttachment>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace attachment
|
||||
|
@@ -93,16 +93,16 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace T6::attachment
|
||||
namespace attachment
|
||||
{
|
||||
InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
InfoStringLoaderT6::InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
: m_memory(memory),
|
||||
m_search_path(searchPath),
|
||||
m_zone(zone)
|
||||
{
|
||||
}
|
||||
|
||||
AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
AssetCreationResult InfoStringLoaderT6::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
{
|
||||
auto* attachment = m_memory.Alloc<WeaponAttachment>();
|
||||
attachment->szInternalName = m_memory.Dup(assetName.c_str());
|
||||
@@ -121,4 +121,4 @@ namespace T6::attachment
|
||||
|
||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
||||
}
|
||||
} // namespace T6::attachment
|
||||
} // namespace attachment
|
||||
|
@@ -4,12 +4,12 @@
|
||||
#include "Asset/AssetCreationResult.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace T6::attachment
|
||||
namespace attachment
|
||||
{
|
||||
class InfoStringLoader
|
||||
class InfoStringLoaderT6
|
||||
{
|
||||
public:
|
||||
InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context);
|
||||
|
||||
@@ -18,4 +18,4 @@ namespace T6::attachment
|
||||
ISearchPath& m_search_path;
|
||||
Zone& m_zone;
|
||||
};
|
||||
} // namespace T6::attachment
|
||||
} // namespace attachment
|
||||
|
@@ -43,14 +43,14 @@ namespace
|
||||
|
||||
private:
|
||||
ISearchPath& m_search_path;
|
||||
T6::attachment::InfoStringLoader m_info_string_loader;
|
||||
attachment::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::attachment
|
||||
namespace attachment
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetAttachment>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetAttachment>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<RawLoaderAttachment>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace T6::attachment
|
||||
} // namespace attachment
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::attachment
|
||||
namespace attachment
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetAttachment>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace T6::attachment
|
||||
std::unique_ptr<AssetCreator<T6::AssetAttachment>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace attachment
|
||||
|
@@ -40,14 +40,14 @@ namespace
|
||||
|
||||
private:
|
||||
IGdtQueryable& m_gdt;
|
||||
T6::attachment_unique::InfoStringLoader m_info_string_loader;
|
||||
attachment_unique::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::attachment_unique
|
||||
namespace attachment_unique
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetAttachmentUnique>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetAttachmentUnique>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
{
|
||||
return std::make_unique<GdtLoaderAttachmentUnique>(memory, searchPath, gdt, zone);
|
||||
}
|
||||
} // namespace T6::attachment_unique
|
||||
} // namespace attachment_unique
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::attachment_unique
|
||||
namespace attachment_unique
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetAttachmentUnique>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace T6::attachment_unique
|
||||
std::unique_ptr<AssetCreator<T6::AssetAttachmentUnique>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace attachment_unique
|
||||
|
@@ -141,7 +141,7 @@ namespace
|
||||
{
|
||||
// combinedAttachmentTypeMask
|
||||
std::vector<eAttachment> attachmentsFromName;
|
||||
if (!T6::attachment_unique::ExtractAttachmentsFromAssetName(assetName, attachmentsFromName))
|
||||
if (!attachment_unique::ExtractAttachmentsFromAssetNameT6(assetName, attachmentsFromName))
|
||||
{
|
||||
std::cerr << std::format("Failed to determine attachments from attachment unique name \"{}\"\n", assetName);
|
||||
return false;
|
||||
@@ -159,9 +159,9 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace T6::attachment_unique
|
||||
namespace attachment_unique
|
||||
{
|
||||
bool ExtractAttachmentsFromAssetName(const std::string& assetName, std::vector<eAttachment>& attachmentList)
|
||||
bool ExtractAttachmentsFromAssetNameT6(const std::string& assetName, std::vector<eAttachment>& attachmentList)
|
||||
{
|
||||
std::vector<std::string> parts;
|
||||
|
||||
@@ -210,14 +210,14 @@ namespace T6::attachment_unique
|
||||
return true;
|
||||
}
|
||||
|
||||
InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
InfoStringLoaderT6::InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
: m_memory(memory),
|
||||
m_search_path(searchPath),
|
||||
m_zone(zone)
|
||||
{
|
||||
}
|
||||
|
||||
AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
AssetCreationResult InfoStringLoaderT6::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
{
|
||||
auto* attachmentUniqueFull = m_memory.Alloc<WeaponAttachmentUniqueFull>();
|
||||
attachmentUniqueFull->attachment.szInternalName = m_memory.Dup(assetName.c_str());
|
||||
@@ -244,4 +244,4 @@ namespace T6::attachment_unique
|
||||
|
||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
||||
}
|
||||
} // namespace T6::attachment_unique
|
||||
} // namespace attachment_unique
|
||||
|
@@ -7,14 +7,14 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace T6::attachment_unique
|
||||
namespace attachment_unique
|
||||
{
|
||||
bool ExtractAttachmentsFromAssetName(const std::string& assetName, std::vector<eAttachment>& attachmentList);
|
||||
bool ExtractAttachmentsFromAssetNameT6(const std::string& assetName, std::vector<T6::eAttachment>& attachmentList);
|
||||
|
||||
class InfoStringLoader
|
||||
class InfoStringLoaderT6
|
||||
{
|
||||
public:
|
||||
InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context);
|
||||
|
||||
@@ -23,4 +23,4 @@ namespace T6::attachment_unique
|
||||
ISearchPath& m_search_path;
|
||||
Zone& m_zone;
|
||||
};
|
||||
} // namespace T6::attachment_unique
|
||||
} // namespace attachment_unique
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace T6;
|
||||
using namespace ::attachment_unique;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -26,7 +25,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto fileName = GetFileNameForAssetName(assetName);
|
||||
const auto fileName = attachment_unique::GetFileNameForAssetName(assetName);
|
||||
const auto file = m_search_path.Open(fileName);
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
@@ -43,14 +42,14 @@ namespace
|
||||
|
||||
private:
|
||||
ISearchPath& m_search_path;
|
||||
T6::attachment_unique::InfoStringLoader m_info_string_loader;
|
||||
attachment_unique::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::attachment_unique
|
||||
namespace attachment_unique
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetAttachmentUnique>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetAttachmentUnique>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<RawLoader>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace T6::attachment_unique
|
||||
} // namespace attachment_unique
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::attachment_unique
|
||||
namespace attachment_unique
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetAttachmentUnique>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace T6::attachment_unique
|
||||
std::unique_ptr<AssetCreator<T6::AssetAttachmentUnique>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace attachment_unique
|
||||
|
@@ -12,7 +12,6 @@
|
||||
|
||||
using namespace nlohmann;
|
||||
using namespace T6;
|
||||
using namespace ::camo;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -253,7 +252,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto file = m_search_path.Open(GetJsonFileNameForAssetName(assetName));
|
||||
const auto file = m_search_path.Open(camo::GetJsonFileNameForAssetName(assetName));
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
|
||||
@@ -277,10 +276,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::camo
|
||||
namespace camo
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeaponCamo>> CreateJsonLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetWeaponCamo>> CreateJsonLoaderT6(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<WeaponCamoLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T6::camo
|
||||
} // namespace camo
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::camo
|
||||
namespace camo
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeaponCamo>> CreateJsonLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T6::camo
|
||||
std::unique_ptr<AssetCreator<T6::AssetWeaponCamo>> CreateJsonLoaderT6(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace camo
|
||||
|
@@ -40,14 +40,14 @@ namespace
|
||||
|
||||
private:
|
||||
IGdtQueryable& m_gdt;
|
||||
T6::weapon::InfoStringLoader m_info_string_loader;
|
||||
weapon::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::weapon
|
||||
namespace weapon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
{
|
||||
return std::make_unique<GdtLoaderWeapon>(memory, searchPath, gdt, zone);
|
||||
}
|
||||
} // namespace T6::weapon
|
||||
} // namespace weapon
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::weapon
|
||||
namespace weapon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace T6::weapon
|
||||
std::unique_ptr<AssetCreator<T6::AssetWeapon>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace weapon
|
||||
|
@@ -568,7 +568,7 @@ namespace
|
||||
&& weapon.attachmentUniques[attachmentUniqueIndex]->attachmentType != attachmentUnique.attachmentType)
|
||||
{
|
||||
std::vector<eAttachment> attachments;
|
||||
if (T6::attachment_unique::ExtractAttachmentsFromAssetName(weapon.attachmentUniques[attachmentUniqueIndex]->szInternalName, attachments)
|
||||
if (attachment_unique::ExtractAttachmentsFromAssetNameT6(weapon.attachmentUniques[attachmentUniqueIndex]->szInternalName, attachments)
|
||||
&& attachments.front() == attachmentUnique.attachmentType)
|
||||
{
|
||||
if (lastSibling == nullptr)
|
||||
@@ -599,16 +599,16 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace T6::weapon
|
||||
namespace weapon
|
||||
{
|
||||
InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
InfoStringLoaderT6::InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
: m_memory(memory),
|
||||
m_search_path(searchPath),
|
||||
m_zone(zone)
|
||||
{
|
||||
}
|
||||
|
||||
AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
AssetCreationResult InfoStringLoaderT6::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
{
|
||||
auto* weaponFullDef = m_memory.Alloc<WeaponFullDef>();
|
||||
weaponFullDef->weapVariantDef.szInternalName = m_memory.Dup(assetName.c_str());
|
||||
@@ -632,4 +632,4 @@ namespace T6::weapon
|
||||
|
||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
||||
}
|
||||
} // namespace T6::weapon
|
||||
} // namespace weapon
|
||||
|
@@ -4,12 +4,12 @@
|
||||
#include "Asset/AssetCreationResult.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace T6::weapon
|
||||
namespace weapon
|
||||
{
|
||||
class InfoStringLoader
|
||||
class InfoStringLoaderT6
|
||||
{
|
||||
public:
|
||||
InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context);
|
||||
|
||||
@@ -18,4 +18,4 @@ namespace T6::weapon
|
||||
ISearchPath& m_search_path;
|
||||
Zone& m_zone;
|
||||
};
|
||||
} // namespace T6::weapon
|
||||
} // namespace weapon
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace T6;
|
||||
using namespace ::weapon;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -26,7 +25,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto fileName = GetFileNameForAssetName(assetName);
|
||||
const auto fileName = weapon::GetFileNameForAssetName(assetName);
|
||||
const auto file = m_search_path.Open(fileName);
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
@@ -43,14 +42,14 @@ namespace
|
||||
|
||||
private:
|
||||
ISearchPath& m_search_path;
|
||||
T6::weapon::InfoStringLoader m_info_string_loader;
|
||||
weapon::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::weapon
|
||||
namespace weapon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<RawLoader>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace T6::weapon
|
||||
} // namespace weapon
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::weapon
|
||||
namespace weapon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace T6::weapon
|
||||
std::unique_ptr<AssetCreator<T6::AssetWeapon>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace weapon
|
||||
|
@@ -40,14 +40,14 @@ namespace
|
||||
|
||||
private:
|
||||
IGdtQueryable& m_gdt;
|
||||
T6::z_barrier::InfoStringLoader m_info_string_loader;
|
||||
z_barrier::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::z_barrier
|
||||
namespace z_barrier
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetZBarrier>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetZBarrier>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
{
|
||||
return std::make_unique<GdtLoaderZBarrier>(memory, searchPath, gdt, zone);
|
||||
}
|
||||
} // namespace T6::z_barrier
|
||||
} // namespace z_barrier
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::z_barrier
|
||||
namespace z_barrier
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetZBarrier>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace T6::z_barrier
|
||||
std::unique_ptr<AssetCreator<T6::AssetZBarrier>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace z_barrier
|
||||
|
@@ -55,16 +55,16 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace T6::z_barrier
|
||||
namespace z_barrier
|
||||
{
|
||||
InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
InfoStringLoaderT6::InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
: m_memory(memory),
|
||||
m_search_path(searchPath),
|
||||
m_zone(zone)
|
||||
{
|
||||
}
|
||||
|
||||
AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
AssetCreationResult InfoStringLoaderT6::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
{
|
||||
auto* zbarrier = m_memory.Alloc<ZBarrierDef>();
|
||||
zbarrier->name = m_memory.Dup(assetName.c_str());
|
||||
@@ -83,4 +83,4 @@ namespace T6::z_barrier
|
||||
|
||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
||||
}
|
||||
} // namespace T6::z_barrier
|
||||
} // namespace z_barrier
|
||||
|
@@ -4,12 +4,12 @@
|
||||
#include "Asset/AssetCreationResult.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace T6::z_barrier
|
||||
namespace z_barrier
|
||||
{
|
||||
class InfoStringLoader
|
||||
class InfoStringLoaderT6
|
||||
{
|
||||
public:
|
||||
InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context);
|
||||
|
||||
@@ -18,4 +18,4 @@ namespace T6::z_barrier
|
||||
ISearchPath& m_search_path;
|
||||
Zone& m_zone;
|
||||
};
|
||||
} // namespace T6::z_barrier
|
||||
} // namespace z_barrier
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace T6;
|
||||
using namespace ::z_barrier;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -26,7 +25,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto fileName = GetFileNameForAssetName(assetName);
|
||||
const auto fileName = z_barrier::GetFileNameForAssetName(assetName);
|
||||
const auto file = m_search_path.Open(fileName);
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
@@ -43,14 +42,14 @@ namespace
|
||||
|
||||
private:
|
||||
ISearchPath& m_search_path;
|
||||
T6::z_barrier::InfoStringLoader m_info_string_loader;
|
||||
z_barrier::InfoStringLoaderT6 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::z_barrier
|
||||
namespace z_barrier
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetZBarrier>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetZBarrier>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<RawLoaderZBarrier>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace T6::z_barrier
|
||||
} // namespace z_barrier
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::z_barrier
|
||||
namespace z_barrier
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetZBarrier>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace T6::z_barrier
|
||||
std::unique_ptr<AssetCreator<T6::AssetZBarrier>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace z_barrier
|
||||
|
Reference in New Issue
Block a user