mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 16:15:43 +00:00
Create default GfxImage assets
This commit is contained in:
parent
dcff6132b9
commit
a0ff11a857
17
src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderGfxImage.cpp
Normal file
17
src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderGfxImage.cpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#include "AssetLoaderGfxImage.h"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
#include "ObjLoading.h"
|
||||||
|
#include "Game/IW4/IW4.h"
|
||||||
|
#include "Pool/GlobalAssetPool.h"
|
||||||
|
|
||||||
|
using namespace IW4;
|
||||||
|
|
||||||
|
void* AssetLoaderGfxImage::CreateEmptyAsset(const std::string& assetName, MemoryManager* memory)
|
||||||
|
{
|
||||||
|
auto* image = memory->Create<GfxImage>();
|
||||||
|
memset(image, 0, sizeof(GfxImage));
|
||||||
|
image->name = memory->Dup(assetName.c_str());
|
||||||
|
return image;
|
||||||
|
}
|
14
src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderGfxImage.h
Normal file
14
src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderGfxImage.h
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Game/IW4/IW4.h"
|
||||||
|
#include "AssetLoading/BasicAssetLoader.h"
|
||||||
|
#include "SearchPath/ISearchPath.h"
|
||||||
|
|
||||||
|
namespace IW4
|
||||||
|
{
|
||||||
|
class AssetLoaderGfxImage final : public BasicAssetLoader<ASSET_TYPE_IMAGE, GfxImage>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
_NODISCARD void* CreateEmptyAsset(const std::string& assetName, MemoryManager* memory) override;
|
||||||
|
};
|
||||||
|
}
|
@ -4,6 +4,7 @@
|
|||||||
#include "Game/IW4/GameAssetPoolIW4.h"
|
#include "Game/IW4/GameAssetPoolIW4.h"
|
||||||
#include "ObjContainer/IPak/IPak.h"
|
#include "ObjContainer/IPak/IPak.h"
|
||||||
#include "ObjLoading.h"
|
#include "ObjLoading.h"
|
||||||
|
#include "AssetLoaders/AssetLoaderGfxImage.h"
|
||||||
#include "AssetLoaders/AssetLoaderLocalizeEntry.h"
|
#include "AssetLoaders/AssetLoaderLocalizeEntry.h"
|
||||||
#include "AssetLoaders/AssetLoaderMaterial.h"
|
#include "AssetLoaders/AssetLoaderMaterial.h"
|
||||||
#include "AssetLoaders/AssetLoaderMenuList.h"
|
#include "AssetLoaders/AssetLoaderMenuList.h"
|
||||||
@ -31,7 +32,7 @@ ObjLoader::ObjLoader()
|
|||||||
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_VERTEXSHADER, MaterialVertexShader))
|
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_VERTEXSHADER, MaterialVertexShader))
|
||||||
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_VERTEXDECL, MaterialVertexDeclaration))
|
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_VERTEXDECL, MaterialVertexDeclaration))
|
||||||
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_TECHNIQUE_SET, MaterialTechniqueSet))
|
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_TECHNIQUE_SET, MaterialTechniqueSet))
|
||||||
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_IMAGE, GfxImage))
|
REGISTER_ASSET_LOADER(AssetLoaderGfxImage)
|
||||||
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_SOUND, snd_alias_list_t))
|
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_SOUND, snd_alias_list_t))
|
||||||
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_SOUND_CURVE, SndCurve))
|
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_SOUND_CURVE, SndCurve))
|
||||||
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_LOADED_SOUND, LoadedSound))
|
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_LOADED_SOUND, LoadedSound))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user