ObjWriting: Add dumper for GfxImage iwi files of version 27

This commit is contained in:
Jan
2020-02-11 23:47:04 +01:00
parent 6b59fcb5fe
commit f3779bac03
6 changed files with 214 additions and 1 deletions

View File

@ -0,0 +1,20 @@
#include "AssetDumperGfxImage.h"
#include "Image/IwiWriter27.h"
using namespace T6;
bool AssetDumperGfxImage::ShouldDump(GfxImage* asset)
{
return asset->loadedSize > 0;
}
std::string AssetDumperGfxImage::GetFileNameForAsset(Zone* zone, GfxImage* asset)
{
return "images/" + std::string(asset->name) + ".iwi";
}
void AssetDumperGfxImage::DumpAsset(Zone* zone, GfxImage* asset, FileAPI::File* out)
{
IwiWriter27 writer;
writer.DumpImage(out, asset->texture.texture);
}

View File

@ -0,0 +1,12 @@
#pragma once
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T6/T6.h"
class AssetDumperGfxImage final : public AbstractAssetDumper<T6::GfxImage>
{
protected:
bool ShouldDump(T6::GfxImage* asset) override;
std::string GetFileNameForAsset(Zone* zone, T6::GfxImage* asset) override;
void DumpAsset(Zone* zone, T6::GfxImage* asset, FileAPI::File* out) override;
};

View File

@ -8,6 +8,7 @@
#include "AssetDumpers/AssetDumperScriptParseTree.h"
#include "AssetDumpers/AssetDumperStringTable.h"
#include "AssetDumpers/AssetDumperLocalizeEntry.h"
#include "AssetDumpers/AssetDumperGfxImage.h"
bool ZoneDumperT6::CanHandleZone(Zone* zone)
{
@ -32,7 +33,7 @@ bool ZoneDumperT6::DumpZone(Zone* zone, const std::string& basePath)
// DUMP_ASSET_POOL(AssetDumperXModel, m_xmodel);
// DUMP_ASSET_POOL(AssetDumperMaterial, m_material);
// DUMP_ASSET_POOL(AssetDumperTechniqueSet, m_technique_set);
// DUMP_ASSET_POOL(AssetDumperGfxImage, m_image);
DUMP_ASSET_POOL(AssetDumperGfxImage, m_image);
// DUMP_ASSET_POOL(AssetDumperSndBank, m_sound_bank);
// DUMP_ASSET_POOL(AssetDumperSndPatch, m_sound_patch);
// DUMP_ASSET_POOL(AssetDumperClipMap, m_clip_map);