mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-20 19:57:53 -05:00
Dump a few iw4 assets
This commit is contained in:
@ -3,10 +3,13 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
class AssetDumperFontIcon final : public AbstractAssetDumper<T6::FontIcon>
|
||||
namespace T6
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(T6::FontIcon* asset) override;
|
||||
std::string GetFileNameForAsset(Zone* zone, T6::FontIcon* asset) override;
|
||||
void DumpAsset(Zone* zone, T6::FontIcon* asset, FileAPI::File* out) override;
|
||||
};
|
||||
class AssetDumperFontIcon final : public AbstractAssetDumper<T6::FontIcon>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(T6::FontIcon* asset) override;
|
||||
std::string GetFileNameForAsset(Zone* zone, T6::FontIcon* asset) override;
|
||||
void DumpAsset(Zone* zone, T6::FontIcon* asset, FileAPI::File* out) override;
|
||||
};
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
#include "AssetDumperGfxImage.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "ObjWriting.h"
|
||||
#include "Image/IwiWriter27.h"
|
||||
#include "Image/DdsWriter.h"
|
||||
#include <cassert>
|
||||
|
||||
using namespace T6;
|
||||
|
||||
|
@ -4,21 +4,24 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Image/IImageWriter.h"
|
||||
|
||||
class AssetDumperGfxImage final : public AbstractAssetDumper<T6::GfxImage>
|
||||
namespace T6
|
||||
{
|
||||
IImageWriter* m_writer;
|
||||
class AssetDumperGfxImage final : public AbstractAssetDumper<T6::GfxImage>
|
||||
{
|
||||
IImageWriter* m_writer;
|
||||
|
||||
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;
|
||||
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;
|
||||
|
||||
public:
|
||||
AssetDumperGfxImage();
|
||||
~AssetDumperGfxImage();
|
||||
public:
|
||||
AssetDumperGfxImage();
|
||||
~AssetDumperGfxImage();
|
||||
|
||||
AssetDumperGfxImage(const AssetDumperGfxImage& other) = delete;
|
||||
AssetDumperGfxImage(AssetDumperGfxImage&& other) noexcept = delete;
|
||||
AssetDumperGfxImage& operator=(const AssetDumperGfxImage& other) = delete;
|
||||
AssetDumperGfxImage& operator=(AssetDumperGfxImage&& other) noexcept = delete;
|
||||
};
|
||||
AssetDumperGfxImage(const AssetDumperGfxImage& other) = delete;
|
||||
AssetDumperGfxImage(AssetDumperGfxImage&& other) noexcept = delete;
|
||||
AssetDumperGfxImage& operator=(const AssetDumperGfxImage& other) = delete;
|
||||
AssetDumperGfxImage& operator=(AssetDumperGfxImage&& other) noexcept = delete;
|
||||
};
|
||||
}
|
||||
|
@ -1,70 +1,16 @@
|
||||
#include "AssetDumperLocalizeEntry.h"
|
||||
|
||||
#include "Dumping/Localize/LocalizeCommon.h"
|
||||
#include "Dumping/Localize/StringFileDumper.h"
|
||||
|
||||
using namespace T6;
|
||||
|
||||
std::string AssetDumperLocalizeEntry::GetNameOfLanguage(GameLanguage language)
|
||||
{
|
||||
switch(language)
|
||||
{
|
||||
case GameLanguage::LANGUAGE_NONE:
|
||||
case GameLanguage::LANGUAGE_ENGLISH:
|
||||
default:
|
||||
return "english";
|
||||
|
||||
case GameLanguage::LANGUAGE_FRENCH:
|
||||
return "french";
|
||||
|
||||
case GameLanguage::LANGUAGE_GERMAN:
|
||||
return "german";
|
||||
|
||||
case GameLanguage::LANGUAGE_ITALIAN:
|
||||
return "italian";
|
||||
|
||||
case GameLanguage::LANGUAGE_SPANISH:
|
||||
return "spanish";
|
||||
|
||||
case GameLanguage::LANGUAGE_BRITISH:
|
||||
return "british";
|
||||
|
||||
case GameLanguage::LANGUAGE_RUSSIAN:
|
||||
return "russian";
|
||||
|
||||
case GameLanguage::LANGUAGE_POLISH:
|
||||
return "polish";
|
||||
|
||||
case GameLanguage::LANGUAGE_KOREAN:
|
||||
return "korean";
|
||||
|
||||
case GameLanguage::LANGUAGE_JAPANESE:
|
||||
return "japanese";
|
||||
|
||||
case GameLanguage::LANGUAGE_CZECH:
|
||||
return "czech";
|
||||
|
||||
case GameLanguage::LANGUAGE_FRENCH_CAN:
|
||||
return "frenchcan";
|
||||
|
||||
case GameLanguage::LANGUAGE_AUSTRIAN:
|
||||
return "austrian";
|
||||
|
||||
case GameLanguage::LANGUAGE_PORTUGUESE:
|
||||
return "portuguese";
|
||||
|
||||
case GameLanguage::LANGUAGE_MEXICAN_SPANISH:
|
||||
return "mexicanspanish";
|
||||
|
||||
case GameLanguage::LANGUAGE_FULL_JAPANESE:
|
||||
return "fulljapanese";
|
||||
}
|
||||
}
|
||||
|
||||
void AssetDumperLocalizeEntry::DumpPool(Zone* zone, AssetPool<LocalizeEntry>* pool, const std::string& basePath)
|
||||
{
|
||||
if (pool->m_asset_lookup.empty())
|
||||
return;
|
||||
|
||||
const std::string language = GetNameOfLanguage(zone->m_language);
|
||||
const std::string language = LocalizeCommon::GetNameOfLanguage(zone->m_language);
|
||||
const std::string stringsPath = utils::Path::Combine(basePath, language + "/localizedstrings");
|
||||
|
||||
FileAPI::DirectoryCreate(stringsPath);
|
||||
|
@ -2,12 +2,12 @@
|
||||
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Game/GameLanguage.h"
|
||||
|
||||
class AssetDumperLocalizeEntry final : public IAssetDumper<T6::LocalizeEntry>
|
||||
namespace T6
|
||||
{
|
||||
static std::string GetNameOfLanguage(GameLanguage language);
|
||||
|
||||
public:
|
||||
void DumpPool(Zone* zone, AssetPool<T6::LocalizeEntry>* pool, const std::string& basePath) override;
|
||||
};
|
||||
class AssetDumperLocalizeEntry final : public IAssetDumper<T6::LocalizeEntry>
|
||||
{
|
||||
public:
|
||||
void DumpPool(Zone* zone, AssetPool<T6::LocalizeEntry>* pool, const std::string& basePath) override;
|
||||
};
|
||||
}
|
||||
|
@ -3,10 +3,13 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
class AssetDumperQdb final : public AbstractAssetDumper<T6::Qdb>
|
||||
namespace T6
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(T6::Qdb* asset) override;
|
||||
std::string GetFileNameForAsset(Zone* zone, T6::Qdb* asset) override;
|
||||
void DumpAsset(Zone* zone, T6::Qdb* asset, FileAPI::File* out) override;
|
||||
};
|
||||
class AssetDumperQdb final : public AbstractAssetDumper<T6::Qdb>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(T6::Qdb* asset) override;
|
||||
std::string GetFileNameForAsset(Zone* zone, T6::Qdb* asset) override;
|
||||
void DumpAsset(Zone* zone, T6::Qdb* asset, FileAPI::File* out) override;
|
||||
};
|
||||
}
|
||||
|
@ -3,10 +3,13 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
class AssetDumperRawFile final : public AbstractAssetDumper<T6::RawFile>
|
||||
namespace T6
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(T6::RawFile* asset) override;
|
||||
std::string GetFileNameForAsset(Zone* zone, T6::RawFile* asset) override;
|
||||
void DumpAsset(Zone* zone, T6::RawFile* asset, FileAPI::File* out) override;
|
||||
};
|
||||
class AssetDumperRawFile final : public AbstractAssetDumper<T6::RawFile>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(T6::RawFile* asset) override;
|
||||
std::string GetFileNameForAsset(Zone* zone, T6::RawFile* asset) override;
|
||||
void DumpAsset(Zone* zone, T6::RawFile* asset, FileAPI::File* out) override;
|
||||
};
|
||||
}
|
||||
|
@ -3,10 +3,13 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
class AssetDumperScriptParseTree final : public AbstractAssetDumper<T6::ScriptParseTree>
|
||||
namespace T6
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(T6::ScriptParseTree* asset) override;
|
||||
std::string GetFileNameForAsset(Zone* zone, T6::ScriptParseTree* asset) override;
|
||||
void DumpAsset(Zone* zone, T6::ScriptParseTree* asset, FileAPI::File* out) override;
|
||||
};
|
||||
class AssetDumperScriptParseTree final : public AbstractAssetDumper<T6::ScriptParseTree>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(T6::ScriptParseTree* asset) override;
|
||||
std::string GetFileNameForAsset(Zone* zone, T6::ScriptParseTree* asset) override;
|
||||
void DumpAsset(Zone* zone, T6::ScriptParseTree* asset, FileAPI::File* out) override;
|
||||
};
|
||||
}
|
||||
|
@ -3,10 +3,13 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
class AssetDumperSlug final : public AbstractAssetDumper<T6::Slug>
|
||||
namespace T6
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(T6::Slug* asset) override;
|
||||
std::string GetFileNameForAsset(Zone* zone, T6::Slug* asset) override;
|
||||
void DumpAsset(Zone* zone, T6::Slug* asset, FileAPI::File* out) override;
|
||||
};
|
||||
class AssetDumperSlug final : public AbstractAssetDumper<T6::Slug>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(T6::Slug* asset) override;
|
||||
std::string GetFileNameForAsset(Zone* zone, T6::Slug* asset) override;
|
||||
void DumpAsset(Zone* zone, T6::Slug* asset, FileAPI::File* out) override;
|
||||
};
|
||||
}
|
||||
|
@ -3,10 +3,13 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
class AssetDumperStringTable final : public AbstractAssetDumper<T6::StringTable>
|
||||
namespace T6
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(T6::StringTable* asset) override;
|
||||
std::string GetFileNameForAsset(Zone* zone, T6::StringTable* asset) override;
|
||||
void DumpAsset(Zone* zone, T6::StringTable* asset, FileAPI::File* out) override;
|
||||
};
|
||||
class AssetDumperStringTable final : public AbstractAssetDumper<T6::StringTable>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(T6::StringTable* asset) override;
|
||||
std::string GetFileNameForAsset(Zone* zone, T6::StringTable* asset) override;
|
||||
void DumpAsset(Zone* zone, T6::StringTable* asset, FileAPI::File* out) override;
|
||||
};
|
||||
}
|
||||
|
@ -12,12 +12,14 @@
|
||||
#include "AssetDumpers/AssetDumperGfxImage.h"
|
||||
#include "AssetDumpers/AssetDumperFontIcon.h"
|
||||
|
||||
bool ZoneDumperT6::CanHandleZone(Zone* zone) const
|
||||
using namespace T6;
|
||||
|
||||
bool ZoneDumper::CanHandleZone(Zone* zone) const
|
||||
{
|
||||
return zone->m_game == &g_GameT6;
|
||||
}
|
||||
|
||||
bool ZoneDumperT6::DumpZone(Zone* zone, const std::string& basePath) const
|
||||
bool ZoneDumper::DumpZone(Zone* zone, const std::string& basePath) const
|
||||
{
|
||||
#define DUMP_ASSET_POOL(dumperType, poolName) \
|
||||
if(assetPools->poolName) \
|
||||
@ -80,4 +82,4 @@ bool ZoneDumperT6::DumpZone(Zone* zone, const std::string& basePath) const
|
||||
return true;
|
||||
|
||||
#undef DUMP_ASSET_POOL
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,12 @@
|
||||
#pragma once
|
||||
#include "Dumping/IZoneDumper.h"
|
||||
|
||||
class ZoneDumperT6 final : public IZoneDumper
|
||||
namespace T6
|
||||
{
|
||||
public:
|
||||
bool CanHandleZone(Zone* zone) const override;
|
||||
bool DumpZone(Zone* zone, const std::string& basePath) const override;
|
||||
};
|
||||
class ZoneDumper final : public IZoneDumper
|
||||
{
|
||||
public:
|
||||
bool CanHandleZone(Zone* zone) const override;
|
||||
bool DumpZone(Zone* zone, const std::string& basePath) const override;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user