mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-08-30 21:53:15 +00:00
refactor: do not nest asset namespaces in game namespaces
* Duplicated namespace names are kind of annoying
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#include "FontIconCommonT6.h"
|
||||
#include "FontIconCommon.h"
|
||||
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
namespace T6::font_icon
|
||||
namespace font_icon
|
||||
{
|
||||
std::string GetJsonFileNameForAssetName(const std::string& assetName)
|
||||
{
|
||||
@@ -20,4 +20,4 @@ namespace T6::font_icon
|
||||
|
||||
return assetName;
|
||||
}
|
||||
} // namespace T6::font_icon
|
||||
} // namespace font_icon
|
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace T6::font_icon
|
||||
namespace font_icon
|
||||
{
|
||||
std::string GetJsonFileNameForAssetName(const std::string& assetName);
|
||||
}
|
@@ -48,7 +48,7 @@ namespace
|
||||
m_registration(registration),
|
||||
m_state_map_cache(context.GetZoneAssetCreationState<::techset::TechniqueStateMapCache>()),
|
||||
m_base_state_bits{},
|
||||
m_techset_creator(IW4::techset::CreateLoader(memory, searchPath))
|
||||
m_techset_creator(techset::CreateLoaderIW4(memory, searchPath))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1325,7 +1325,7 @@ namespace
|
||||
std::vector<MaterialTextureDef> m_textures;
|
||||
std::vector<MaterialConstantDef> m_constants;
|
||||
|
||||
std::unique_ptr<::IW4::techset::ICreator> m_techset_creator;
|
||||
std::unique_ptr<techset::ICreatorIW4> m_techset_creator;
|
||||
};
|
||||
|
||||
class MaterialLoader final : public AssetCreator<AssetMaterial>
|
||||
@@ -1375,10 +1375,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::material
|
||||
namespace material
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateCompiler(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt)
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateCompilerIW4(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt)
|
||||
{
|
||||
return std::make_unique<MaterialLoader>(memory, searchPath, gdt);
|
||||
}
|
||||
} // namespace IW4::material
|
||||
} // namespace material
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "SearchPath/ISearchPath.h"
|
||||
#include "Utils/MemoryManager.h"
|
||||
|
||||
namespace IW4::material
|
||||
namespace material
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateCompiler(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt);
|
||||
} // namespace IW4::material
|
||||
std::unique_ptr<AssetCreator<IW4::AssetMaterial>> CreateCompilerIW4(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt);
|
||||
} // namespace material
|
||||
|
@@ -17,10 +17,10 @@ namespace
|
||||
auto& memory = zone.Memory();
|
||||
|
||||
#ifdef EXPERIMENTAL_MATERIAL_COMPILATION
|
||||
collection.AddAssetCreator(material::CreateCompiler(memory, searchPath, gdt));
|
||||
collection.AddAssetCreator(IW4::techset::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(material::CreateCompilerIW4(memory, searchPath, gdt));
|
||||
collection.AddAssetCreator(techset::CreateLoaderIW4(memory, searchPath));
|
||||
#endif
|
||||
collection.AddAssetCreator(vertex_decl::CreateLoader(memory));
|
||||
collection.AddAssetCreator(vertex_decl::CreateLoaderIW4(memory));
|
||||
}
|
||||
|
||||
void ConfigurePostProcessors(AssetCreatorCollection& collection,
|
||||
|
@@ -203,7 +203,7 @@ namespace
|
||||
ISearchPath& searchPath,
|
||||
MemoryManager& memory,
|
||||
AssetCreationContext& context,
|
||||
IW4::techset::ICreator* techsetCreator)
|
||||
techset::ICreatorIW4* techsetCreator)
|
||||
: m_technique_name(techniqueName),
|
||||
m_search_path(searchPath),
|
||||
m_memory(memory),
|
||||
@@ -1026,13 +1026,13 @@ namespace
|
||||
TechniqueZoneLoadingState& m_zone_state;
|
||||
TechniqueStateMapCache& m_state_map_cache;
|
||||
ShaderInfoFromFileSystemCacheState& m_shader_info_cache;
|
||||
IW4::techset::ICreator* m_techset_creator;
|
||||
techset::ICreatorIW4* m_techset_creator;
|
||||
};
|
||||
|
||||
class TechniqueLoader
|
||||
{
|
||||
public:
|
||||
TechniqueLoader(ISearchPath& searchPath, MemoryManager& memory, AssetCreationContext& context, IW4::techset::ICreator* techsetCreator)
|
||||
TechniqueLoader(ISearchPath& searchPath, MemoryManager& memory, AssetCreationContext& context, techset::ICreatorIW4* techsetCreator)
|
||||
: m_search_path(searchPath),
|
||||
m_memory(memory),
|
||||
m_context(context),
|
||||
@@ -1260,10 +1260,10 @@ namespace
|
||||
MemoryManager& m_memory;
|
||||
AssetCreationContext& m_context;
|
||||
TechniqueZoneLoadingState& m_zone_state;
|
||||
IW4::techset::ICreator* m_techset_creator;
|
||||
techset::ICreatorIW4* m_techset_creator;
|
||||
};
|
||||
|
||||
class TechsetLoader final : public IW4::techset::ICreator
|
||||
class TechsetLoader final : public techset::ICreatorIW4
|
||||
{
|
||||
public:
|
||||
TechsetLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
@@ -1369,10 +1369,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::techset
|
||||
namespace techset
|
||||
{
|
||||
std::unique_ptr<ICreator> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<ICreatorIW4> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<TechsetLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW4::techset
|
||||
} // namespace techset
|
||||
|
@@ -10,17 +10,17 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace IW4::techset
|
||||
namespace techset
|
||||
{
|
||||
class ICreator : public AssetCreator<AssetTechniqueSet>
|
||||
class ICreatorIW4 : public AssetCreator<IW4::AssetTechniqueSet>
|
||||
{
|
||||
public:
|
||||
ICreator() = default;
|
||||
virtual ~ICreator() = default;
|
||||
ICreatorIW4() = default;
|
||||
virtual ~ICreatorIW4() = default;
|
||||
|
||||
virtual ::techset::TechsetDefinition* LoadTechsetDefinition(const std::string& assetName, AssetCreationContext& context, bool& failure) = 0;
|
||||
virtual TechsetDefinition* LoadTechsetDefinition(const std::string& assetName, AssetCreationContext& context, bool& failure) = 0;
|
||||
virtual const state_map::StateMapDefinition* LoadStateMapDefinition(const std::string& stateMapName, AssetCreationContext& context) = 0;
|
||||
};
|
||||
|
||||
std::unique_ptr<ICreator> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW4::techset
|
||||
std::unique_ptr<ICreatorIW4> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace techset
|
||||
|
@@ -92,10 +92,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::vertex_decl
|
||||
namespace vertex_decl
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetVertexDecl>> CreateLoader(MemoryManager& memory)
|
||||
std::unique_ptr<AssetCreator<AssetVertexDecl>> CreateLoaderIW4(MemoryManager& memory)
|
||||
{
|
||||
return std::make_unique<LoaderVertexDecl>(memory);
|
||||
}
|
||||
} // namespace IW4::vertex_decl
|
||||
} // namespace vertex_decl
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::vertex_decl
|
||||
namespace vertex_decl
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetVertexDecl>> CreateLoader(MemoryManager& memory);
|
||||
} // namespace IW4::vertex_decl
|
||||
std::unique_ptr<AssetCreator<IW4::AssetVertexDecl>> CreateLoaderIW4(MemoryManager& memory);
|
||||
} // namespace vertex_decl
|
||||
|
@@ -71,11 +71,11 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::key_value_pairs
|
||||
namespace key_value_pairs
|
||||
{
|
||||
std::unique_ptr<IAssetCreator>
|
||||
CreateCompiler(MemoryManager& memory, const Zone& zone, const ZoneDefinition& zoneDefinition, ZoneAssetCreationStateContainer& zoneStates)
|
||||
CreateCompilerT6(MemoryManager& memory, const Zone& zone, const ZoneDefinition& zoneDefinition, ZoneAssetCreationStateContainer& zoneStates)
|
||||
{
|
||||
return std::make_unique<KeyValuePairsCompiler>(memory, zone, zoneDefinition, zoneStates);
|
||||
}
|
||||
} // namespace T6::key_value_pairs
|
||||
} // namespace key_value_pairs
|
||||
|
@@ -9,8 +9,8 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6::key_value_pairs
|
||||
namespace key_value_pairs
|
||||
{
|
||||
std::unique_ptr<IAssetCreator>
|
||||
CreateCompiler(MemoryManager& memory, const Zone& zone, const ZoneDefinition& zoneDefinition, ZoneAssetCreationStateContainer& zoneStates);
|
||||
} // namespace T6::key_value_pairs
|
||||
CreateCompilerT6(MemoryManager& memory, const Zone& zone, const ZoneDefinition& zoneDefinition, ZoneAssetCreationStateContainer& zoneStates);
|
||||
} // namespace key_value_pairs
|
||||
|
@@ -19,7 +19,7 @@ namespace
|
||||
{
|
||||
auto& memory = zone.Memory();
|
||||
|
||||
collection.AddAssetCreator(T6::key_value_pairs::CreateCompiler(memory, zone, zoneDefinition.m_zone_definition, zoneStates));
|
||||
collection.AddAssetCreator(key_value_pairs::CreateCompilerT6(memory, zone, zoneDefinition.m_zone_definition, zoneStates));
|
||||
}
|
||||
|
||||
void ConfigurePostProcessors(AssetCreatorCollection& collection,
|
||||
|
@@ -122,10 +122,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW3::image
|
||||
namespace image
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetImage>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetImage>> CreateLoaderIW3(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<ImageLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW3::image
|
||||
} // namespace image
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW3::image
|
||||
namespace image
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetImage>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW3::image
|
||||
std::unique_ptr<AssetCreator<IW3::AssetImage>> CreateLoaderIW3(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace image
|
||||
|
@@ -36,10 +36,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW3::localize
|
||||
namespace localize
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoaderIW3(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<LocalizeLoader>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace IW3::localize
|
||||
} // namespace localize
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW3::localize
|
||||
namespace localize
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace IW3::localize
|
||||
std::unique_ptr<AssetCreator<IW3::AssetLocalize>> CreateLoaderIW3(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace localize
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace IW3;
|
||||
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 IW3::material
|
||||
namespace material
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoaderIW3(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<MaterialLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW3::material
|
||||
} // namespace material
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "SearchPath/ISearchPath.h"
|
||||
#include "Utils/MemoryManager.h"
|
||||
|
||||
namespace IW3::material
|
||||
namespace material
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW3::material
|
||||
std::unique_ptr<AssetCreator<IW3::AssetMaterial>> CreateLoaderIW3(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace material
|
||||
|
@@ -91,10 +91,10 @@ namespace
|
||||
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderPhysPreset>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderXAnim>(memory));
|
||||
collection.AddAssetCreator(xmodel::CreateXModelLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(material::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(xmodel::CreateLoaderIW3(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(material::CreateLoaderIW3(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderTechniqueSet>(memory));
|
||||
collection.AddAssetCreator(image::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(image::CreateLoaderIW3(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderSound>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderSoundCurve>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderLoadedSound>(memory));
|
||||
@@ -108,13 +108,13 @@ namespace
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderFont>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderMenuList>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderMenu>(memory));
|
||||
collection.AddAssetCreator(localize::CreateLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(localize::CreateLoaderIW3(memory, searchPath, zone));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderWeapon>(memory));
|
||||
// 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(raw_file::CreateLoaderIW3(memory, searchPath));
|
||||
collection.AddAssetCreator(string_table::CreateLoaderIW3(memory, searchPath));
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
@@ -44,10 +44,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW3::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoaderIW3(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<RawFileLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW3::raw_file
|
||||
} // namespace raw_file
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW3::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW3::raw_file
|
||||
std::unique_ptr<AssetCreator<IW3::AssetRawFile>> CreateLoaderIW3(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace raw_file
|
||||
|
@@ -6,7 +6,6 @@
|
||||
#include <cstring>
|
||||
|
||||
using namespace IW3;
|
||||
using namespace ::string_table;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -25,7 +24,7 @@ namespace
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
|
||||
StringTableLoaderV1<StringTable> loader;
|
||||
string_table::StringTableLoaderV1<StringTable> loader;
|
||||
auto* stringTable = loader.LoadFromStream(assetName, m_memory, *file.m_stream);
|
||||
if (!stringTable)
|
||||
return AssetCreationResult::Failure();
|
||||
@@ -39,10 +38,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW3::string_table
|
||||
namespace string_table
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoaderIW3(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<StringTableLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW3::string_table
|
||||
} // namespace string_table
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW3::string_table
|
||||
namespace string_table
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW3::string_table
|
||||
std::unique_ptr<AssetCreator<IW3::AssetStringTable>> CreateLoaderIW3(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace string_table
|
||||
|
@@ -11,7 +11,6 @@
|
||||
|
||||
using namespace nlohmann;
|
||||
using namespace IW4;
|
||||
using namespace ::leaderboard;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -116,7 +115,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();
|
||||
|
||||
@@ -139,10 +138,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::leaderboard
|
||||
namespace leaderboard
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLeaderboard>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetLeaderboard>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<LeaderboardLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW4::leaderboard
|
||||
} // namespace leaderboard
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::leaderboard
|
||||
namespace leaderboard
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLeaderboard>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW4::leaderboard
|
||||
std::unique_ptr<AssetCreator<IW4::AssetLeaderboard>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace leaderboard
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::light_def;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -25,7 +24,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto filename = GetFileNameForAsset(assetName);
|
||||
const auto filename = light_def::GetFileNameForAsset(assetName);
|
||||
const auto file = m_search_path.Open(filename);
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
@@ -68,10 +67,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::light_def
|
||||
namespace light_def
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLightDef>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetLightDef>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<LoaderLightDef>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW4::light_def
|
||||
} // namespace light_def
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::light_def
|
||||
namespace light_def
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLightDef>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW4::light_def
|
||||
std::unique_ptr<AssetCreator<IW4::AssetLightDef>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace light_def
|
||||
|
@@ -35,10 +35,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::localize
|
||||
namespace localize
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<LocalizeLoader>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace IW4::localize
|
||||
} // namespace localize
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::localize
|
||||
namespace localize
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace IW4::localize
|
||||
std::unique_ptr<AssetCreator<IW4::AssetLocalize>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace localize
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace IW4;
|
||||
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 IW4::material
|
||||
namespace material
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<MaterialLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW4::material
|
||||
} // namespace material
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "SearchPath/ISearchPath.h"
|
||||
#include "Utils/MemoryManager.h"
|
||||
|
||||
namespace IW4::material
|
||||
namespace material
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW4::material
|
||||
std::unique_ptr<AssetCreator<IW4::AssetMaterial>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace material
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::menu;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -29,7 +28,7 @@ namespace
|
||||
std::vector<menuDef_t*> menus;
|
||||
AssetRegistration<AssetMenuList> registration(assetName);
|
||||
|
||||
auto& zoneState = context.GetZoneAssetCreationState<MenuAssetZoneState>();
|
||||
auto& zoneState = context.GetZoneAssetCreationState<menu::MenuAssetZoneState>();
|
||||
auto& conversionState = context.GetZoneAssetCreationState<MenuConversionZoneState>();
|
||||
|
||||
std::deque<std::string> menuLoadQueue;
|
||||
@@ -81,7 +80,7 @@ namespace
|
||||
private:
|
||||
bool LoadMenuFileFromQueue(const std::string& menuFilePath,
|
||||
AssetCreationContext& context,
|
||||
MenuAssetZoneState& zoneState,
|
||||
menu::MenuAssetZoneState& zoneState,
|
||||
MenuConversionZoneState& conversionState,
|
||||
std::vector<menuDef_t*>& menus,
|
||||
AssetRegistration<AssetMenuList>& registration) const
|
||||
@@ -122,8 +121,8 @@ namespace
|
||||
|
||||
bool ProcessParsedResults(const std::string& fileName,
|
||||
AssetCreationContext& context,
|
||||
ParsingResult& parsingResult,
|
||||
MenuAssetZoneState& zoneState,
|
||||
menu::ParsingResult& parsingResult,
|
||||
menu::MenuAssetZoneState& zoneState,
|
||||
MenuConversionZoneState& conversionState,
|
||||
std::vector<menuDef_t*>& menus,
|
||||
AssetRegistration<AssetMenuList>& registration) const
|
||||
@@ -197,9 +196,10 @@ namespace
|
||||
menuList.menus = nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<ParsingResult> ParseMenuFile(std::istream& stream, const std::string& menuFileName, const MenuAssetZoneState& zoneState) const
|
||||
std::unique_ptr<menu::ParsingResult>
|
||||
ParseMenuFile(std::istream& stream, const std::string& menuFileName, const menu::MenuAssetZoneState& zoneState) const
|
||||
{
|
||||
MenuFileReader reader(stream, menuFileName, FeatureLevel::IW4, m_search_path);
|
||||
menu::MenuFileReader reader(stream, menuFileName, menu::FeatureLevel::IW4, m_search_path);
|
||||
|
||||
reader.IncludeZoneState(zoneState);
|
||||
reader.SetPermissiveMode(ObjLoading::Configuration.MenuPermissiveParsing);
|
||||
@@ -212,10 +212,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::menu
|
||||
namespace menu
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMenuList>> CreateMenuListLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetMenuList>> CreateMenuListLoaderIW4(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<MenuListLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW4::menu
|
||||
} // namespace menu
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::menu
|
||||
namespace menu
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMenuList>> CreateMenuListLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW4::menu
|
||||
std::unique_ptr<AssetCreator<IW4::AssetMenuList>> CreateMenuListLoaderIW4(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace menu
|
||||
|
@@ -14,7 +14,7 @@ namespace IW4
|
||||
IMenuConverter() = default;
|
||||
virtual ~IMenuConverter() = default;
|
||||
|
||||
virtual void ConvertMenu(const ::menu::CommonMenuDef& commonMenu, menuDef_t& menu, AssetRegistration<AssetMenu>& registration) = 0;
|
||||
virtual void ConvertMenu(const menu::CommonMenuDef& commonMenu, menuDef_t& menu, AssetRegistration<AssetMenu>& registration) = 0;
|
||||
|
||||
static std::unique_ptr<IMenuConverter> Create(bool disableOptimizations, ISearchPath& searchPath, MemoryManager& memory, AssetCreationContext& context);
|
||||
};
|
||||
|
@@ -119,19 +119,19 @@ namespace
|
||||
{
|
||||
auto& memory = zone.Memory();
|
||||
|
||||
collection.AddAssetCreator(phys_preset::CreateRawLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(phys_preset::CreateGdtLoader(memory, gdt, zone));
|
||||
collection.AddAssetCreator(phys_preset::CreateRawLoaderIW4(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(phys_preset::CreateGdtLoaderIW4(memory, gdt, zone));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderPhysCollMap>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderXAnim>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderXModelSurfs>(memory));
|
||||
collection.AddAssetCreator(xmodel::CreateXModelLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(material::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(shader::CreatePixelShaderLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(shader::CreateVertexShaderLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(xmodel::CreateLoaderIW4(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(material::CreateLoaderIW4(memory, searchPath));
|
||||
collection.AddAssetCreator(shader::CreatePixelShaderLoaderIW4(memory, searchPath));
|
||||
collection.AddAssetCreator(shader::CreateVertexShaderLoaderIW4(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderTechset>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderImage>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderSound>(memory));
|
||||
collection.AddAssetCreator(sound_curve::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(sound_curve::CreateLoaderIW4(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderLoadedSound>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderClipMap>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderComWorld>(memory));
|
||||
@@ -140,19 +140,19 @@ namespace
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderMapEnts>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderFxWorld>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderGfxWorld>(memory));
|
||||
collection.AddAssetCreator(light_def::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(light_def::CreateLoaderIW4(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderFont>(memory));
|
||||
collection.AddAssetCreator(menu::CreateMenuListLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(menu::CreateMenuListLoaderIW4(memory, searchPath));
|
||||
// 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(localize::CreateLoaderIW4(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(weapon::CreateRawLoaderIW4(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(weapon::CreateGdtLoaderIW4(memory, searchPath, gdt, zone));
|
||||
// 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(structured_data_def::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(raw_file::CreateLoaderIW4(memory, searchPath));
|
||||
collection.AddAssetCreator(string_table::CreateLoaderIW4(memory, searchPath));
|
||||
collection.AddAssetCreator(leaderboard::CreateLoaderIW4(memory, searchPath));
|
||||
collection.AddAssetCreator(structured_data_def::CreateLoaderIW4(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderTracer>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderVehicle>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderAddonMapEnts>(memory));
|
||||
|
@@ -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
|
||||
|
@@ -82,10 +82,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<RawFileLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW4::raw_file
|
||||
} // namespace raw_file
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW4::raw_file
|
||||
std::unique_ptr<AssetCreator<IW4::AssetRawFile>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace raw_file
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::shader;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -23,7 +22,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto fileName = GetFileNameForPixelShaderAssetName(assetName);
|
||||
const auto fileName = shader::GetFileNameForPixelShaderAssetName(assetName);
|
||||
const auto file = m_search_path.Open(fileName);
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
@@ -55,10 +54,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::shader
|
||||
namespace shader
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPixelShader>> CreatePixelShaderLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetPixelShader>> CreatePixelShaderLoaderIW4(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<PixelShaderLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW4::shader
|
||||
} // namespace shader
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::shader
|
||||
namespace shader
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetPixelShader>> CreatePixelShaderLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW4::shader
|
||||
std::unique_ptr<AssetCreator<IW4::AssetPixelShader>> CreatePixelShaderLoaderIW4(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace shader
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::shader;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -23,7 +22,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto fileName = GetFileNameForVertexShaderAssetName(assetName);
|
||||
const auto fileName = shader::GetFileNameForVertexShaderAssetName(assetName);
|
||||
const auto file = m_search_path.Open(fileName);
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
@@ -55,10 +54,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::shader
|
||||
namespace shader
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetVertexShader>> CreateVertexShaderLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetVertexShader>> CreateVertexShaderLoaderIW4(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<VertexShaderLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW4::shader
|
||||
} // namespace shader
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::shader
|
||||
namespace shader
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetVertexShader>> CreateVertexShaderLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW4::shader
|
||||
std::unique_ptr<AssetCreator<IW4::AssetVertexShader>> CreateVertexShaderLoaderIW4(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace shader
|
||||
|
@@ -12,7 +12,6 @@
|
||||
#include <sstream>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::sound_curve;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -27,7 +26,7 @@ namespace
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
|
||||
{
|
||||
const auto fileName = GetFileNameForAssetName(assetName);
|
||||
const auto fileName = sound_curve::GetFileNameForAssetName(assetName);
|
||||
const auto file = m_search_path.Open(fileName);
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
@@ -71,10 +70,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::sound_curve
|
||||
namespace sound_curve
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetSoundCurve>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetSoundCurve>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<LoaderSoundCurve>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW4::sound_curve
|
||||
} // namespace sound_curve
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::sound_curve
|
||||
namespace sound_curve
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetSoundCurve>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW4::sound_curve
|
||||
std::unique_ptr<AssetCreator<IW4::AssetSoundCurve>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace sound_curve
|
||||
|
@@ -6,7 +6,6 @@
|
||||
#include "StringTable/StringTableLoader.h"
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::string_table;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -25,7 +24,7 @@ namespace
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
|
||||
StringTableLoaderV2<StringTable, Common::StringTable_HashString> loader;
|
||||
string_table::StringTableLoaderV2<StringTable, Common::StringTable_HashString> loader;
|
||||
auto* stringTable = loader.LoadFromStream(assetName, m_memory, *file.m_stream);
|
||||
if (!stringTable)
|
||||
return AssetCreationResult::Failure();
|
||||
@@ -39,10 +38,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::string_table
|
||||
namespace string_table
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<LoaderStringTable>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW4::string_table
|
||||
} // namespace string_table
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::string_table
|
||||
namespace string_table
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW4::string_table
|
||||
std::unique_ptr<AssetCreator<IW4::AssetStringTable>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace string_table
|
||||
|
@@ -207,10 +207,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::structured_data_def
|
||||
namespace structured_data_def
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetStructuredDataDef>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetStructuredDataDef>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<StructuredDataDefLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW4::structured_data_def
|
||||
} // namespace structured_data_def
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::structured_data_def
|
||||
namespace structured_data_def
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetStructuredDataDef>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW4::structured_data_def
|
||||
std::unique_ptr<AssetCreator<IW4::AssetStructuredDataDef>> CreateLoaderIW4(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace structured_data_def
|
||||
|
@@ -40,14 +40,14 @@ namespace
|
||||
|
||||
private:
|
||||
IGdtQueryable& m_gdt;
|
||||
IW4::weapon::InfoStringLoader m_info_string_loader;
|
||||
weapon::InfoStringLoaderIW4 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::weapon
|
||||
namespace weapon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<IW4::AssetWeapon>> CreateGdtLoaderIW4(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
{
|
||||
return std::make_unique<GdtLoaderWeapon>(memory, searchPath, gdt, zone);
|
||||
}
|
||||
} // namespace IW4::weapon
|
||||
} // namespace weapon
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::weapon
|
||||
namespace weapon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace IW4::weapon
|
||||
std::unique_ptr<AssetCreator<IW4::AssetWeapon>> CreateGdtLoaderIW4(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace weapon
|
||||
|
@@ -426,16 +426,16 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW4::weapon
|
||||
namespace weapon
|
||||
{
|
||||
InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
InfoStringLoaderIW4::InfoStringLoaderIW4(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 InfoStringLoaderIW4::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
|
||||
{
|
||||
auto* weaponFullDef = m_memory.Alloc<WeaponFullDef>();
|
||||
|
||||
@@ -458,4 +458,4 @@ namespace IW4::weapon
|
||||
|
||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
||||
}
|
||||
} // namespace IW4::weapon
|
||||
} // namespace weapon
|
||||
|
@@ -4,12 +4,12 @@
|
||||
#include "Asset/AssetCreationResult.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace IW4::weapon
|
||||
namespace weapon
|
||||
{
|
||||
class InfoStringLoader
|
||||
class InfoStringLoaderIW4
|
||||
{
|
||||
public:
|
||||
InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
InfoStringLoaderIW4(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context);
|
||||
|
||||
@@ -18,4 +18,4 @@ namespace IW4::weapon
|
||||
ISearchPath& m_search_path;
|
||||
Zone& m_zone;
|
||||
};
|
||||
} // namespace IW4::weapon
|
||||
} // namespace weapon
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace IW4;
|
||||
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;
|
||||
IW4::weapon::InfoStringLoader m_info_string_loader;
|
||||
weapon::InfoStringLoaderIW4 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::weapon
|
||||
namespace weapon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateRawLoaderIW4(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<RawLoaderWeapon>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace IW4::weapon
|
||||
} // namespace weapon
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::weapon
|
||||
namespace weapon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace IW4::weapon
|
||||
std::unique_ptr<AssetCreator<IW4::AssetWeapon>> CreateRawLoaderIW4(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace weapon
|
||||
|
@@ -10,7 +10,6 @@
|
||||
#include <sstream>
|
||||
|
||||
using namespace IW5;
|
||||
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();
|
||||
@@ -62,10 +61,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::image
|
||||
namespace image
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetImage>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetImage>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<ImageLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW5::image
|
||||
} // namespace image
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5::image
|
||||
namespace image
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetImage>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW5::image
|
||||
std::unique_ptr<AssetCreator<IW5::AssetImage>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace image
|
||||
|
@@ -11,7 +11,6 @@
|
||||
|
||||
using namespace nlohmann;
|
||||
using namespace IW5;
|
||||
using namespace ::leaderboard;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -133,7 +132,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();
|
||||
|
||||
@@ -156,10 +155,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::leaderboard
|
||||
namespace leaderboard
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLeaderboard>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetLeaderboard>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<LeaderboardLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW5::leaderboard
|
||||
} // namespace leaderboard
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5::leaderboard
|
||||
namespace leaderboard
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLeaderboard>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW5::leaderboard
|
||||
std::unique_ptr<AssetCreator<IW5::AssetLeaderboard>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace leaderboard
|
||||
|
@@ -35,10 +35,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::localize
|
||||
namespace localize
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<LocalizeLoader>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace IW5::localize
|
||||
} // namespace localize
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5::localize
|
||||
namespace localize
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace IW5::localize
|
||||
std::unique_ptr<AssetCreator<IW5::AssetLocalize>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace localize
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace IW5;
|
||||
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 IW5::material
|
||||
namespace material
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<MaterialLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW5::material
|
||||
} // namespace material
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5::material
|
||||
namespace material
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW5::material
|
||||
std::unique_ptr<AssetCreator<IW5::AssetMaterial>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace material
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace IW5;
|
||||
using namespace ::menu;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -29,7 +28,7 @@ namespace
|
||||
std::vector<menuDef_t*> menus;
|
||||
AssetRegistration<AssetMenuList> registration(assetName);
|
||||
|
||||
auto& zoneState = context.GetZoneAssetCreationState<MenuAssetZoneState>();
|
||||
auto& zoneState = context.GetZoneAssetCreationState<menu::MenuAssetZoneState>();
|
||||
auto& conversionState = context.GetZoneAssetCreationState<MenuConversionZoneState>();
|
||||
|
||||
std::deque<std::string> menuLoadQueue;
|
||||
@@ -81,7 +80,7 @@ namespace
|
||||
private:
|
||||
bool LoadMenuFileFromQueue(const std::string& menuFilePath,
|
||||
AssetCreationContext& context,
|
||||
MenuAssetZoneState& zoneState,
|
||||
menu::MenuAssetZoneState& zoneState,
|
||||
MenuConversionZoneState& conversionState,
|
||||
std::vector<menuDef_t*>& menus,
|
||||
AssetRegistration<AssetMenuList>& registration) const
|
||||
@@ -122,8 +121,8 @@ namespace
|
||||
|
||||
bool ProcessParsedResults(const std::string& fileName,
|
||||
AssetCreationContext& context,
|
||||
ParsingResult& parsingResult,
|
||||
MenuAssetZoneState& zoneState,
|
||||
menu::ParsingResult& parsingResult,
|
||||
menu::MenuAssetZoneState& zoneState,
|
||||
MenuConversionZoneState& conversionState,
|
||||
std::vector<menuDef_t*>& menus,
|
||||
AssetRegistration<AssetMenuList>& registration) const
|
||||
@@ -197,9 +196,10 @@ namespace
|
||||
menuList.menus = nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<ParsingResult> ParseMenuFile(std::istream& stream, const std::string& menuFileName, const MenuAssetZoneState& zoneState) const
|
||||
std::unique_ptr<menu::ParsingResult>
|
||||
ParseMenuFile(std::istream& stream, const std::string& menuFileName, const menu::MenuAssetZoneState& zoneState) const
|
||||
{
|
||||
MenuFileReader reader(stream, menuFileName, FeatureLevel::IW5, m_search_path);
|
||||
menu::MenuFileReader reader(stream, menuFileName, menu::FeatureLevel::IW5, m_search_path);
|
||||
|
||||
reader.IncludeZoneState(zoneState);
|
||||
reader.SetPermissiveMode(ObjLoading::Configuration.MenuPermissiveParsing);
|
||||
@@ -212,10 +212,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::menu
|
||||
namespace menu
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMenuList>> CreateMenuListLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetMenuList>> CreateMenuListLoaderIW5(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<MenuListLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW5::menu
|
||||
} // namespace menu
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5::menu
|
||||
namespace menu
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMenuList>> CreateMenuListLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW5::menu
|
||||
std::unique_ptr<AssetCreator<IW5::AssetMenuList>> CreateMenuListLoaderIW5(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace menu
|
||||
|
@@ -125,13 +125,13 @@ namespace
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderPhysCollMap>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderXAnim>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderXModelSurfs>(memory));
|
||||
collection.AddAssetCreator(xmodel::CreateXModelLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(material::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(xmodel::CreateLoaderIW5(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(material::CreateLoaderIW5(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderPixelShader>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderVertexShader>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderVertexDecl>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderTechniqueSet>(memory));
|
||||
collection.AddAssetCreator(image::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(image::CreateLoaderIW5(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderSound>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderSoundCurve>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderLoadedSound>(memory));
|
||||
@@ -145,19 +145,19 @@ namespace
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderGfxWorld>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderLightDef>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderFont>(memory));
|
||||
collection.AddAssetCreator(menu::CreateMenuListLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(menu::CreateMenuListLoaderIW5(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderMenu>(memory));
|
||||
collection.AddAssetCreator(localize::CreateLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(attachment::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(weapon::CreateRawLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(weapon::CreateGdtLoader(memory, searchPath, gdt, zone));
|
||||
collection.AddAssetCreator(localize::CreateLoaderIW5(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(attachment::CreateLoaderIW5(memory, searchPath));
|
||||
collection.AddAssetCreator(weapon::CreateRawLoaderIW5(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(weapon::CreateGdtLoaderIW5(memory, searchPath, gdt, zone));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderFx>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderImpactFx>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderSurfaceFx>(memory));
|
||||
collection.AddAssetCreator(raw_file::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(script::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(string_table::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(leaderboard::CreateLoader(memory, searchPath));
|
||||
collection.AddAssetCreator(raw_file::CreateLoaderIW5(memory, searchPath));
|
||||
collection.AddAssetCreator(script::CreateLoaderIW5(memory, searchPath));
|
||||
collection.AddAssetCreator(string_table::CreateLoaderIW5(memory, searchPath));
|
||||
collection.AddAssetCreator(leaderboard::CreateLoaderIW5(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderStructuredDataDef>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderTracer>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderVehicle>(memory));
|
||||
|
@@ -81,10 +81,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<RawFileLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW5::raw_file
|
||||
} // namespace raw_file
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW5::raw_file
|
||||
std::unique_ptr<AssetCreator<IW5::AssetRawFile>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace raw_file
|
||||
|
@@ -79,10 +79,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::script
|
||||
namespace script
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetScript>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetScript>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<ScriptLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW5::script
|
||||
} // namespace script
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5::script
|
||||
namespace script
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetScript>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW5::script
|
||||
std::unique_ptr<AssetCreator<IW5::AssetScript>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace script
|
||||
|
@@ -10,7 +10,6 @@
|
||||
#include <cstring>
|
||||
|
||||
using namespace IW5;
|
||||
using namespace ::string_table;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -29,7 +28,7 @@ namespace
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
|
||||
StringTableLoaderV2<StringTable, Common::StringTable_HashString> loader;
|
||||
string_table::StringTableLoaderV2<StringTable, Common::StringTable_HashString> loader;
|
||||
auto* stringTable = loader.LoadFromStream(assetName, m_memory, *file.m_stream);
|
||||
|
||||
return AssetCreationResult::Success(context.AddAsset<AssetStringTable>(assetName, stringTable));
|
||||
@@ -41,10 +40,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::string_table
|
||||
namespace string_table
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<StringTableLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW5::string_table
|
||||
} // namespace string_table
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5::string_table
|
||||
namespace string_table
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW5::string_table
|
||||
std::unique_ptr<AssetCreator<IW5::AssetStringTable>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace string_table
|
||||
|
@@ -40,14 +40,14 @@ namespace
|
||||
|
||||
private:
|
||||
IGdtQueryable& m_gdt;
|
||||
IW5::weapon::InfoStringLoader m_info_string_loader;
|
||||
weapon::InfoStringLoaderIW5 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::weapon
|
||||
namespace weapon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateGdtLoaderIW5(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
|
||||
{
|
||||
return std::make_unique<GdtLoaderWeapon>(memory, searchPath, gdt, zone);
|
||||
}
|
||||
} // namespace IW5::weapon
|
||||
} // namespace weapon
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5::weapon
|
||||
namespace weapon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace IW5::weapon
|
||||
std::unique_ptr<AssetCreator<IW5::AssetWeapon>> CreateGdtLoaderIW5(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
|
||||
} // namespace weapon
|
||||
|
@@ -856,16 +856,16 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW5::weapon
|
||||
namespace weapon
|
||||
{
|
||||
InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
InfoStringLoaderIW5::InfoStringLoaderIW5(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) const
|
||||
AssetCreationResult InfoStringLoaderIW5::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) const
|
||||
{
|
||||
auto* weaponFullDef = m_memory.Alloc<WeaponFullDef>();
|
||||
|
||||
@@ -888,4 +888,4 @@ namespace IW5::weapon
|
||||
|
||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
||||
}
|
||||
} // namespace IW5::weapon
|
||||
} // namespace weapon
|
||||
|
@@ -4,12 +4,12 @@
|
||||
#include "Asset/AssetCreationResult.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace IW5::weapon
|
||||
namespace weapon
|
||||
{
|
||||
class InfoStringLoader
|
||||
class InfoStringLoaderIW5
|
||||
{
|
||||
public:
|
||||
InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
InfoStringLoaderIW5(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
|
||||
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) const;
|
||||
|
||||
@@ -18,4 +18,4 @@ namespace IW5::weapon
|
||||
ISearchPath& m_search_path;
|
||||
Zone& m_zone;
|
||||
};
|
||||
} // namespace IW5::weapon
|
||||
} // namespace weapon
|
||||
|
@@ -11,7 +11,6 @@
|
||||
|
||||
using namespace nlohmann;
|
||||
using namespace IW5;
|
||||
using namespace ::attachment;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -643,7 +642,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(attachment::GetJsonFileNameForAssetName(assetName));
|
||||
if (!file.IsOpen())
|
||||
return AssetCreationResult::NoAction();
|
||||
|
||||
@@ -667,10 +666,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::attachment
|
||||
namespace attachment
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetAttachment>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetAttachment>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<AttachmentLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace IW5::attachment
|
||||
} // namespace attachment
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5::attachment
|
||||
namespace attachment
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetAttachment>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace IW5::attachment
|
||||
std::unique_ptr<AssetCreator<IW5::AssetAttachment>> CreateLoaderIW5(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace attachment
|
||||
|
@@ -43,14 +43,14 @@ namespace
|
||||
|
||||
private:
|
||||
ISearchPath& m_search_path;
|
||||
IW5::weapon::InfoStringLoader m_info_string_loader;
|
||||
weapon::InfoStringLoaderIW5 m_info_string_loader;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::weapon
|
||||
namespace weapon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateRawLoaderIW5(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<RawLoaderWeapon>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace IW5::weapon
|
||||
} // namespace weapon
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5::weapon
|
||||
namespace weapon
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetWeapon>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace IW5::weapon
|
||||
std::unique_ptr<AssetCreator<IW5::AssetWeapon>> CreateRawLoaderIW5(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace weapon
|
||||
|
@@ -35,10 +35,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T5::localize
|
||||
namespace localize
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoaderT5(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
return std::make_unique<LocalizeLoader>(memory, searchPath, zone);
|
||||
}
|
||||
} // namespace T5::localize
|
||||
} // namespace localize
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T5::localize
|
||||
namespace localize
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetLocalize>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace T5::localize
|
||||
std::unique_ptr<AssetCreator<T5::AssetLocalize>> CreateLoaderT5(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||
} // namespace localize
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace T5;
|
||||
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 T5::material
|
||||
namespace material
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoaderT5(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<MaterialLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T5::material
|
||||
} // namespace material
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "SearchPath/ISearchPath.h"
|
||||
#include "Utils/MemoryManager.h"
|
||||
|
||||
namespace T5::material
|
||||
namespace material
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetMaterial>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T5::material
|
||||
std::unique_ptr<AssetCreator<T5::AssetMaterial>> CreateLoaderT5(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace material
|
||||
|
@@ -104,8 +104,8 @@ namespace
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderPhysConstraints>(memory));
|
||||
// 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::CreateLoaderT5(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(material::CreateLoaderT5(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderTechniqueSet>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderImage>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderSoundBank>(memory));
|
||||
@@ -120,13 +120,13 @@ namespace
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderFont>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderMenuList>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderMenu>(memory));
|
||||
collection.AddAssetCreator(localize::CreateLoader(memory, searchPath, zone));
|
||||
collection.AddAssetCreator(localize::CreateLoaderT5(memory, searchPath, zone));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderWeapon>(memory));
|
||||
// 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(raw_file::CreateLoaderT5(memory, searchPath));
|
||||
collection.AddAssetCreator(string_table::CreateLoaderT5(memory, searchPath));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderPackIndex>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderXGlobals>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderDDL>(memory));
|
||||
|
@@ -114,10 +114,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T5::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoaderT5(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<RawFileLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T5::raw_file
|
||||
} // namespace raw_file
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T5::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetRawFile>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T5::raw_file
|
||||
std::unique_ptr<AssetCreator<T5::AssetRawFile>> CreateLoaderT5(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace raw_file
|
||||
|
@@ -7,7 +7,6 @@
|
||||
#include <cstring>
|
||||
|
||||
using namespace T5;
|
||||
using namespace ::string_table;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -26,7 +25,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));
|
||||
@@ -38,10 +37,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T5::string_table
|
||||
namespace string_table
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath)
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoaderT5(MemoryManager& memory, ISearchPath& searchPath)
|
||||
{
|
||||
return std::make_unique<StringTableLoader>(memory, searchPath);
|
||||
}
|
||||
} // namespace T5::string_table
|
||||
} // namespace string_table
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T5::string_table
|
||||
namespace string_table
|
||||
{
|
||||
std::unique_ptr<AssetCreator<AssetStringTable>> CreateLoader(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace T5::string_table
|
||||
std::unique_ptr<AssetCreator<T5::AssetStringTable>> CreateLoaderT5(MemoryManager& memory, ISearchPath& searchPath);
|
||||
} // namespace string_table
|
||||
|
@@ -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
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user