mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-12-01 00:37:47 +00:00
refactor: move iw3,iw4,iw5,t5 dumpers into seperate folders
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#include "AssetDumperStringTable.h"
|
||||
|
||||
#include "Csv/CsvStream.h"
|
||||
|
||||
using namespace IW3;
|
||||
|
||||
bool AssetDumperStringTable::ShouldDump(XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void AssetDumperStringTable::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
const auto* stringTable = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
CsvOutputStream csv(*assetFile);
|
||||
|
||||
for (auto row = 0; row < stringTable->rowCount; row++)
|
||||
{
|
||||
for (auto column = 0; column < stringTable->columnCount; column++)
|
||||
{
|
||||
csv.WriteColumn(stringTable->values[column + row * stringTable->columnCount]);
|
||||
}
|
||||
|
||||
csv.NextRow();
|
||||
}
|
||||
}
|
||||
14
src/ObjWriting/Game/IW3/StringTable/AssetDumperStringTable.h
Normal file
14
src/ObjWriting/Game/IW3/StringTable/AssetDumperStringTable.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW3/IW3.h"
|
||||
|
||||
namespace IW3
|
||||
{
|
||||
class AssetDumperStringTable final : public AbstractAssetDumper<StringTable>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<StringTable>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset) override;
|
||||
};
|
||||
} // namespace IW3
|
||||
Reference in New Issue
Block a user