mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 08:05:45 +00:00
Make asset dumpers not provide different implementations for dumping to gdt and raw so any dumper can decide itself how many raw files and gdt entries it wants to make use of
This commit is contained in:
parent
e544d043bd
commit
e324c20641
@ -2,10 +2,6 @@
|
||||
|
||||
#include "IAssetDumper.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
|
||||
template<class T>
|
||||
class AbstractAssetDumper : public IAssetDumper<T>
|
||||
{
|
||||
@ -15,77 +11,19 @@ protected:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool CanDumpAsRaw()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool CanDumpAsGdtEntry()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual std::string GetFileNameForAsset(Zone* zone, XAssetInfo<T>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
virtual void DumpRaw(AssetDumpingContext& context, XAssetInfo<T>* asset, std::ostream& stream)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
virtual GdtEntry DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<T>* asset)
|
||||
{
|
||||
return GdtEntry();
|
||||
}
|
||||
virtual void DumpAsset(AssetDumpingContext& context, XAssetInfo<T>* asset) = 0;
|
||||
|
||||
public:
|
||||
void DumpPool(AssetDumpingContext& context, AssetPool<T>* pool) override
|
||||
{
|
||||
if(context.m_gdt && CanDumpAsGdtEntry())
|
||||
for (auto assetInfo : *pool)
|
||||
{
|
||||
for (auto assetInfo : *pool)
|
||||
if (assetInfo->m_name[0] == ',' || !ShouldDump(assetInfo))
|
||||
{
|
||||
if (assetInfo->m_name[0] == ','
|
||||
|| !ShouldDump(assetInfo))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
auto entry = DumpGdtEntry(context, assetInfo);
|
||||
context.m_gdt->WriteEntry(entry);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if(CanDumpAsRaw())
|
||||
{
|
||||
for (auto assetInfo : *pool)
|
||||
{
|
||||
if (assetInfo->m_name[0] == ','
|
||||
|| !ShouldDump(assetInfo))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
std::filesystem::path assetFilePath(context.m_base_path);
|
||||
assetFilePath.append(GetFileNameForAsset(context.m_zone, assetInfo));
|
||||
|
||||
auto assetFileFolder(assetFilePath);
|
||||
assetFileFolder.replace_filename("");
|
||||
create_directories(assetFileFolder);
|
||||
|
||||
std::ofstream file(assetFilePath, std::fstream::out | std::fstream::binary);
|
||||
if (file.is_open())
|
||||
{
|
||||
DumpRaw(context, assetInfo, file);
|
||||
|
||||
file.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Failed to open file '" << assetFilePath.string() << "' to dump asset '" << assetInfo->m_name.c_str() << "'\n";
|
||||
}
|
||||
}
|
||||
DumpAsset(context, assetInfo);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,6 +1,29 @@
|
||||
#include "AssetDumpingContext.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
|
||||
AssetDumpingContext::AssetDumpingContext()
|
||||
: m_zone(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
std::unique_ptr<std::ostream> AssetDumpingContext::OpenAssetFile(const std::string& fileName) const
|
||||
{
|
||||
std::filesystem::path assetFilePath(m_base_path);
|
||||
assetFilePath.append(fileName);
|
||||
|
||||
auto assetFileFolder(assetFilePath);
|
||||
assetFileFolder.replace_filename("");
|
||||
create_directories(assetFileFolder);
|
||||
|
||||
auto file = std::make_unique<std::ofstream>(assetFilePath, std::fstream::out | std::fstream::binary);
|
||||
|
||||
if (!file->is_open())
|
||||
{
|
||||
std::cout << "Failed to open file '" << assetFilePath.string() << "' to dump asset '" << fileName << "'\n";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return std::move(file);
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <ostream>
|
||||
#include <memory>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Obj/Gdt/GdtStream.h"
|
||||
#include "Zone/Zone.h"
|
||||
|
||||
@ -13,4 +16,6 @@ public:
|
||||
std::unique_ptr<GdtOutputStream> m_gdt;
|
||||
|
||||
AssetDumpingContext();
|
||||
|
||||
_NODISCARD std::unique_ptr<std::ostream> OpenAssetFile(const std::string& fileName) const;
|
||||
};
|
||||
|
@ -31,12 +31,7 @@ bool AssetDumperGfxImage::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
return image->cardMemory.platform[0] > 0;
|
||||
}
|
||||
|
||||
bool AssetDumperGfxImage::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperGfxImage::GetFileNameForAsset(Zone* zone, XAssetInfo<GfxImage>* asset)
|
||||
std::string AssetDumperGfxImage::GetAssetFileName(XAssetInfo<GfxImage>* asset) const
|
||||
{
|
||||
std::string cleanAssetName = asset->m_name;
|
||||
for (auto& c : cleanAssetName)
|
||||
@ -55,8 +50,14 @@ std::string AssetDumperGfxImage::GetFileNameForAsset(Zone* zone, XAssetInfo<GfxI
|
||||
return "images/" + cleanAssetName + m_writer->GetFileExtension();
|
||||
}
|
||||
|
||||
void AssetDumperGfxImage::DumpRaw(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset, std::ostream& stream)
|
||||
void AssetDumperGfxImage::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
const auto* image = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(GetAssetFileName(asset));
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
m_writer->DumpImage(stream, image->texture.texture);
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ namespace IW3
|
||||
{
|
||||
std::unique_ptr<IImageWriter> m_writer;
|
||||
|
||||
std::string GetAssetFileName(XAssetInfo<GfxImage>* asset) const;
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<GfxImage>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<GfxImage>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset) override;
|
||||
|
||||
public:
|
||||
AssetDumperGfxImage();
|
||||
|
@ -9,16 +9,6 @@ bool AssetDumperLoadedSound::ShouldDump(XAssetInfo<LoadedSound>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperLoadedSound::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperLoadedSound::GetFileNameForAsset(Zone* zone, XAssetInfo<LoadedSound>* asset)
|
||||
{
|
||||
return "sound/" + asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperLoadedSound::DumpWavPcm(AssetDumpingContext& context, const LoadedSound* asset, std::ostream& stream)
|
||||
{
|
||||
const auto riffMasterChunkSize = sizeof(WAV_CHUNK_ID_RIFF)
|
||||
@ -60,9 +50,15 @@ void AssetDumperLoadedSound::DumpWavPcm(AssetDumpingContext& context, const Load
|
||||
stream.write(asset->sound.data, asset->sound.info.data_len);
|
||||
}
|
||||
|
||||
void AssetDumperLoadedSound::DumpRaw(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset, std::ostream& stream)
|
||||
void AssetDumperLoadedSound::DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset)
|
||||
{
|
||||
const auto* loadedSound = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile("sound/" + asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
switch (static_cast<WavFormat>(loadedSound->sound.info.format))
|
||||
{
|
||||
case WavFormat::PCM:
|
||||
|
@ -8,10 +8,9 @@ namespace IW3
|
||||
class AssetDumperLoadedSound final : public AbstractAssetDumper<LoadedSound>
|
||||
{
|
||||
static void DumpWavPcm(AssetDumpingContext& context, const LoadedSound* asset, std::ostream& stream);
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<LoadedSound>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<LoadedSound>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -1,13 +1,11 @@
|
||||
#include "AssetDumperLocalizeEntry.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include <sstream>
|
||||
|
||||
#include "Localize/LocalizeCommon.h"
|
||||
#include "Dumping/Localize/StringFileDumper.h"
|
||||
|
||||
using namespace IW3;
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool)
|
||||
{
|
||||
@ -15,20 +13,14 @@ void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<
|
||||
return;
|
||||
|
||||
const auto language = LocalizeCommon::GetNameOfLanguage(context.m_zone->m_language);
|
||||
fs::path stringsPath(context.m_base_path);
|
||||
stringsPath.append(language);
|
||||
stringsPath.append("localizedstrings");
|
||||
|
||||
create_directories(stringsPath);
|
||||
std::ostringstream ss;
|
||||
ss << language << "/localizedstrings/" << context.m_zone->m_name << ".str";
|
||||
const auto assetFile = context.OpenAssetFile(ss.str());
|
||||
|
||||
auto stringFilePath(stringsPath);
|
||||
stringFilePath.append(context.m_zone->m_name + ".str");
|
||||
|
||||
std::ofstream stringFile(stringFilePath, std::fstream::out | std::ofstream::binary);
|
||||
|
||||
if (stringFile.is_open())
|
||||
if (assetFile)
|
||||
{
|
||||
StringFileDumper stringFileDumper(context.m_zone, stringFile);
|
||||
StringFileDumper stringFileDumper(context.m_zone, *assetFile);
|
||||
|
||||
stringFileDumper.SetLanguageName(language);
|
||||
|
||||
@ -43,8 +35,6 @@ void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<
|
||||
}
|
||||
|
||||
stringFileDumper.Finalize();
|
||||
|
||||
stringFile.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -7,18 +7,14 @@ bool AssetDumperMapEnts::ShouldDump(XAssetInfo<MapEnts>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperMapEnts::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperMapEnts::GetFileNameForAsset(Zone* zone, XAssetInfo<MapEnts>* asset)
|
||||
{
|
||||
return asset->m_name + ".ents";
|
||||
}
|
||||
|
||||
void AssetDumperMapEnts::DumpRaw(AssetDumpingContext& context, XAssetInfo<MapEnts>* asset, std::ostream& stream)
|
||||
void AssetDumperMapEnts::DumpAsset(AssetDumpingContext& context, XAssetInfo<MapEnts>* asset)
|
||||
{
|
||||
const auto* mapEnts = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name + ".ents");
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
stream.write(mapEnts->entityString, mapEnts->numEntityChars);
|
||||
}
|
||||
|
@ -9,8 +9,6 @@ namespace IW3
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<MapEnts>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<MapEnts>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<MapEnts>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<MapEnts>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -7,18 +7,14 @@ bool AssetDumperRawFile::ShouldDump(XAssetInfo<RawFile>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperRawFile::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperRawFile::GetFileNameForAsset(Zone* zone, XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperRawFile::DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream)
|
||||
void AssetDumperRawFile::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
const auto* rawFile = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
stream.write(rawFile->buffer, rawFile->len);
|
||||
}
|
||||
|
@ -9,8 +9,6 @@ namespace IW3
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<RawFile>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<RawFile>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -9,20 +9,15 @@ bool AssetDumperStringTable::ShouldDump(XAssetInfo<StringTable>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperStringTable::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperStringTable::GetFileNameForAsset(Zone* zone, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperStringTable::DumpRaw(AssetDumpingContext& context, XAssetInfo<StringTable>* asset, std::ostream& stream)
|
||||
void AssetDumperStringTable::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
const auto* stringTable = asset->Asset();
|
||||
CsvOutputStream csv(stream);
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
CsvOutputStream csv(*assetFile);
|
||||
|
||||
for (auto row = 0; row < stringTable->rowCount; row++)
|
||||
{
|
||||
|
@ -9,9 +9,6 @@ namespace IW3
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<StringTable>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<StringTable>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<StringTable>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -10,18 +10,15 @@ bool AssetDumperAddonMapEnts::ShouldDump(XAssetInfo<AddonMapEnts>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperAddonMapEnts::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperAddonMapEnts::GetFileNameForAsset(Zone* zone, XAssetInfo<AddonMapEnts>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperAddonMapEnts::DumpRaw(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset, std::ostream& stream)
|
||||
void AssetDumperAddonMapEnts::DumpAsset(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset)
|
||||
{
|
||||
const auto* addonMapEnts = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
|
||||
stream.write(addonMapEnts->entityString, std::max(addonMapEnts->numEntityChars - 1, 0));
|
||||
}
|
||||
|
@ -9,8 +9,6 @@ namespace IW4
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<AddonMapEnts>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<AddonMapEnts>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -31,12 +31,7 @@ bool AssetDumperGfxImage::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
return image->cardMemory.platform[0] > 0;
|
||||
}
|
||||
|
||||
bool AssetDumperGfxImage::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperGfxImage::GetFileNameForAsset(Zone* zone, XAssetInfo<GfxImage>* asset)
|
||||
std::string AssetDumperGfxImage::GetAssetFileName(XAssetInfo<GfxImage>* asset) const
|
||||
{
|
||||
std::string cleanAssetName = asset->m_name;
|
||||
for (auto& c : cleanAssetName)
|
||||
@ -55,8 +50,14 @@ std::string AssetDumperGfxImage::GetFileNameForAsset(Zone* zone, XAssetInfo<GfxI
|
||||
return "images/" + cleanAssetName + m_writer->GetFileExtension();
|
||||
}
|
||||
|
||||
void AssetDumperGfxImage::DumpRaw(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset, std::ostream& stream)
|
||||
void AssetDumperGfxImage::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
const auto* image = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(GetAssetFileName(asset));
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
m_writer->DumpImage(stream, image->texture.texture);
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ namespace IW4
|
||||
{
|
||||
std::unique_ptr<IImageWriter> m_writer;
|
||||
|
||||
std::string GetAssetFileName(XAssetInfo<GfxImage>* asset) const;
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<GfxImage>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<GfxImage>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset) override;
|
||||
|
||||
public:
|
||||
AssetDumperGfxImage();
|
||||
|
@ -9,16 +9,6 @@ bool AssetDumperLoadedSound::ShouldDump(XAssetInfo<LoadedSound>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperLoadedSound::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperLoadedSound::GetFileNameForAsset(Zone* zone, XAssetInfo<LoadedSound>* asset)
|
||||
{
|
||||
return "sound/" + asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperLoadedSound::DumpWavPcm(AssetDumpingContext& context, const LoadedSound* asset, std::ostream& stream)
|
||||
{
|
||||
const auto riffMasterChunkSize = sizeof(WAV_CHUNK_ID_RIFF)
|
||||
@ -60,9 +50,15 @@ void AssetDumperLoadedSound::DumpWavPcm(AssetDumpingContext& context, const Load
|
||||
stream.write(asset->sound.data, asset->sound.info.data_len);
|
||||
}
|
||||
|
||||
void AssetDumperLoadedSound::DumpRaw(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset, std::ostream& stream)
|
||||
void AssetDumperLoadedSound::DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset)
|
||||
{
|
||||
const auto* loadedSound = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile("sound/" + asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
switch (static_cast<WavFormat>(loadedSound->sound.info.format))
|
||||
{
|
||||
case WavFormat::PCM:
|
||||
|
@ -10,8 +10,6 @@ namespace IW4
|
||||
static void DumpWavPcm(AssetDumpingContext& context, const LoadedSound* asset, std::ostream& stream);
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<LoadedSound>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<LoadedSound>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -1,13 +1,11 @@
|
||||
#include "AssetDumperLocalizeEntry.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include <sstream>
|
||||
|
||||
#include "Localize/LocalizeCommon.h"
|
||||
#include "Dumping/Localize/StringFileDumper.h"
|
||||
|
||||
using namespace IW4;
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool)
|
||||
{
|
||||
@ -15,20 +13,14 @@ void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<
|
||||
return;
|
||||
|
||||
const auto language = LocalizeCommon::GetNameOfLanguage(context.m_zone->m_language);
|
||||
fs::path stringsPath(context.m_base_path);
|
||||
stringsPath.append(language);
|
||||
stringsPath.append("localizedstrings");
|
||||
|
||||
create_directories(stringsPath);
|
||||
std::ostringstream ss;
|
||||
ss << language << "/localizedstrings/" << context.m_zone->m_name << ".str";
|
||||
const auto assetFile = context.OpenAssetFile(ss.str());
|
||||
|
||||
auto stringFilePath(stringsPath);
|
||||
stringFilePath.append(context.m_zone->m_name + ".str");
|
||||
|
||||
std::ofstream stringFile(stringFilePath, std::fstream::out | std::ofstream::binary);
|
||||
|
||||
if (stringFile.is_open())
|
||||
if (assetFile)
|
||||
{
|
||||
StringFileDumper stringFileDumper(context.m_zone, stringFile);
|
||||
StringFileDumper stringFileDumper(context.m_zone, *assetFile);
|
||||
|
||||
stringFileDumper.SetLanguageName(language);
|
||||
|
||||
@ -43,8 +35,6 @@ void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<
|
||||
}
|
||||
|
||||
stringFileDumper.Finalize();
|
||||
|
||||
stringFile.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -10,19 +10,15 @@ bool AssetDumperRawFile::ShouldDump(XAssetInfo<RawFile>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperRawFile::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperRawFile::GetFileNameForAsset(Zone* zone, XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperRawFile::DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream)
|
||||
void AssetDumperRawFile::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
const auto* rawFile = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
if (rawFile->compressedLen > 0)
|
||||
{
|
||||
z_stream_s zs{};
|
||||
|
@ -9,8 +9,6 @@ namespace IW4
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<RawFile>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<RawFile>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -9,20 +9,15 @@ bool AssetDumperStringTable::ShouldDump(XAssetInfo<StringTable>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperStringTable::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperStringTable::GetFileNameForAsset(Zone* zone, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperStringTable::DumpRaw(AssetDumpingContext& context, XAssetInfo<StringTable>* asset, std::ostream& stream)
|
||||
void AssetDumperStringTable::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
const auto* stringTable = asset->Asset();
|
||||
CsvOutputStream csv(stream);
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
CsvOutputStream csv(*assetFile);
|
||||
|
||||
for (auto row = 0; row < stringTable->rowCount; row++)
|
||||
{
|
||||
|
@ -9,9 +9,6 @@ namespace IW4
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<StringTable>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<StringTable>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<StringTable>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -11,149 +11,149 @@ using namespace IW4;
|
||||
|
||||
cspField_t AssetDumperVehicle::vehicle_fields[]
|
||||
{
|
||||
{ "type", offsetof(VehicleDef, type), VFT_TYPE },
|
||||
{ "useHintString", offsetof(VehicleDef, useHintString), CSPFT_STRING },
|
||||
{ "health", offsetof(VehicleDef, health), CSPFT_INT },
|
||||
{ "quadBarrel", offsetof(VehicleDef, quadBarrel), CSPFT_QBOOLEAN },
|
||||
{ "texureScrollScale", offsetof(VehicleDef, texScrollScale), CSPFT_FLOAT },
|
||||
{ "topSpeed", offsetof(VehicleDef, topSpeed), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "accel", offsetof(VehicleDef, accel), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "rotRate", offsetof(VehicleDef, rotRate), CSPFT_FLOAT },
|
||||
{ "rotAccel", offsetof(VehicleDef, rotAccel), CSPFT_FLOAT },
|
||||
{ "maxBodyPitch", offsetof(VehicleDef, maxBodyPitch), CSPFT_FLOAT },
|
||||
{ "maxBodyRoll", offsetof(VehicleDef, maxBodyRoll), CSPFT_FLOAT },
|
||||
{ "fakeBodyAccelPitch", offsetof(VehicleDef, fakeBodyAccelPitch), CSPFT_FLOAT },
|
||||
{ "fakeBodyAccelRoll", offsetof(VehicleDef, fakeBodyAccelRoll), CSPFT_FLOAT },
|
||||
{ "fakeBodyVelPitch", offsetof(VehicleDef, fakeBodyVelPitch), CSPFT_FLOAT },
|
||||
{ "fakeBodyVelRoll", offsetof(VehicleDef, fakeBodyVelRoll), CSPFT_FLOAT },
|
||||
{ "fakeBodySideVelPitch", offsetof(VehicleDef, fakeBodySideVelPitch), CSPFT_FLOAT },
|
||||
{ "fakeBodyPitchStrength", offsetof(VehicleDef, fakeBodyPitchStrength), CSPFT_FLOAT },
|
||||
{ "fakeBodyRollStrength", offsetof(VehicleDef, fakeBodyRollStrength), CSPFT_FLOAT },
|
||||
{ "fakeBodyPitchDampening", offsetof(VehicleDef, fakeBodyPitchDampening), CSPFT_FLOAT },
|
||||
{ "fakeBodyRollDampening", offsetof(VehicleDef, fakeBodyRollDampening), CSPFT_FLOAT },
|
||||
{ "fakeBodyBoatRockingAmplitude", offsetof(VehicleDef, fakeBodyBoatRockingAmplitude), CSPFT_FLOAT },
|
||||
{ "fakeBodyBoatRockingPeriod", offsetof(VehicleDef, fakeBodyBoatRockingPeriod), CSPFT_FLOAT },
|
||||
{ "fakeBodyBoatRockingRotationPeriod", offsetof(VehicleDef, fakeBodyBoatRockingRotationPeriod), CSPFT_FLOAT },
|
||||
{ "fakeBodyBoatRockingFadeoutSpeed", offsetof(VehicleDef, fakeBodyBoatRockingFadeoutSpeed), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "boatBouncingMinForce", offsetof(VehicleDef, boatBouncingMinForce), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "boatBouncingMaxForce", offsetof(VehicleDef, boatBouncingMaxForce), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "boatBouncingRate", offsetof(VehicleDef, boatBouncingRate), CSPFT_FLOAT },
|
||||
{ "boatBouncingFadeinSpeed", offsetof(VehicleDef, boatBouncingFadeinSpeed), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "boatBouncingFadeoutSteeringAngle", offsetof(VehicleDef, boatBouncingFadeoutSteeringAngle), CSPFT_FLOAT },
|
||||
{ "collisionDamage", offsetof(VehicleDef, collisionDamage), CSPFT_FLOAT },
|
||||
{ "collisionSpeed", offsetof(VehicleDef, collisionSpeed), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "killcamZDist", offsetof(VehicleDef, killcamOffset[0]), CSPFT_FLOAT },
|
||||
{ "killcamBackDist", offsetof(VehicleDef, killcamOffset[1]), CSPFT_FLOAT },
|
||||
{ "killcamUpDist", offsetof(VehicleDef, killcamOffset[2]), CSPFT_FLOAT },
|
||||
{ "playerProtected", offsetof(VehicleDef, playerProtected), CSPFT_QBOOLEAN },
|
||||
{ "bulletDamage", offsetof(VehicleDef, bulletDamage), CSPFT_QBOOLEAN },
|
||||
{ "armorPiercingDamage", offsetof(VehicleDef, armorPiercingDamage), CSPFT_QBOOLEAN },
|
||||
{ "grenadeDamage", offsetof(VehicleDef, grenadeDamage), CSPFT_QBOOLEAN },
|
||||
{ "projectileDamage", offsetof(VehicleDef, projectileDamage), CSPFT_QBOOLEAN },
|
||||
{ "projectileSplashDamage", offsetof(VehicleDef, projectileSplashDamage), CSPFT_QBOOLEAN },
|
||||
{ "heavyExplosiveDamage", offsetof(VehicleDef, heavyExplosiveDamage), CSPFT_QBOOLEAN },
|
||||
{ "physicsEnabled", offsetof(VehicleDef, vehPhysDef.physicsEnabled), CSPFT_QBOOLEAN },
|
||||
{ "physicsPreset", offsetof(VehicleDef, vehPhysDef.physPresetName), CSPFT_STRING },
|
||||
{ "accelerationGraph", offsetof(VehicleDef, vehPhysDef.accelGraphName), CSPFT_STRING },
|
||||
{ "steeringAxle", offsetof(VehicleDef, vehPhysDef.steeringAxle), VFT_AXLE_STEERING },
|
||||
{ "powerAxle", offsetof(VehicleDef, vehPhysDef.powerAxle), VFT_AXLE_POWER },
|
||||
{ "brakingAxle", offsetof(VehicleDef, vehPhysDef.brakingAxle), VFT_AXLE_BRAKING },
|
||||
{ "reverseSpeed", offsetof(VehicleDef, vehPhysDef.reverseSpeed), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "maxVelocity", offsetof(VehicleDef, vehPhysDef.maxVelocity), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "maxPitch", offsetof(VehicleDef, vehPhysDef.maxPitch), CSPFT_FLOAT },
|
||||
{ "maxRoll", offsetof(VehicleDef, vehPhysDef.maxRoll), CSPFT_FLOAT },
|
||||
{ "suspensionTravelRear", offsetof(VehicleDef, vehPhysDef.suspensionTravelRear), CSPFT_FLOAT },
|
||||
{ "suspensionStrengthFront", offsetof(VehicleDef, vehPhysDef.suspensionStrengthFront), CSPFT_FLOAT },
|
||||
{ "suspensionDampingFront", offsetof(VehicleDef, vehPhysDef.suspensionDampingFront), CSPFT_FLOAT },
|
||||
{ "suspensionStrengthRear", offsetof(VehicleDef, vehPhysDef.suspensionStrengthRear), CSPFT_FLOAT },
|
||||
{ "suspensionDampingRear", offsetof(VehicleDef, vehPhysDef.suspensionDampingRear), CSPFT_FLOAT },
|
||||
{ "frictionBraking", offsetof(VehicleDef, vehPhysDef.frictionBraking), CSPFT_FLOAT },
|
||||
{ "frictionCoasting", offsetof(VehicleDef, vehPhysDef.frictionCoasting), CSPFT_FLOAT },
|
||||
{ "frictionTopSpeed", offsetof(VehicleDef, vehPhysDef.frictionTopSpeed), CSPFT_FLOAT },
|
||||
{ "frictionSide", offsetof(VehicleDef, vehPhysDef.frictionSide), CSPFT_FLOAT },
|
||||
{ "frictionSideRear", offsetof(VehicleDef, vehPhysDef.frictionSideRear), CSPFT_FLOAT },
|
||||
{ "velocityDependentSlip", offsetof(VehicleDef, vehPhysDef.velocityDependentSlip), CSPFT_FLOAT },
|
||||
{ "rollStability", offsetof(VehicleDef, vehPhysDef.rollStability), CSPFT_FLOAT },
|
||||
{ "rollResistance", offsetof(VehicleDef, vehPhysDef.rollResistance), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "pitchResistance", offsetof(VehicleDef, vehPhysDef.pitchResistance), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "yawResistance", offsetof(VehicleDef, vehPhysDef.yawResistance), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "uprightStrengthPitch", offsetof(VehicleDef, vehPhysDef.uprightStrengthPitch), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "uprightStrengthRoll", offsetof(VehicleDef, vehPhysDef.uprightStrengthRoll), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "targetAirPitch", offsetof(VehicleDef, vehPhysDef.targetAirPitch), CSPFT_FLOAT },
|
||||
{ "airYawTorque", offsetof(VehicleDef, vehPhysDef.airYawTorque), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "airPitchTorque", offsetof(VehicleDef, vehPhysDef.airPitchTorque), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "minimumMomentumForCollision", offsetof(VehicleDef, vehPhysDef.minimumMomentumForCollision), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "collisionLaunchForceScale", offsetof(VehicleDef, vehPhysDef.collisionLaunchForceScale), CSPFT_FLOAT },
|
||||
{ "wreckedMassScale", offsetof(VehicleDef, vehPhysDef.wreckedMassScale), CSPFT_FLOAT },
|
||||
{ "wreckedBodyFriction", offsetof(VehicleDef, vehPhysDef.wreckedBodyFriction), CSPFT_FLOAT },
|
||||
{ "minimumJoltForNotify", offsetof(VehicleDef, vehPhysDef.minimumJoltForNotify), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "slipThresholdFront", offsetof(VehicleDef, vehPhysDef.slipThresholdFront), CSPFT_FLOAT },
|
||||
{ "slipThresholdRear", offsetof(VehicleDef, vehPhysDef.slipThresholdRear), CSPFT_FLOAT },
|
||||
{ "slipFricScaleFront", offsetof(VehicleDef, vehPhysDef.slipFricScaleFront), CSPFT_FLOAT },
|
||||
{ "slipFricScaleRear", offsetof(VehicleDef, vehPhysDef.slipFricScaleRear), CSPFT_FLOAT },
|
||||
{ "slipFricRateFront", offsetof(VehicleDef, vehPhysDef.slipFricRateFront), CSPFT_FLOAT },
|
||||
{ "slipFricRateRear", offsetof(VehicleDef, vehPhysDef.slipFricRateRear), CSPFT_FLOAT },
|
||||
{ "slipYawTorque", offsetof(VehicleDef, vehPhysDef.slipYawTorque), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "boostDuration", offsetof(VehicleDef, boostDuration), CSPFT_FLOAT },
|
||||
{ "boostRechargeTime", offsetof(VehicleDef, boostRechargeTime), CSPFT_FLOAT },
|
||||
{ "boostAcceleration", offsetof(VehicleDef, boostAcceleration), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "suspensionTravel", offsetof(VehicleDef, suspensionTravel), CSPFT_FLOAT },
|
||||
{ "maxSteeringAngle", offsetof(VehicleDef, maxSteeringAngle), CSPFT_FLOAT },
|
||||
{ "steeringLerp", offsetof(VehicleDef, steeringLerp), CSPFT_FLOAT },
|
||||
{ "minSteeringScale", offsetof(VehicleDef, minSteeringScale), CSPFT_FLOAT },
|
||||
{ "minSteeringSpeed", offsetof(VehicleDef, minSteeringSpeed), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "camLookEnabled", offsetof(VehicleDef, camLookEnabled), CSPFT_QBOOLEAN },
|
||||
{ "camLerp", offsetof(VehicleDef, camLerp), CSPFT_FLOAT },
|
||||
{ "camPitchInfluence", offsetof(VehicleDef, camPitchInfluence), CSPFT_FLOAT },
|
||||
{ "camRollInfluence", offsetof(VehicleDef, camRollInfluence), CSPFT_FLOAT },
|
||||
{ "camFovIncrease", offsetof(VehicleDef, camFovIncrease), CSPFT_FLOAT },
|
||||
{ "camFovOffset", offsetof(VehicleDef, camFovOffset), CSPFT_FLOAT },
|
||||
{ "camFovSpeed", offsetof(VehicleDef, camFovSpeed), CSPFT_FLOAT },
|
||||
{ "turretWeaponName", offsetof(VehicleDef, turretWeaponName), CSPFT_STRING },
|
||||
{ "turretHorizSpanLeft", offsetof(VehicleDef, turretHorizSpanLeft), CSPFT_FLOAT },
|
||||
{ "turretHorizSpanRight", offsetof(VehicleDef, turretHorizSpanRight), CSPFT_FLOAT },
|
||||
{ "turretVertSpanUp", offsetof(VehicleDef, turretVertSpanUp), CSPFT_FLOAT },
|
||||
{ "turretVertSpanDown", offsetof(VehicleDef, turretVertSpanDown), CSPFT_FLOAT },
|
||||
{ "turretRotRate", offsetof(VehicleDef, turretRotRate), CSPFT_FLOAT },
|
||||
{ "turretSpinSnd", offsetof(VehicleDef, turretSpinSnd), CSPFT_SOUND },
|
||||
{ "turretStopSnd", offsetof(VehicleDef, turretStopSnd), CSPFT_SOUND },
|
||||
{ "trophyEnabled", offsetof(VehicleDef, trophyEnabled), CSPFT_QBOOLEAN },
|
||||
{ "trophyRadius", offsetof(VehicleDef, trophyRadius), CSPFT_FLOAT },
|
||||
{ "trophyInactiveRadius", offsetof(VehicleDef, trophyInactiveRadius), CSPFT_FLOAT },
|
||||
{ "trophyAmmoCount", offsetof(VehicleDef, trophyAmmoCount), CSPFT_INT },
|
||||
{ "trophyReloadTime", offsetof(VehicleDef, trophyReloadTime), CSPFT_FLOAT },
|
||||
{ "trophyTags", offsetof(VehicleDef, trophyTags), VFT_TROPHY_TAGS },
|
||||
{ "compassFriendlyIcon", offsetof(VehicleDef, compassFriendlyIcon), CSPFT_MATERIAL },
|
||||
{ "compassEnemyIcon", offsetof(VehicleDef, compassEnemyIcon), CSPFT_MATERIAL },
|
||||
{ "compassIconWidth", offsetof(VehicleDef, compassIconWidth), CSPFT_INT },
|
||||
{ "compassIconHeight", offsetof(VehicleDef, compassIconHeight), CSPFT_INT },
|
||||
{ "lowIdleSnd", offsetof(VehicleDef, idleLowSnd), CSPFT_SOUND },
|
||||
{ "highIdleSnd", offsetof(VehicleDef, idleHighSnd), CSPFT_SOUND },
|
||||
{ "lowEngineSnd", offsetof(VehicleDef, engineLowSnd), CSPFT_SOUND },
|
||||
{ "highEngineSnd", offsetof(VehicleDef, engineHighSnd), CSPFT_SOUND },
|
||||
{ "engineSndSpeed", offsetof(VehicleDef, engineSndSpeed), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "engineStartUpSnd", offsetof(VehicleDef, engineStartUpSnd), CSPFT_SOUND },
|
||||
{ "engineStartUpLength", offsetof(VehicleDef, engineStartUpLength), CSPFT_MILLISECONDS },
|
||||
{ "engineShutdownSnd", offsetof(VehicleDef, engineShutdownSnd), CSPFT_SOUND },
|
||||
{ "engineIdleSnd", offsetof(VehicleDef, engineIdleSnd), CSPFT_SOUND },
|
||||
{ "engineSustainSnd", offsetof(VehicleDef, engineSustainSnd), CSPFT_SOUND },
|
||||
{ "engineRampUpSnd", offsetof(VehicleDef, engineRampUpSnd), CSPFT_SOUND },
|
||||
{ "engineRampUpLength", offsetof(VehicleDef, engineRampUpLength), CSPFT_MILLISECONDS },
|
||||
{ "engineRampDownSnd", offsetof(VehicleDef, engineRampDownSnd), CSPFT_SOUND },
|
||||
{ "engineRampDownLength", offsetof(VehicleDef, engineRampDownLength), CSPFT_MILLISECONDS },
|
||||
{ "suspensionSoftSnd", offsetof(VehicleDef, suspensionSoftSnd), CSPFT_SOUND },
|
||||
{ "suspensionSoftCompression", offsetof(VehicleDef, suspensionSoftCompression), CSPFT_FLOAT },
|
||||
{ "suspensionHardSnd", offsetof(VehicleDef, suspensionHardSnd), CSPFT_SOUND },
|
||||
{ "suspensionHardCompression", offsetof(VehicleDef, suspensionHardCompression), CSPFT_FLOAT },
|
||||
{ "collisionSnd", offsetof(VehicleDef, collisionSnd), CSPFT_SOUND },
|
||||
{ "collisionBlendSpeed", offsetof(VehicleDef, collisionBlendSpeed), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "speedSnd", offsetof(VehicleDef, speedSnd), CSPFT_SOUND },
|
||||
{ "speedSndBlendSpeed", offsetof(VehicleDef, speedSndBlendSpeed), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "surfaceSndPrefix", offsetof(VehicleDef, surfaceSndPrefix), CSPFT_STRING },
|
||||
{ "surfaceSndBlendSpeed", offsetof(VehicleDef, surfaceSndBlendSpeed), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "slideVolume", offsetof(VehicleDef, slideVolume), CSPFT_FLOAT },
|
||||
{ "slideBlendSpeed", offsetof(VehicleDef, slideBlendSpeed), CSPFT_MPH_TO_INCHES_PER_SEC },
|
||||
{ "inAirPitch", offsetof(VehicleDef, inAirPitch), CSPFT_FLOAT },
|
||||
{"type", offsetof(VehicleDef, type), VFT_TYPE},
|
||||
{"useHintString", offsetof(VehicleDef, useHintString), CSPFT_STRING},
|
||||
{"health", offsetof(VehicleDef, health), CSPFT_INT},
|
||||
{"quadBarrel", offsetof(VehicleDef, quadBarrel), CSPFT_QBOOLEAN},
|
||||
{"texureScrollScale", offsetof(VehicleDef, texScrollScale), CSPFT_FLOAT},
|
||||
{"topSpeed", offsetof(VehicleDef, topSpeed), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"accel", offsetof(VehicleDef, accel), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"rotRate", offsetof(VehicleDef, rotRate), CSPFT_FLOAT},
|
||||
{"rotAccel", offsetof(VehicleDef, rotAccel), CSPFT_FLOAT},
|
||||
{"maxBodyPitch", offsetof(VehicleDef, maxBodyPitch), CSPFT_FLOAT},
|
||||
{"maxBodyRoll", offsetof(VehicleDef, maxBodyRoll), CSPFT_FLOAT},
|
||||
{"fakeBodyAccelPitch", offsetof(VehicleDef, fakeBodyAccelPitch), CSPFT_FLOAT},
|
||||
{"fakeBodyAccelRoll", offsetof(VehicleDef, fakeBodyAccelRoll), CSPFT_FLOAT},
|
||||
{"fakeBodyVelPitch", offsetof(VehicleDef, fakeBodyVelPitch), CSPFT_FLOAT},
|
||||
{"fakeBodyVelRoll", offsetof(VehicleDef, fakeBodyVelRoll), CSPFT_FLOAT},
|
||||
{"fakeBodySideVelPitch", offsetof(VehicleDef, fakeBodySideVelPitch), CSPFT_FLOAT},
|
||||
{"fakeBodyPitchStrength", offsetof(VehicleDef, fakeBodyPitchStrength), CSPFT_FLOAT},
|
||||
{"fakeBodyRollStrength", offsetof(VehicleDef, fakeBodyRollStrength), CSPFT_FLOAT},
|
||||
{"fakeBodyPitchDampening", offsetof(VehicleDef, fakeBodyPitchDampening), CSPFT_FLOAT},
|
||||
{"fakeBodyRollDampening", offsetof(VehicleDef, fakeBodyRollDampening), CSPFT_FLOAT},
|
||||
{"fakeBodyBoatRockingAmplitude", offsetof(VehicleDef, fakeBodyBoatRockingAmplitude), CSPFT_FLOAT},
|
||||
{"fakeBodyBoatRockingPeriod", offsetof(VehicleDef, fakeBodyBoatRockingPeriod), CSPFT_FLOAT},
|
||||
{"fakeBodyBoatRockingRotationPeriod", offsetof(VehicleDef, fakeBodyBoatRockingRotationPeriod), CSPFT_FLOAT},
|
||||
{"fakeBodyBoatRockingFadeoutSpeed", offsetof(VehicleDef, fakeBodyBoatRockingFadeoutSpeed), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"boatBouncingMinForce", offsetof(VehicleDef, boatBouncingMinForce), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"boatBouncingMaxForce", offsetof(VehicleDef, boatBouncingMaxForce), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"boatBouncingRate", offsetof(VehicleDef, boatBouncingRate), CSPFT_FLOAT},
|
||||
{"boatBouncingFadeinSpeed", offsetof(VehicleDef, boatBouncingFadeinSpeed), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"boatBouncingFadeoutSteeringAngle", offsetof(VehicleDef, boatBouncingFadeoutSteeringAngle), CSPFT_FLOAT},
|
||||
{"collisionDamage", offsetof(VehicleDef, collisionDamage), CSPFT_FLOAT},
|
||||
{"collisionSpeed", offsetof(VehicleDef, collisionSpeed), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"killcamZDist", offsetof(VehicleDef, killcamOffset[0]), CSPFT_FLOAT},
|
||||
{"killcamBackDist", offsetof(VehicleDef, killcamOffset[1]), CSPFT_FLOAT},
|
||||
{"killcamUpDist", offsetof(VehicleDef, killcamOffset[2]), CSPFT_FLOAT},
|
||||
{"playerProtected", offsetof(VehicleDef, playerProtected), CSPFT_QBOOLEAN},
|
||||
{"bulletDamage", offsetof(VehicleDef, bulletDamage), CSPFT_QBOOLEAN},
|
||||
{"armorPiercingDamage", offsetof(VehicleDef, armorPiercingDamage), CSPFT_QBOOLEAN},
|
||||
{"grenadeDamage", offsetof(VehicleDef, grenadeDamage), CSPFT_QBOOLEAN},
|
||||
{"projectileDamage", offsetof(VehicleDef, projectileDamage), CSPFT_QBOOLEAN},
|
||||
{"projectileSplashDamage", offsetof(VehicleDef, projectileSplashDamage), CSPFT_QBOOLEAN},
|
||||
{"heavyExplosiveDamage", offsetof(VehicleDef, heavyExplosiveDamage), CSPFT_QBOOLEAN},
|
||||
{"physicsEnabled", offsetof(VehicleDef, vehPhysDef.physicsEnabled), CSPFT_QBOOLEAN},
|
||||
{"physicsPreset", offsetof(VehicleDef, vehPhysDef.physPresetName), CSPFT_STRING},
|
||||
{"accelerationGraph", offsetof(VehicleDef, vehPhysDef.accelGraphName), CSPFT_STRING},
|
||||
{"steeringAxle", offsetof(VehicleDef, vehPhysDef.steeringAxle), VFT_AXLE_STEERING},
|
||||
{"powerAxle", offsetof(VehicleDef, vehPhysDef.powerAxle), VFT_AXLE_POWER},
|
||||
{"brakingAxle", offsetof(VehicleDef, vehPhysDef.brakingAxle), VFT_AXLE_BRAKING},
|
||||
{"reverseSpeed", offsetof(VehicleDef, vehPhysDef.reverseSpeed), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"maxVelocity", offsetof(VehicleDef, vehPhysDef.maxVelocity), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"maxPitch", offsetof(VehicleDef, vehPhysDef.maxPitch), CSPFT_FLOAT},
|
||||
{"maxRoll", offsetof(VehicleDef, vehPhysDef.maxRoll), CSPFT_FLOAT},
|
||||
{"suspensionTravelRear", offsetof(VehicleDef, vehPhysDef.suspensionTravelRear), CSPFT_FLOAT},
|
||||
{"suspensionStrengthFront", offsetof(VehicleDef, vehPhysDef.suspensionStrengthFront), CSPFT_FLOAT},
|
||||
{"suspensionDampingFront", offsetof(VehicleDef, vehPhysDef.suspensionDampingFront), CSPFT_FLOAT},
|
||||
{"suspensionStrengthRear", offsetof(VehicleDef, vehPhysDef.suspensionStrengthRear), CSPFT_FLOAT},
|
||||
{"suspensionDampingRear", offsetof(VehicleDef, vehPhysDef.suspensionDampingRear), CSPFT_FLOAT},
|
||||
{"frictionBraking", offsetof(VehicleDef, vehPhysDef.frictionBraking), CSPFT_FLOAT},
|
||||
{"frictionCoasting", offsetof(VehicleDef, vehPhysDef.frictionCoasting), CSPFT_FLOAT},
|
||||
{"frictionTopSpeed", offsetof(VehicleDef, vehPhysDef.frictionTopSpeed), CSPFT_FLOAT},
|
||||
{"frictionSide", offsetof(VehicleDef, vehPhysDef.frictionSide), CSPFT_FLOAT},
|
||||
{"frictionSideRear", offsetof(VehicleDef, vehPhysDef.frictionSideRear), CSPFT_FLOAT},
|
||||
{"velocityDependentSlip", offsetof(VehicleDef, vehPhysDef.velocityDependentSlip), CSPFT_FLOAT},
|
||||
{"rollStability", offsetof(VehicleDef, vehPhysDef.rollStability), CSPFT_FLOAT},
|
||||
{"rollResistance", offsetof(VehicleDef, vehPhysDef.rollResistance), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"pitchResistance", offsetof(VehicleDef, vehPhysDef.pitchResistance), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"yawResistance", offsetof(VehicleDef, vehPhysDef.yawResistance), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"uprightStrengthPitch", offsetof(VehicleDef, vehPhysDef.uprightStrengthPitch), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"uprightStrengthRoll", offsetof(VehicleDef, vehPhysDef.uprightStrengthRoll), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"targetAirPitch", offsetof(VehicleDef, vehPhysDef.targetAirPitch), CSPFT_FLOAT},
|
||||
{"airYawTorque", offsetof(VehicleDef, vehPhysDef.airYawTorque), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"airPitchTorque", offsetof(VehicleDef, vehPhysDef.airPitchTorque), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"minimumMomentumForCollision", offsetof(VehicleDef, vehPhysDef.minimumMomentumForCollision), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"collisionLaunchForceScale", offsetof(VehicleDef, vehPhysDef.collisionLaunchForceScale), CSPFT_FLOAT},
|
||||
{"wreckedMassScale", offsetof(VehicleDef, vehPhysDef.wreckedMassScale), CSPFT_FLOAT},
|
||||
{"wreckedBodyFriction", offsetof(VehicleDef, vehPhysDef.wreckedBodyFriction), CSPFT_FLOAT},
|
||||
{"minimumJoltForNotify", offsetof(VehicleDef, vehPhysDef.minimumJoltForNotify), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"slipThresholdFront", offsetof(VehicleDef, vehPhysDef.slipThresholdFront), CSPFT_FLOAT},
|
||||
{"slipThresholdRear", offsetof(VehicleDef, vehPhysDef.slipThresholdRear), CSPFT_FLOAT},
|
||||
{"slipFricScaleFront", offsetof(VehicleDef, vehPhysDef.slipFricScaleFront), CSPFT_FLOAT},
|
||||
{"slipFricScaleRear", offsetof(VehicleDef, vehPhysDef.slipFricScaleRear), CSPFT_FLOAT},
|
||||
{"slipFricRateFront", offsetof(VehicleDef, vehPhysDef.slipFricRateFront), CSPFT_FLOAT},
|
||||
{"slipFricRateRear", offsetof(VehicleDef, vehPhysDef.slipFricRateRear), CSPFT_FLOAT},
|
||||
{"slipYawTorque", offsetof(VehicleDef, vehPhysDef.slipYawTorque), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"boostDuration", offsetof(VehicleDef, boostDuration), CSPFT_FLOAT},
|
||||
{"boostRechargeTime", offsetof(VehicleDef, boostRechargeTime), CSPFT_FLOAT},
|
||||
{"boostAcceleration", offsetof(VehicleDef, boostAcceleration), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"suspensionTravel", offsetof(VehicleDef, suspensionTravel), CSPFT_FLOAT},
|
||||
{"maxSteeringAngle", offsetof(VehicleDef, maxSteeringAngle), CSPFT_FLOAT},
|
||||
{"steeringLerp", offsetof(VehicleDef, steeringLerp), CSPFT_FLOAT},
|
||||
{"minSteeringScale", offsetof(VehicleDef, minSteeringScale), CSPFT_FLOAT},
|
||||
{"minSteeringSpeed", offsetof(VehicleDef, minSteeringSpeed), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"camLookEnabled", offsetof(VehicleDef, camLookEnabled), CSPFT_QBOOLEAN},
|
||||
{"camLerp", offsetof(VehicleDef, camLerp), CSPFT_FLOAT},
|
||||
{"camPitchInfluence", offsetof(VehicleDef, camPitchInfluence), CSPFT_FLOAT},
|
||||
{"camRollInfluence", offsetof(VehicleDef, camRollInfluence), CSPFT_FLOAT},
|
||||
{"camFovIncrease", offsetof(VehicleDef, camFovIncrease), CSPFT_FLOAT},
|
||||
{"camFovOffset", offsetof(VehicleDef, camFovOffset), CSPFT_FLOAT},
|
||||
{"camFovSpeed", offsetof(VehicleDef, camFovSpeed), CSPFT_FLOAT},
|
||||
{"turretWeaponName", offsetof(VehicleDef, turretWeaponName), CSPFT_STRING},
|
||||
{"turretHorizSpanLeft", offsetof(VehicleDef, turretHorizSpanLeft), CSPFT_FLOAT},
|
||||
{"turretHorizSpanRight", offsetof(VehicleDef, turretHorizSpanRight), CSPFT_FLOAT},
|
||||
{"turretVertSpanUp", offsetof(VehicleDef, turretVertSpanUp), CSPFT_FLOAT},
|
||||
{"turretVertSpanDown", offsetof(VehicleDef, turretVertSpanDown), CSPFT_FLOAT},
|
||||
{"turretRotRate", offsetof(VehicleDef, turretRotRate), CSPFT_FLOAT},
|
||||
{"turretSpinSnd", offsetof(VehicleDef, turretSpinSnd), CSPFT_SOUND},
|
||||
{"turretStopSnd", offsetof(VehicleDef, turretStopSnd), CSPFT_SOUND},
|
||||
{"trophyEnabled", offsetof(VehicleDef, trophyEnabled), CSPFT_QBOOLEAN},
|
||||
{"trophyRadius", offsetof(VehicleDef, trophyRadius), CSPFT_FLOAT},
|
||||
{"trophyInactiveRadius", offsetof(VehicleDef, trophyInactiveRadius), CSPFT_FLOAT},
|
||||
{"trophyAmmoCount", offsetof(VehicleDef, trophyAmmoCount), CSPFT_INT},
|
||||
{"trophyReloadTime", offsetof(VehicleDef, trophyReloadTime), CSPFT_FLOAT},
|
||||
{"trophyTags", offsetof(VehicleDef, trophyTags), VFT_TROPHY_TAGS},
|
||||
{"compassFriendlyIcon", offsetof(VehicleDef, compassFriendlyIcon), CSPFT_MATERIAL},
|
||||
{"compassEnemyIcon", offsetof(VehicleDef, compassEnemyIcon), CSPFT_MATERIAL},
|
||||
{"compassIconWidth", offsetof(VehicleDef, compassIconWidth), CSPFT_INT},
|
||||
{"compassIconHeight", offsetof(VehicleDef, compassIconHeight), CSPFT_INT},
|
||||
{"lowIdleSnd", offsetof(VehicleDef, idleLowSnd), CSPFT_SOUND},
|
||||
{"highIdleSnd", offsetof(VehicleDef, idleHighSnd), CSPFT_SOUND},
|
||||
{"lowEngineSnd", offsetof(VehicleDef, engineLowSnd), CSPFT_SOUND},
|
||||
{"highEngineSnd", offsetof(VehicleDef, engineHighSnd), CSPFT_SOUND},
|
||||
{"engineSndSpeed", offsetof(VehicleDef, engineSndSpeed), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"engineStartUpSnd", offsetof(VehicleDef, engineStartUpSnd), CSPFT_SOUND},
|
||||
{"engineStartUpLength", offsetof(VehicleDef, engineStartUpLength), CSPFT_MILLISECONDS},
|
||||
{"engineShutdownSnd", offsetof(VehicleDef, engineShutdownSnd), CSPFT_SOUND},
|
||||
{"engineIdleSnd", offsetof(VehicleDef, engineIdleSnd), CSPFT_SOUND},
|
||||
{"engineSustainSnd", offsetof(VehicleDef, engineSustainSnd), CSPFT_SOUND},
|
||||
{"engineRampUpSnd", offsetof(VehicleDef, engineRampUpSnd), CSPFT_SOUND},
|
||||
{"engineRampUpLength", offsetof(VehicleDef, engineRampUpLength), CSPFT_MILLISECONDS},
|
||||
{"engineRampDownSnd", offsetof(VehicleDef, engineRampDownSnd), CSPFT_SOUND},
|
||||
{"engineRampDownLength", offsetof(VehicleDef, engineRampDownLength), CSPFT_MILLISECONDS},
|
||||
{"suspensionSoftSnd", offsetof(VehicleDef, suspensionSoftSnd), CSPFT_SOUND},
|
||||
{"suspensionSoftCompression", offsetof(VehicleDef, suspensionSoftCompression), CSPFT_FLOAT},
|
||||
{"suspensionHardSnd", offsetof(VehicleDef, suspensionHardSnd), CSPFT_SOUND},
|
||||
{"suspensionHardCompression", offsetof(VehicleDef, suspensionHardCompression), CSPFT_FLOAT},
|
||||
{"collisionSnd", offsetof(VehicleDef, collisionSnd), CSPFT_SOUND},
|
||||
{"collisionBlendSpeed", offsetof(VehicleDef, collisionBlendSpeed), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"speedSnd", offsetof(VehicleDef, speedSnd), CSPFT_SOUND},
|
||||
{"speedSndBlendSpeed", offsetof(VehicleDef, speedSndBlendSpeed), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"surfaceSndPrefix", offsetof(VehicleDef, surfaceSndPrefix), CSPFT_STRING},
|
||||
{"surfaceSndBlendSpeed", offsetof(VehicleDef, surfaceSndBlendSpeed), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"slideVolume", offsetof(VehicleDef, slideVolume), CSPFT_FLOAT},
|
||||
{"slideBlendSpeed", offsetof(VehicleDef, slideBlendSpeed), CSPFT_MPH_TO_INCHES_PER_SEC},
|
||||
{"inAirPitch", offsetof(VehicleDef, inAirPitch), CSPFT_FLOAT},
|
||||
};
|
||||
|
||||
namespace IW4
|
||||
@ -176,28 +176,28 @@ namespace IW4
|
||||
break;
|
||||
|
||||
case VFT_TROPHY_TAGS:
|
||||
{
|
||||
const auto* trophyTags = reinterpret_cast<scr_string_t*>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset);
|
||||
std::stringstream ss;
|
||||
bool first = true;
|
||||
|
||||
for (auto i = 0u; i < std::extent<decltype(VehicleDef::trophyTags)>::value; i++)
|
||||
{
|
||||
const auto& str = m_get_scr_string(trophyTags[i]);
|
||||
if (!str.empty())
|
||||
const auto* trophyTags = reinterpret_cast<scr_string_t*>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset);
|
||||
std::stringstream ss;
|
||||
bool first = true;
|
||||
|
||||
for (auto i = 0u; i < std::extent<decltype(VehicleDef::trophyTags)>::value; i++)
|
||||
{
|
||||
if (!first)
|
||||
ss << "\n";
|
||||
else
|
||||
first = false;
|
||||
const auto& str = m_get_scr_string(trophyTags[i]);
|
||||
if (!str.empty())
|
||||
{
|
||||
if (!first)
|
||||
ss << "\n";
|
||||
else
|
||||
first = false;
|
||||
|
||||
ss << str;
|
||||
ss << str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_info_string.SetValueForKey(std::string(field.szName), ss.str());
|
||||
break;
|
||||
}
|
||||
m_info_string.SetValueForKey(std::string(field.szName), ss.str());
|
||||
break;
|
||||
}
|
||||
|
||||
case VFT_NUM:
|
||||
default:
|
||||
@ -217,13 +217,13 @@ namespace IW4
|
||||
InfoString AssetDumperVehicle::CreateInfoString(XAssetInfo<VehicleDef>* asset)
|
||||
{
|
||||
InfoStringFromVehicleConverter converter(asset->Asset(), vehicle_fields, std::extent<decltype(vehicle_fields)>::value, [asset](const scr_string_t scrStr) -> std::string
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.Count());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.Count())
|
||||
return "";
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.Count());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.Count())
|
||||
return "";
|
||||
|
||||
return asset->m_zone->m_script_strings[scrStr];
|
||||
});
|
||||
return asset->m_zone->m_script_strings[scrStr];
|
||||
});
|
||||
|
||||
return converter.Convert();
|
||||
}
|
||||
@ -233,33 +233,26 @@ bool AssetDumperVehicle::ShouldDump(XAssetInfo<VehicleDef>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperVehicle::CanDumpAsRaw()
|
||||
void AssetDumperVehicle::DumpAsset(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, GDF_NAME);
|
||||
infoString.ToGdtProperties(FILE_TYPE_STR, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile("vehicles/" + asset->m_name);
|
||||
|
||||
bool AssetDumperVehicle::CanDumpAsGdtEntry()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
std::string AssetDumperVehicle::GetFileNameForAsset(Zone* zone, XAssetInfo<VehicleDef>* asset)
|
||||
{
|
||||
return "vehicles/" + asset->m_name;
|
||||
}
|
||||
|
||||
GdtEntry AssetDumperVehicle::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, GDF_NAME);
|
||||
infoString.ToGdtProperties(FILE_TYPE_STR, gdtEntry);
|
||||
|
||||
return gdtEntry;
|
||||
}
|
||||
|
||||
void AssetDumperVehicle::DumpRaw(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset, std::ostream& stream)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(FILE_TYPE_STR);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(FILE_TYPE_STR);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
@ -16,11 +16,6 @@ namespace IW4
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<VehicleDef>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
bool CanDumpAsGdtEntry() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<VehicleDef>* asset) override;
|
||||
GdtEntry DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -1013,33 +1013,26 @@ bool AssetDumperWeapon::ShouldDump(XAssetInfo<WeaponCompleteDef>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperWeapon::CanDumpAsRaw()
|
||||
void AssetDumperWeapon::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, GDF_NAME);
|
||||
infoString.ToGdtProperties(FILE_TYPE_STR, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile("weapons/" + asset->m_name);
|
||||
|
||||
bool AssetDumperWeapon::CanDumpAsGdtEntry()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
std::string AssetDumperWeapon::GetFileNameForAsset(Zone* zone, XAssetInfo<WeaponCompleteDef>* asset)
|
||||
{
|
||||
return "weapons/" + asset->m_name;
|
||||
}
|
||||
|
||||
GdtEntry AssetDumperWeapon::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, GDF_NAME);
|
||||
infoString.ToGdtProperties(FILE_TYPE_STR, gdtEntry);
|
||||
|
||||
return gdtEntry;
|
||||
}
|
||||
|
||||
void AssetDumperWeapon::DumpRaw(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset, std::ostream& stream)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(FILE_TYPE_STR);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(FILE_TYPE_STR);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
@ -17,11 +17,6 @@ namespace IW4
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<WeaponCompleteDef>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
bool CanDumpAsGdtEntry() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<WeaponCompleteDef>* asset) override;
|
||||
GdtEntry DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -10,18 +10,14 @@ bool AssetDumperAddonMapEnts::ShouldDump(XAssetInfo<AddonMapEnts>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperAddonMapEnts::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperAddonMapEnts::GetFileNameForAsset(Zone* zone, XAssetInfo<AddonMapEnts>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperAddonMapEnts::DumpRaw(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset, std::ostream& stream)
|
||||
void AssetDumperAddonMapEnts::DumpAsset(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset)
|
||||
{
|
||||
const auto* addonMapEnts = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
stream.write(addonMapEnts->entityString, std::max(addonMapEnts->numEntityChars - 1, 0));
|
||||
}
|
||||
|
@ -9,8 +9,6 @@ namespace IW5
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<AddonMapEnts>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<AddonMapEnts>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -31,12 +31,7 @@ bool AssetDumperGfxImage::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
return image->cardMemory.platform[0] > 0;
|
||||
}
|
||||
|
||||
bool AssetDumperGfxImage::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperGfxImage::GetFileNameForAsset(Zone* zone, XAssetInfo<GfxImage>* asset)
|
||||
std::string AssetDumperGfxImage::GetAssetFileName(XAssetInfo<GfxImage>* asset) const
|
||||
{
|
||||
std::string cleanAssetName = asset->m_name;
|
||||
for (auto& c : cleanAssetName)
|
||||
@ -55,8 +50,14 @@ std::string AssetDumperGfxImage::GetFileNameForAsset(Zone* zone, XAssetInfo<GfxI
|
||||
return "images/" + cleanAssetName + m_writer->GetFileExtension();
|
||||
}
|
||||
|
||||
void AssetDumperGfxImage::DumpRaw(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset, std::ostream& stream)
|
||||
void AssetDumperGfxImage::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
const auto* image = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(GetAssetFileName(asset));
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
m_writer->DumpImage(stream, image->texture.texture);
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ namespace IW5
|
||||
{
|
||||
std::unique_ptr<IImageWriter> m_writer;
|
||||
|
||||
std::string GetAssetFileName(XAssetInfo<GfxImage>* asset) const;
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<GfxImage>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<GfxImage>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset) override;
|
||||
|
||||
public:
|
||||
AssetDumperGfxImage();
|
||||
|
@ -9,16 +9,6 @@ bool AssetDumperLoadedSound::ShouldDump(XAssetInfo<LoadedSound>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperLoadedSound::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperLoadedSound::GetFileNameForAsset(Zone* zone, XAssetInfo<LoadedSound>* asset)
|
||||
{
|
||||
return "sound/" + asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperLoadedSound::DumpWavPcm(AssetDumpingContext& context, const LoadedSound* asset, std::ostream& stream)
|
||||
{
|
||||
const auto riffMasterChunkSize = sizeof(WAV_CHUNK_ID_RIFF)
|
||||
@ -60,9 +50,15 @@ void AssetDumperLoadedSound::DumpWavPcm(AssetDumpingContext& context, const Load
|
||||
stream.write(asset->sound.data, asset->sound.info.data_len);
|
||||
}
|
||||
|
||||
void AssetDumperLoadedSound::DumpRaw(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset, std::ostream& stream)
|
||||
void AssetDumperLoadedSound::DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset)
|
||||
{
|
||||
const auto* loadedSound = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile("sound/" + asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
switch (static_cast<WavFormat>(loadedSound->sound.info.format))
|
||||
{
|
||||
case WavFormat::PCM:
|
||||
|
@ -8,10 +8,9 @@ namespace IW5
|
||||
class AssetDumperLoadedSound final : public AbstractAssetDumper<LoadedSound>
|
||||
{
|
||||
static void DumpWavPcm(AssetDumpingContext& context, const LoadedSound* asset, std::ostream& stream);
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<LoadedSound>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<LoadedSound>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -1,13 +1,11 @@
|
||||
#include "AssetDumperLocalizeEntry.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include <sstream>
|
||||
|
||||
#include "Localize/LocalizeCommon.h"
|
||||
#include "Dumping/Localize/StringFileDumper.h"
|
||||
|
||||
using namespace IW5;
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool)
|
||||
{
|
||||
@ -15,20 +13,14 @@ void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<
|
||||
return;
|
||||
|
||||
const auto language = LocalizeCommon::GetNameOfLanguage(context.m_zone->m_language);
|
||||
fs::path stringsPath(context.m_base_path);
|
||||
stringsPath.append(language);
|
||||
stringsPath.append("localizedstrings");
|
||||
|
||||
create_directories(stringsPath);
|
||||
std::ostringstream ss;
|
||||
ss << language << "/localizedstrings/" << context.m_zone->m_name << ".str";
|
||||
const auto assetFile = context.OpenAssetFile(ss.str());
|
||||
|
||||
auto stringFilePath(stringsPath);
|
||||
stringFilePath.append(context.m_zone->m_name + ".str");
|
||||
|
||||
std::ofstream stringFile(stringFilePath, std::fstream::out | std::ofstream::binary);
|
||||
|
||||
if (stringFile.is_open())
|
||||
if (assetFile)
|
||||
{
|
||||
StringFileDumper stringFileDumper(context.m_zone, stringFile);
|
||||
StringFileDumper stringFileDumper(context.m_zone, *assetFile);
|
||||
|
||||
stringFileDumper.SetLanguageName(language);
|
||||
|
||||
@ -43,8 +35,6 @@ void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<
|
||||
}
|
||||
|
||||
stringFileDumper.Finalize();
|
||||
|
||||
stringFile.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -10,12 +10,7 @@ bool AssetDumperRawFile::ShouldDump(XAssetInfo<RawFile>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperRawFile::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperRawFile::GetFileNameForAsset(Zone* zone, XAssetInfo<RawFile>* asset)
|
||||
std::string AssetDumperRawFile::GetAssetFileName(XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
std::string cleanAssetName = asset->m_name;
|
||||
for (auto& c : cleanAssetName)
|
||||
@ -34,9 +29,15 @@ std::string AssetDumperRawFile::GetFileNameForAsset(Zone* zone, XAssetInfo<RawFi
|
||||
return cleanAssetName;
|
||||
}
|
||||
|
||||
void AssetDumperRawFile::DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream)
|
||||
void AssetDumperRawFile::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
const auto* rawFile = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
if (rawFile->compressedLen <= 0)
|
||||
return;
|
||||
|
||||
|
@ -7,10 +7,10 @@ namespace IW5
|
||||
{
|
||||
class AssetDumperRawFile final : public AbstractAssetDumper<RawFile>
|
||||
{
|
||||
static std::string GetAssetFileName(XAssetInfo<GfxImage>* asset);
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<RawFile>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<RawFile>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -9,20 +9,15 @@ bool AssetDumperStringTable::ShouldDump(XAssetInfo<StringTable>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperStringTable::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperStringTable::GetFileNameForAsset(Zone* zone, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperStringTable::DumpRaw(AssetDumpingContext& context, XAssetInfo<StringTable>* asset, std::ostream& stream)
|
||||
void AssetDumperStringTable::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
const auto* stringTable = asset->Asset();
|
||||
CsvOutputStream csv(stream);
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
CsvOutputStream csv(*assetFile);
|
||||
|
||||
for (auto row = 0; row < stringTable->rowCount; row++)
|
||||
{
|
||||
|
@ -9,9 +9,6 @@ namespace IW5
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<StringTable>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<StringTable>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<StringTable>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -31,18 +31,33 @@ bool AssetDumperGfxImage::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
return image->loadedSize > 0;
|
||||
}
|
||||
|
||||
bool AssetDumperGfxImage::CanDumpAsRaw()
|
||||
std::string AssetDumperGfxImage::GetAssetFileName(XAssetInfo<GfxImage>* asset) const
|
||||
{
|
||||
return true;
|
||||
std::string cleanAssetName = asset->m_name;
|
||||
for (auto& c : cleanAssetName)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case '*':
|
||||
c = '_';
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return "images/" + cleanAssetName + m_writer->GetFileExtension();
|
||||
}
|
||||
|
||||
std::string AssetDumperGfxImage::GetFileNameForAsset(Zone* zone, XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
return "images/" + asset->m_name + m_writer->GetFileExtension();
|
||||
}
|
||||
|
||||
void AssetDumperGfxImage::DumpRaw(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset, std::ostream& stream)
|
||||
void AssetDumperGfxImage::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
const auto* image = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(GetAssetFileName(asset));
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
m_writer->DumpImage(stream, image->texture.texture);
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ namespace T5
|
||||
{
|
||||
std::unique_ptr<IImageWriter> m_writer;
|
||||
|
||||
std::string GetAssetFileName(XAssetInfo<GfxImage>* asset) const;
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<GfxImage>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<GfxImage>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset) override;
|
||||
|
||||
public:
|
||||
AssetDumperGfxImage();
|
||||
|
@ -1,13 +1,11 @@
|
||||
#include "AssetDumperLocalizeEntry.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include <sstream>
|
||||
|
||||
#include "Localize/LocalizeCommon.h"
|
||||
#include "Dumping/Localize/StringFileDumper.h"
|
||||
|
||||
using namespace T5;
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool)
|
||||
{
|
||||
@ -15,20 +13,14 @@ void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<
|
||||
return;
|
||||
|
||||
const auto language = LocalizeCommon::GetNameOfLanguage(context.m_zone->m_language);
|
||||
fs::path stringsPath(context.m_base_path);
|
||||
stringsPath.append(language);
|
||||
stringsPath.append("localizedstrings");
|
||||
|
||||
create_directories(stringsPath);
|
||||
std::ostringstream ss;
|
||||
ss << language << "/localizedstrings/" << context.m_zone->m_name << ".str";
|
||||
const auto assetFile = context.OpenAssetFile(ss.str());
|
||||
|
||||
auto stringFilePath(stringsPath);
|
||||
stringFilePath.append(context.m_zone->m_name + ".str");
|
||||
|
||||
std::ofstream stringFile(stringFilePath, std::fstream::out | std::ofstream::binary);
|
||||
|
||||
if (stringFile.is_open())
|
||||
if (assetFile)
|
||||
{
|
||||
StringFileDumper stringFileDumper(context.m_zone, stringFile);
|
||||
StringFileDumper stringFileDumper(context.m_zone, *assetFile);
|
||||
|
||||
stringFileDumper.SetLanguageName(language);
|
||||
|
||||
@ -43,8 +35,6 @@ void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<
|
||||
}
|
||||
|
||||
stringFileDumper.Finalize();
|
||||
|
||||
stringFile.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -91,24 +91,19 @@ bool AssetDumperRawFile::ShouldDump(XAssetInfo<RawFile>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperRawFile::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperRawFile::GetFileNameForAsset(Zone* zone, XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperRawFile::DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream)
|
||||
void AssetDumperRawFile::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
const auto* rawFile = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const fs::path rawFilePath(rawFile->name);
|
||||
const auto extension = rawFilePath.extension().string();
|
||||
|
||||
if(extension == ".gsc" || extension == ".csc")
|
||||
if (extension == ".gsc" || extension == ".csc")
|
||||
{
|
||||
DumpGsc(context, asset, stream);
|
||||
}
|
||||
|
@ -9,13 +9,10 @@ namespace T5
|
||||
{
|
||||
constexpr static size_t GSC_MAX_SIZE = 0xC000000;
|
||||
|
||||
void DumpGsc(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream);
|
||||
static void DumpGsc(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream);
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<RawFile>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<RawFile>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -9,20 +9,15 @@ bool AssetDumperStringTable::ShouldDump(XAssetInfo<StringTable>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperStringTable::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperStringTable::GetFileNameForAsset(Zone* zone, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperStringTable::DumpRaw(AssetDumpingContext& context, XAssetInfo<StringTable>* asset, std::ostream& stream)
|
||||
void AssetDumperStringTable::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
const auto* stringTable = asset->Asset();
|
||||
CsvOutputStream csv(stream);
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
CsvOutputStream csv(*assetFile);
|
||||
|
||||
for (auto row = 0; row < stringTable->rowCount; row++)
|
||||
{
|
||||
|
@ -9,9 +9,6 @@ namespace T5
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<StringTable>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<StringTable>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<StringTable>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -260,18 +260,13 @@ bool AssetDumperFontIcon::ShouldDump(XAssetInfo<FontIcon>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperFontIcon::CanDumpAsRaw()
|
||||
void AssetDumperFontIcon::DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
std::string AssetDumperFontIcon::GetFileNameForAsset(Zone* zone, XAssetInfo<FontIcon>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
void AssetDumperFontIcon::DumpRaw(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset, std::ostream& stream)
|
||||
{
|
||||
AssetDumperFontIconInternal dumper(stream);
|
||||
AssetDumperFontIconInternal dumper(*assetFile);
|
||||
dumper.DumpFontIcon(asset->Asset());
|
||||
}
|
||||
|
@ -9,9 +9,6 @@ namespace T6
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<FontIcon>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<FontIcon>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -31,12 +31,7 @@ bool AssetDumperGfxImage::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
return image->loadedSize > 0;
|
||||
}
|
||||
|
||||
bool AssetDumperGfxImage::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperGfxImage::GetFileNameForAsset(Zone* zone, XAssetInfo<GfxImage>* asset)
|
||||
std::string AssetDumperGfxImage::GetAssetFileName(XAssetInfo<GfxImage>* asset) const
|
||||
{
|
||||
std::string cleanAssetName = asset->m_name;
|
||||
for (auto& c : cleanAssetName)
|
||||
@ -55,8 +50,14 @@ std::string AssetDumperGfxImage::GetFileNameForAsset(Zone* zone, XAssetInfo<GfxI
|
||||
return "images/" + cleanAssetName + m_writer->GetFileExtension();
|
||||
}
|
||||
|
||||
void AssetDumperGfxImage::DumpRaw(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset, std::ostream& stream)
|
||||
void AssetDumperGfxImage::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
const auto* image = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(GetAssetFileName(asset));
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
m_writer->DumpImage(stream, image->texture.texture);
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ namespace T6
|
||||
{
|
||||
std::unique_ptr<IImageWriter> m_writer;
|
||||
|
||||
std::string GetAssetFileName(XAssetInfo<GfxImage>* asset) const;
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<GfxImage>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<GfxImage>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset) override;
|
||||
|
||||
public:
|
||||
AssetDumperGfxImage();
|
||||
|
@ -1,13 +1,11 @@
|
||||
#include "AssetDumperLocalizeEntry.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include <sstream>
|
||||
|
||||
#include "Localize/LocalizeCommon.h"
|
||||
#include "Dumping/Localize/StringFileDumper.h"
|
||||
|
||||
using namespace T6;
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool)
|
||||
{
|
||||
@ -15,20 +13,14 @@ void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<
|
||||
return;
|
||||
|
||||
const auto language = LocalizeCommon::GetNameOfLanguage(context.m_zone->m_language);
|
||||
fs::path stringsPath(context.m_base_path);
|
||||
stringsPath.append(language);
|
||||
stringsPath.append("localizedstrings");
|
||||
|
||||
create_directories(stringsPath);
|
||||
std::ostringstream ss;
|
||||
ss << language << "/localizedstrings/" << context.m_zone->m_name << ".str";
|
||||
const auto assetFile = context.OpenAssetFile(ss.str());
|
||||
|
||||
auto stringFilePath(stringsPath);
|
||||
stringFilePath.append(context.m_zone->m_name + ".str");
|
||||
|
||||
std::ofstream stringFile(stringFilePath, std::fstream::out | std::ofstream::binary);
|
||||
|
||||
if(stringFile.is_open())
|
||||
if (assetFile)
|
||||
{
|
||||
StringFileDumper stringFileDumper(context.m_zone, stringFile);
|
||||
StringFileDumper stringFileDumper(context.m_zone, *assetFile);
|
||||
|
||||
stringFileDumper.SetLanguageName(language);
|
||||
|
||||
@ -43,8 +35,6 @@ void AssetDumperLocalizeEntry::DumpPool(AssetDumpingContext& context, AssetPool<
|
||||
}
|
||||
|
||||
stringFileDumper.Finalize();
|
||||
|
||||
stringFile.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -58,33 +58,26 @@ bool AssetDumperPhysConstraints::ShouldDump(XAssetInfo<PhysConstraints>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperPhysConstraints::CanDumpAsRaw()
|
||||
void AssetDumperPhysConstraints::DumpAsset(AssetDumpingContext& context, XAssetInfo<PhysConstraints>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_PHYS_CONSTRAINTS);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_PHYS_CONSTRAINTS, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile("physconstraints/" + asset->m_name);
|
||||
|
||||
bool AssetDumperPhysConstraints::CanDumpAsGdtEntry()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
std::string AssetDumperPhysConstraints::GetFileNameForAsset(Zone* zone, XAssetInfo<PhysConstraints>* asset)
|
||||
{
|
||||
return "physconstraints/" + asset->m_name;
|
||||
}
|
||||
|
||||
GdtEntry AssetDumperPhysConstraints::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<PhysConstraints>* asset)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_PHYS_CONSTRAINTS);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_PHYS_CONSTRAINTS, gdtEntry);
|
||||
|
||||
return gdtEntry;
|
||||
}
|
||||
|
||||
void AssetDumperPhysConstraints::DumpRaw(AssetDumpingContext& context, XAssetInfo<PhysConstraints>* asset, std::ostream& stream)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_PHYS_CONSTRAINTS);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_PHYS_CONSTRAINTS);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
@ -12,11 +12,6 @@ namespace T6
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<PhysConstraints>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
bool CanDumpAsGdtEntry() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<PhysConstraints>* asset) override;
|
||||
GdtEntry DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<PhysConstraints>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<PhysConstraints>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<PhysConstraints>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -78,33 +78,26 @@ bool AssetDumperPhysPreset::ShouldDump(XAssetInfo<PhysPreset>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperPhysPreset::CanDumpAsRaw()
|
||||
void AssetDumperPhysPreset::DumpAsset(AssetDumpingContext& context, XAssetInfo<PhysPreset>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_PHYS_PRESET);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_PHYS_PRESET, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile("physic/" + asset->m_name);
|
||||
|
||||
bool AssetDumperPhysPreset::CanDumpAsGdtEntry()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
std::string AssetDumperPhysPreset::GetFileNameForAsset(Zone* zone, XAssetInfo<PhysPreset>* asset)
|
||||
{
|
||||
return "physic/" + asset->m_name;
|
||||
}
|
||||
|
||||
GdtEntry AssetDumperPhysPreset::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<PhysPreset>* asset)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_PHYS_PRESET);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_PHYS_PRESET, gdtEntry);
|
||||
|
||||
return gdtEntry;
|
||||
}
|
||||
|
||||
void AssetDumperPhysPreset::DumpRaw(AssetDumpingContext& context, XAssetInfo<PhysPreset>* asset, std::ostream& stream)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_PHYS_PRESET);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_PHYS_PRESET);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
@ -13,11 +13,6 @@ namespace T6
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<PhysPreset>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
bool CanDumpAsGdtEntry() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<PhysPreset>* asset) override;
|
||||
GdtEntry DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<PhysPreset>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<PhysPreset>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<PhysPreset>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -7,18 +7,14 @@ bool AssetDumperQdb::ShouldDump(XAssetInfo<Qdb>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperQdb::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperQdb::GetFileNameForAsset(Zone* zone, XAssetInfo<Qdb>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperQdb::DumpRaw(AssetDumpingContext& context, XAssetInfo<Qdb>* asset, std::ostream& stream)
|
||||
void AssetDumperQdb::DumpAsset(AssetDumpingContext& context, XAssetInfo<Qdb>* asset)
|
||||
{
|
||||
const auto* qdb = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
stream.write(qdb->buffer, qdb->len);
|
||||
}
|
@ -9,9 +9,6 @@ namespace T6
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<Qdb>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<Qdb>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<Qdb>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<Qdb>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -7,18 +7,14 @@ bool AssetDumperRawFile::ShouldDump(XAssetInfo<RawFile>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperRawFile::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperRawFile::GetFileNameForAsset(Zone* zone, XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperRawFile::DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream)
|
||||
void AssetDumperRawFile::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
const auto* rawFile = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
stream.write(rawFile->buffer, rawFile->len);
|
||||
}
|
@ -9,9 +9,6 @@ namespace T6
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<RawFile>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<RawFile>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -7,18 +7,14 @@ bool AssetDumperScriptParseTree::ShouldDump(XAssetInfo<ScriptParseTree>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperScriptParseTree::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperScriptParseTree::GetFileNameForAsset(Zone* zone, XAssetInfo<ScriptParseTree>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperScriptParseTree::DumpRaw(AssetDumpingContext& context, XAssetInfo<ScriptParseTree>* asset, std::ostream& stream)
|
||||
void AssetDumperScriptParseTree::DumpAsset(AssetDumpingContext& context, XAssetInfo<ScriptParseTree>* asset)
|
||||
{
|
||||
const auto* scriptParseTree = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
stream.write(scriptParseTree->buffer, scriptParseTree->len);
|
||||
}
|
@ -9,9 +9,6 @@ namespace T6
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<ScriptParseTree>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<ScriptParseTree>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<ScriptParseTree>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<ScriptParseTree>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -7,18 +7,14 @@ bool AssetDumperSlug::ShouldDump(XAssetInfo<Slug>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperSlug::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperSlug::GetFileNameForAsset(Zone* zone, XAssetInfo<Slug>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperSlug::DumpRaw(AssetDumpingContext& context, XAssetInfo<Slug>* asset, std::ostream& stream)
|
||||
void AssetDumperSlug::DumpAsset(AssetDumpingContext& context, XAssetInfo<Slug>* asset)
|
||||
{
|
||||
const auto* slug = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
stream.write(slug->buffer, slug->len);
|
||||
}
|
@ -9,9 +9,6 @@ namespace T6
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<Slug>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<Slug>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<Slug>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<Slug>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "AssetDumperSndBank.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include <unordered_map>
|
||||
|
||||
|
@ -9,24 +9,19 @@ bool AssetDumperStringTable::ShouldDump(XAssetInfo<StringTable>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperStringTable::CanDumpAsRaw()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string AssetDumperStringTable::GetFileNameForAsset(Zone* zone, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
return asset->m_name;
|
||||
}
|
||||
|
||||
void AssetDumperStringTable::DumpRaw(AssetDumpingContext& context, XAssetInfo<StringTable>* asset, std::ostream& stream)
|
||||
void AssetDumperStringTable::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
const auto* stringTable = asset->Asset();
|
||||
CsvOutputStream csv(stream);
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
for(auto row = 0; row < stringTable->rowCount; row++)
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
CsvOutputStream csv(*assetFile);
|
||||
|
||||
for (auto row = 0; row < stringTable->rowCount; row++)
|
||||
{
|
||||
for(auto column = 0; column < stringTable->columnCount; column++)
|
||||
for (auto column = 0; column < stringTable->columnCount; column++)
|
||||
{
|
||||
const auto* cell = &stringTable->values[column + row * stringTable->columnCount];
|
||||
csv.WriteColumn(cell->string);
|
||||
|
@ -9,9 +9,6 @@ namespace T6
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<StringTable>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<StringTable>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<StringTable>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -57,33 +57,26 @@ bool AssetDumperTracer::ShouldDump(XAssetInfo<TracerDef>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperTracer::CanDumpAsRaw()
|
||||
void AssetDumperTracer::DumpAsset(AssetDumpingContext& context, XAssetInfo<TracerDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_TRACER);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_TRACER, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile("tracer/" + asset->m_name);
|
||||
|
||||
bool AssetDumperTracer::CanDumpAsGdtEntry()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
std::string AssetDumperTracer::GetFileNameForAsset(Zone* zone, XAssetInfo<TracerDef>* asset)
|
||||
{
|
||||
return "tracer/" + asset->m_name;
|
||||
}
|
||||
|
||||
GdtEntry AssetDumperTracer::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<TracerDef>* asset)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_TRACER);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_TRACER, gdtEntry);
|
||||
|
||||
return gdtEntry;
|
||||
}
|
||||
|
||||
void AssetDumperTracer::DumpRaw(AssetDumpingContext& context, XAssetInfo<TracerDef>* asset, std::ostream& stream)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_TRACER);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_TRACER);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
@ -12,11 +12,6 @@ namespace T6
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<TracerDef>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
bool CanDumpAsGdtEntry() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<TracerDef>* asset) override;
|
||||
GdtEntry DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<TracerDef>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<TracerDef>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<TracerDef>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -107,33 +107,26 @@ bool AssetDumperVehicle::ShouldDump(XAssetInfo<VehicleDef>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperVehicle::CanDumpAsRaw()
|
||||
void AssetDumperVehicle::DumpAsset(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_VEHICLE);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_VEHICLE, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile("vehicles/" + asset->m_name);
|
||||
|
||||
bool AssetDumperVehicle::CanDumpAsGdtEntry()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
std::string AssetDumperVehicle::GetFileNameForAsset(Zone* zone, XAssetInfo<VehicleDef>* asset)
|
||||
{
|
||||
return "vehicles/" + asset->m_name;
|
||||
}
|
||||
|
||||
GdtEntry AssetDumperVehicle::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_VEHICLE);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_VEHICLE, gdtEntry);
|
||||
|
||||
return gdtEntry;
|
||||
}
|
||||
|
||||
void AssetDumperVehicle::DumpRaw(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset, std::ostream& stream)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_VEHICLE);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_VEHICLE);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
@ -12,11 +12,6 @@ namespace T6
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<VehicleDef>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
bool CanDumpAsGdtEntry() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<VehicleDef>* asset) override;
|
||||
GdtEntry DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -417,33 +417,26 @@ bool AssetDumperWeapon::ShouldDump(XAssetInfo<WeaponVariantDef>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperWeapon::CanDumpAsRaw()
|
||||
void AssetDumperWeapon::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponVariantDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_WEAPON);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_WEAPON, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile("weapons/" + asset->m_name);
|
||||
|
||||
bool AssetDumperWeapon::CanDumpAsGdtEntry()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
std::string AssetDumperWeapon::GetFileNameForAsset(Zone* zone, XAssetInfo<WeaponVariantDef>* asset)
|
||||
{
|
||||
return "weapons/" + asset->m_name;
|
||||
}
|
||||
|
||||
GdtEntry AssetDumperWeapon::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<WeaponVariantDef>* asset)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_WEAPON);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_WEAPON, gdtEntry);
|
||||
|
||||
return gdtEntry;
|
||||
}
|
||||
|
||||
void AssetDumperWeapon::DumpRaw(AssetDumpingContext& context, XAssetInfo<WeaponVariantDef>* asset, std::ostream& stream)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
@ -13,11 +13,6 @@ namespace T6
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<WeaponVariantDef>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
bool CanDumpAsGdtEntry() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<WeaponVariantDef>* asset) override;
|
||||
GdtEntry DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<WeaponVariantDef>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<WeaponVariantDef>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponVariantDef>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -63,33 +63,26 @@ bool AssetDumperWeaponAttachment::ShouldDump(XAssetInfo<WeaponAttachment>* asset
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperWeaponAttachment::CanDumpAsRaw()
|
||||
void AssetDumperWeaponAttachment::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_WEAPON_ATTACHMENT);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile("attachment/" + asset->m_name);
|
||||
|
||||
bool AssetDumperWeaponAttachment::CanDumpAsGdtEntry()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
std::string AssetDumperWeaponAttachment::GetFileNameForAsset(Zone* zone, XAssetInfo<WeaponAttachment>* asset)
|
||||
{
|
||||
return "attachment/" + asset->m_name;
|
||||
}
|
||||
|
||||
GdtEntry AssetDumperWeaponAttachment::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_WEAPON_ATTACHMENT);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT, gdtEntry);
|
||||
|
||||
return gdtEntry;
|
||||
}
|
||||
|
||||
void AssetDumperWeaponAttachment::DumpRaw(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset, std::ostream& stream)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
@ -12,11 +12,6 @@ namespace T6
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<WeaponAttachment>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
bool CanDumpAsGdtEntry() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<WeaponAttachment>* asset) override;
|
||||
GdtEntry DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -131,33 +131,26 @@ bool AssetDumperWeaponAttachmentUnique::ShouldDump(XAssetInfo<WeaponAttachmentUn
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperWeaponAttachmentUnique::CanDumpAsRaw()
|
||||
void AssetDumperWeaponAttachmentUnique::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponAttachmentUnique>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_WEAPON_ATTACHMENT_UNIQUE);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT_UNIQUE, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile("attachmentunique/" + asset->m_name);
|
||||
|
||||
bool AssetDumperWeaponAttachmentUnique::CanDumpAsGdtEntry()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
std::string AssetDumperWeaponAttachmentUnique::GetFileNameForAsset(Zone* zone, XAssetInfo<WeaponAttachmentUnique>* asset)
|
||||
{
|
||||
return "attachmentunique/" + asset->m_name;
|
||||
}
|
||||
|
||||
GdtEntry AssetDumperWeaponAttachmentUnique::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<WeaponAttachmentUnique>* asset)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_WEAPON_ATTACHMENT_UNIQUE);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT_UNIQUE, gdtEntry);
|
||||
|
||||
return gdtEntry;
|
||||
}
|
||||
|
||||
void AssetDumperWeaponAttachmentUnique::DumpRaw(AssetDumpingContext& context, XAssetInfo<WeaponAttachmentUnique>* asset, std::ostream& stream)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT_UNIQUE);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT_UNIQUE);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
@ -13,11 +13,6 @@ namespace T6
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<WeaponAttachmentUnique>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
bool CanDumpAsGdtEntry() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<WeaponAttachmentUnique>* asset) override;
|
||||
GdtEntry DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<WeaponAttachmentUnique>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<WeaponAttachmentUnique>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponAttachmentUnique>* asset) override;
|
||||
};
|
||||
}
|
||||
|
@ -46,33 +46,26 @@ bool AssetDumperZBarrier::ShouldDump(XAssetInfo<ZBarrierDef>* asset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AssetDumperZBarrier::CanDumpAsRaw()
|
||||
void AssetDumperZBarrier::DumpAsset(AssetDumpingContext& context, XAssetInfo<ZBarrierDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_ZBARRIER);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_ZBARRIER, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile("zbarrier/" + asset->m_name);
|
||||
|
||||
bool AssetDumperZBarrier::CanDumpAsGdtEntry()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
std::string AssetDumperZBarrier::GetFileNameForAsset(Zone* zone, XAssetInfo<ZBarrierDef>* asset)
|
||||
{
|
||||
return "zbarrier/" + asset->m_name;
|
||||
}
|
||||
|
||||
GdtEntry AssetDumperZBarrier::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<ZBarrierDef>* asset)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_ZBARRIER);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_ZBARRIER, gdtEntry);
|
||||
|
||||
return gdtEntry;
|
||||
}
|
||||
|
||||
void AssetDumperZBarrier::DumpRaw(AssetDumpingContext& context, XAssetInfo<ZBarrierDef>* asset, std::ostream& stream)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_ZBARRIER);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_ZBARRIER);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
@ -12,11 +12,6 @@ namespace T6
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<ZBarrierDef>* asset) override;
|
||||
bool CanDumpAsRaw() override;
|
||||
bool CanDumpAsGdtEntry() override;
|
||||
|
||||
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<ZBarrierDef>* asset) override;
|
||||
GdtEntry DumpGdtEntry(AssetDumpingContext& context, XAssetInfo<ZBarrierDef>* asset) override;
|
||||
void DumpRaw(AssetDumpingContext& context, XAssetInfo<ZBarrierDef>* asset, std::ostream& stream) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<ZBarrierDef>* asset) override;
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user