Add Commands for T5

This commit is contained in:
Jan
2021-05-12 19:23:27 +02:00
parent 4823fe036e
commit e3a3d012e6
39 changed files with 1950 additions and 48 deletions

View File

@ -0,0 +1,24 @@
#include "gfximage_actions.h"
#include <cassert>
#include <cstring>
using namespace T5;
Actions_GfxImage::Actions_GfxImage(Zone* zone)
: AssetLoadingActions(zone)
{
}
void Actions_GfxImage::OnImageLoaded(GfxImage* image) const
{
image->loadedSize = 0;
}
void Actions_GfxImage::LoadImageData(GfxImageLoadDef* loadDef, GfxImage* image) const
{
const size_t loadDefSize = offsetof(GfxImageLoadDef, data) + loadDef->resourceSize;
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
memcpy(image->texture.loadDef, loadDef, loadDefSize);
}

View File

@ -0,0 +1,16 @@
#pragma once
#include "Loading/AssetLoadingActions.h"
#include "Game/T5/T5.h"
namespace T5
{
class Actions_GfxImage final : public AssetLoadingActions
{
public:
explicit Actions_GfxImage(Zone* zone);
void OnImageLoaded(GfxImage* image) const;
void LoadImageData(GfxImageLoadDef* loadDef, GfxImage* image) const;
};
}