mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-13 08:18:21 -05:00
Make AbstractAssetDumper use the XAssetInfo instead of the raw asset pointer to be able to access dependencies and scriptstrings
This commit is contained in:
@ -4,25 +4,26 @@
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
bool AssetDumperStringTable::ShouldDump(StringTable* asset)
|
||||
bool AssetDumperStringTable::ShouldDump(XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperStringTable::GetFileNameForAsset(Zone* zone, StringTable* asset)
|
||||
std::string AssetDumperStringTable::GetFileNameForAsset(Zone* zone, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
return std::string(asset->name);
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperStringTable::DumpAsset(Zone* zone, StringTable* asset, FileAPI::File* out)
|
||||
void AssetDumperStringTable::DumpAsset(Zone* zone, XAssetInfo<StringTable>* asset, FileAPI::File* out)
|
||||
{
|
||||
const auto* stringTable = asset->Asset();
|
||||
CsvWriter csv(out);
|
||||
|
||||
for (int row = 0; row < asset->rowCount; row++)
|
||||
for (int row = 0; row < stringTable->rowCount; row++)
|
||||
{
|
||||
for (int column = 0; column < asset->columnCount; column++)
|
||||
for (int column = 0; column < stringTable->columnCount; column++)
|
||||
{
|
||||
const auto* cell = &asset->values[column + row * asset->columnCount];
|
||||
const auto* cell = &stringTable->values[column + row * stringTable->columnCount];
|
||||
csv.WriteColumn(cell->string);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user