mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-03-18 19:03:03 +00:00
refactor: do not nest asset namespaces in game namespaces
* Duplicated namespace names are kind of annoying
This commit is contained in:
@@ -39,14 +39,14 @@ namespace
|
||||
|
||||
private:
|
||||
IGdtQueryable& m_gdt;
|
||||
IW4::phys_preset::InfoStringLoader m_info_string_loader;
|
||||
phys_preset::InfoStringLoaderIW4 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPhysPreset>> CreateGdtLoader(MemoryManager& memory, IGdtQueryable& gdt, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<IW4::AssetPhysPreset>> CreateGdtLoaderIW4(MemoryManager& memory, IGdtQueryable& gdt, Zone& zone)
|
||||
{
|
||||
return std::make_unique<GdtLoaderPhysPreset>(memory, gdt, zone);
|
||||
}
|
||||
} // namespace IW4::phys_preset
|
||||
} // namespace phys_preset
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPhysPreset>> CreateGdtLoader(MemoryManager& memory, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace IW4::phys_preset
|
||||
std::unique_ptr<AssetCreator<IW4::AssetPhysPreset>> CreateGdtLoaderIW4(MemoryManager& memory, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace phys_preset
|
||||
|
||||
@@ -58,15 +58,15 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW4::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
InfoStringLoader::InfoStringLoader(MemoryManager& memory, Zone& zone)
|
||||
InfoStringLoaderIW4::InfoStringLoaderIW4(MemoryManager& memory, Zone& zone)
|
||||
: m_memory(memory),
|
||||
m_zone(zone)
|
||||
{
|
||||
}
|
||||
|
||||
AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
AssetCreationResult InfoStringLoaderIW4::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
{
|
||||
PhysPresetInfo presetInfo;
|
||||
std::memset(&presetInfo, 0, sizeof(presetInfo));
|
||||
@@ -87,4 +87,4 @@ namespace IW4::phys_preset
|
||||
|
||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
||||
}
|
||||
} // namespace IW4::phys_preset
|
||||
} // namespace phys_preset
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#include "Asset/AssetCreationResult.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace IW4::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
class InfoStringLoader
|
||||
class InfoStringLoaderIW4
|
||||
{
|
||||
public:
|
||||
InfoStringLoader(MemoryManager& memory, Zone& zone);
|
||||
InfoStringLoaderIW4(MemoryManager& memory, Zone& zone);
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context);
|
||||
|
||||
@@ -17,4 +17,4 @@ namespace IW4::phys_preset
|
||||
MemoryManager& m_memory;
|
||||
Zone& m_zone;
|
||||
};
|
||||
} // namespace IW4::phys_preset
|
||||
} // namespace phys_preset
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::phys_preset;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -25,7 +24,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();
|
||||
@@ -42,14 +41,14 @@ namespace
|
||||
|
||||
private:
|
||||
ISearchPath& m_search_path;
|
||||
IW4::phys_preset::InfoStringLoader m_info_string_loader;
|
||||
phys_preset::InfoStringLoaderIW4 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPhysPreset>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetPhysPreset>> CreateRawLoaderIW4(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<RawLoaderPhysPreset>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace IW4::phys_preset
|
||||
} // namespace phys_preset
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPhysPreset>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace IW4::phys_preset
|
||||
std::unique_ptr<AssetCreator<IW4::AssetPhysPreset>> CreateRawLoaderIW4(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace phys_preset
|
||||
|
||||
Reference in New Issue
Block a user