mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-23 21:27:52 -05:00
Added iw4 assets related to materials, xmodels
This commit is contained in:
@ -0,0 +1,29 @@
|
||||
#include "gfximage_actions.h"
|
||||
#include <cassert>
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
Actions_GfxImage::Actions_GfxImage(Zone* zone)
|
||||
: AssetLoadingActions(zone)
|
||||
{
|
||||
}
|
||||
|
||||
void Actions_GfxImage::OnImageLoaded(GfxImage* image) const
|
||||
{
|
||||
image->cardMemory.platform[0] = 0;
|
||||
}
|
||||
|
||||
void Actions_GfxImage::LoadImageData(GfxImageLoadDef* loadDef, GfxImage* image) const
|
||||
{
|
||||
if (loadDef->resourceSize > 0)
|
||||
{
|
||||
const size_t loadDefSize = offsetof(IW4::GfxImageLoadDef, data) + loadDef->resourceSize;
|
||||
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
||||
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
image->texture.loadDef = nullptr;
|
||||
}
|
||||
}
|
16
src/ZoneLoading/Game/IW4/XAssets/gfximage/gfximage_actions.h
Normal file
16
src/ZoneLoading/Game/IW4/XAssets/gfximage/gfximage_actions.h
Normal file
@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Loading/AssetLoadingActions.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4
|
||||
{
|
||||
class Actions_GfxImage final : public AssetLoadingActions
|
||||
{
|
||||
public:
|
||||
explicit Actions_GfxImage(Zone* zone);
|
||||
|
||||
void OnImageLoaded(GfxImage* image) const;
|
||||
void LoadImageData(GfxImageLoadDef* loadDef, GfxImage* image) const;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user