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:
@@ -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
|
||||
|
Reference in New Issue
Block a user