2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-05-17 07:21:43 +00:00

refactor: do not nest asset namespaces in game namespaces

* Duplicated namespace names are kind of annoying
This commit is contained in:
Jan Laupetin
2025-08-06 00:50:35 +02:00
parent 33c09dfe61
commit 46fb919a52
336 changed files with 1430 additions and 1480 deletions
@@ -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