mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-12 07:48:16 -05:00
ObjWriting: Add dumper for GfxImage iwi files of version 27
This commit is contained in:
20
src/ObjWriting/Game/T6/AssetDumpers/AssetDumperGfxImage.cpp
Normal file
20
src/ObjWriting/Game/T6/AssetDumpers/AssetDumperGfxImage.cpp
Normal 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);
|
||||
}
|
12
src/ObjWriting/Game/T6/AssetDumpers/AssetDumperGfxImage.h
Normal file
12
src/ObjWriting/Game/T6/AssetDumpers/AssetDumperGfxImage.h
Normal 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;
|
||||
};
|
@ -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);
|
||||
|
Reference in New Issue
Block a user