mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-06-06 08:42:35 +00:00
chore: use templating on XAnimLoader
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
#include "Game/IW3/Image/ImageLoaderExternalIW3.h"
|
#include "Game/IW3/Image/ImageLoaderExternalIW3.h"
|
||||||
#include "Game/IW3/Techset/PixelShaderLoaderIW3.h"
|
#include "Game/IW3/Techset/PixelShaderLoaderIW3.h"
|
||||||
#include "Game/IW3/Techset/VertexShaderLoaderIW3.h"
|
#include "Game/IW3/Techset/VertexShaderLoaderIW3.h"
|
||||||
|
#include "Game/IW3/XAnim/XAnimLoaderIW3.h"
|
||||||
#include "Game/IW3/XModel/LoaderXModelIW3.h"
|
#include "Game/IW3/XModel/LoaderXModelIW3.h"
|
||||||
#include "LightDef/LightDefLoaderIW3.h"
|
#include "LightDef/LightDefLoaderIW3.h"
|
||||||
#include "Localize/AssetLoaderLocalizeIW3.h"
|
#include "Localize/AssetLoaderLocalizeIW3.h"
|
||||||
@@ -18,7 +19,6 @@
|
|||||||
#include "RawFile/AssetLoaderRawFileIW3.h"
|
#include "RawFile/AssetLoaderRawFileIW3.h"
|
||||||
#include "Sound/LoaderSoundCurveIW3.h"
|
#include "Sound/LoaderSoundCurveIW3.h"
|
||||||
#include "StringTable/AssetLoaderStringTableIW3.h"
|
#include "StringTable/AssetLoaderStringTableIW3.h"
|
||||||
#include "XAnim/XAnimLoaderIW3.h"
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Asset/IAssetCreator.h"
|
|
||||||
#include "Game/IW3/IW3.h"
|
|
||||||
#include "SearchPath/ISearchPath.h"
|
|
||||||
#include "Utils/MemoryManager.h"
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace xanim
|
|
||||||
{
|
|
||||||
std::unique_ptr<AssetCreator<IW3::AssetXAnim>> CreateLoaderIW3(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
|
||||||
} // namespace xanim
|
|
||||||
+27
-3
@@ -1,4 +1,26 @@
|
|||||||
#include "XAnimLoaderIW3.h"
|
#options GAME(IW3)
|
||||||
|
|
||||||
|
#filename "Game/" + GAME + "/XAnim/XAnimLoader" + GAME + ".cpp"
|
||||||
|
|
||||||
|
#set LOADER_HEADER "\"XAnimLoader" + GAME + ".h\""
|
||||||
|
|
||||||
|
#if GAME == "IW3"
|
||||||
|
#define FEATURE_IW3
|
||||||
|
#elif GAME == "IW4"
|
||||||
|
#define FEATURE_IW4
|
||||||
|
#elif GAME == "IW5"
|
||||||
|
#define FEATURE_IW5
|
||||||
|
#elif GAME == "T5"
|
||||||
|
#define FEATURE_T5
|
||||||
|
#elif GAME == "T6"
|
||||||
|
#define FEATURE_T6
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// This file was templated.
|
||||||
|
// See XAnimLoader.cpp.template.
|
||||||
|
// Do not modify, changes will be lost.
|
||||||
|
|
||||||
|
#include LOADER_HEADER
|
||||||
|
|
||||||
#include "Utils/Logging/Log.h"
|
#include "Utils/Logging/Log.h"
|
||||||
#include "XAnim/CompiledXAnimLoader.h"
|
#include "XAnim/CompiledXAnimLoader.h"
|
||||||
@@ -16,7 +38,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using namespace IW3;
|
using namespace GAME;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@@ -325,9 +347,11 @@ namespace
|
|||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
#set METHOD_NAME "CreateLoader" + GAME
|
||||||
|
|
||||||
namespace xanim
|
namespace xanim
|
||||||
{
|
{
|
||||||
std::unique_ptr<AssetCreator<AssetXAnim>> CreateLoaderIW3(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
std::unique_ptr<AssetCreator<AssetXAnim>> METHOD_NAME(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
|
||||||
{
|
{
|
||||||
return std::make_unique<XAnimLoader>(memory, searchPath, zone.m_script_strings);
|
return std::make_unique<XAnimLoader>(memory, searchPath, zone.m_script_strings);
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
#options GAME(IW3)
|
||||||
|
|
||||||
|
#filename "Game/" + GAME + "/XAnim/XAnimLoader" + GAME + ".h"
|
||||||
|
|
||||||
|
#set GAME_HEADER "\"Game/" + GAME + "/" + GAME + ".h\""
|
||||||
|
|
||||||
|
// This file was templated.
|
||||||
|
// See XAnimLoader.h.template.
|
||||||
|
// Do not modify, changes will be lost.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Asset/IAssetCreator.h"
|
||||||
|
#include GAME_HEADER
|
||||||
|
#include "SearchPath/ISearchPath.h"
|
||||||
|
#include "Utils/MemoryManager.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#set METHOD_NAME "CreateLoader" + GAME
|
||||||
|
|
||||||
|
namespace xanim
|
||||||
|
{
|
||||||
|
std::unique_ptr<AssetCreator<GAME::AssetXAnim>> METHOD_NAME(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
|
||||||
|
} // namespace xanim
|
||||||
Reference in New Issue
Block a user