diff --git a/src/ObjCommon/Game/T6/ObjConstantsT6.h b/src/ObjCommon/Game/T6/ObjConstantsT6.h new file mode 100644 index 00000000..a39de7af --- /dev/null +++ b/src/ObjCommon/Game/T6/ObjConstantsT6.h @@ -0,0 +1,28 @@ +#pragma once + +namespace T6 +{ + class ObjConstants + { + ObjConstants() = default; + + public: + static constexpr const char* INFO_STRING_PREFIX_PHYS_CONSTRAINTS = "PHYSCONSTRAINTS"; + static constexpr const char* INFO_STRING_PREFIX_PHYS_PRESET = "PHYSIC"; + static constexpr const char* INFO_STRING_PREFIX_TRACER = "TRACER"; + static constexpr const char* INFO_STRING_PREFIX_VEHICLE = "VEHICLEFILE"; + static constexpr const char* INFO_STRING_PREFIX_WEAPON = "WEAPONFILE"; + static constexpr const char* INFO_STRING_PREFIX_WEAPON_ATTACHMENT = "ATTACHMENTFILE"; + static constexpr const char* INFO_STRING_PREFIX_WEAPON_ATTACHMENT_UNIQUE = "ATTACHMENTUNIQUEFILE"; + static constexpr const char* INFO_STRING_PREFIX_ZBARRIER = "ZBARRIER"; + + static constexpr const char* GDF_FILENAME_PHYS_CONSTRAINTS = "physconstraints.gdf"; + static constexpr const char* GDF_FILENAME_PHYS_PRESET = "physpreset.gdf"; + static constexpr const char* GDF_FILENAME_TRACER = "tracer.gdf"; + static constexpr const char* GDF_FILENAME_VEHICLE = "vehicle.gdf"; + static constexpr const char* GDF_FILENAME_WEAPON = "weapon.gdf"; + static constexpr const char* GDF_FILENAME_WEAPON_ATTACHMENT = "attachment.gdf"; + static constexpr const char* GDF_FILENAME_WEAPON_ATTACHMENT_UNIQUE = "attachmentunique.gdf"; + static constexpr const char* GDF_FILENAME_ZBARRIER = "zbarrier.gdf"; + }; +} \ No newline at end of file diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysConstraints.cpp b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysConstraints.cpp index a0d01fbe..3e959664 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysConstraints.cpp +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysConstraints.cpp @@ -3,6 +3,7 @@ #include #include +#include "Game/T6/ObjConstantsT6.h" #include "Game/T6/InfoString/EnumStrings.h" #include "Game/T6/InfoString/InfoStringFromStructConverter.h" #include "Game/T6/InfoString/PhysConstraintsFields.h" @@ -75,8 +76,8 @@ std::string AssetDumperPhysConstraints::GetFileNameForAsset(Zone* zone, XAssetIn GdtEntry AssetDumperPhysConstraints::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo* asset) { const auto infoString = CreateInfoString(asset); - GdtEntry gdtEntry(asset->m_name, GDF_NAME); - infoString.ToGdtProperties(FILE_TYPE_STR, gdtEntry); + GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_PHYS_CONSTRAINTS); + infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_PHYS_CONSTRAINTS, gdtEntry); return gdtEntry; } @@ -84,6 +85,6 @@ GdtEntry AssetDumperPhysConstraints::DumpGdtEntry(AssetDumpingContext& context, void AssetDumperPhysConstraints::DumpRaw(AssetDumpingContext& context, XAssetInfo* asset, std::ostream& stream) { const auto infoString = CreateInfoString(asset); - const auto stringValue = infoString.ToString(FILE_TYPE_STR); + const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_PHYS_CONSTRAINTS); stream.write(stringValue.c_str(), stringValue.size()); } \ No newline at end of file diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysConstraints.h b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysConstraints.h index a9dc4e82..8b299cc0 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysConstraints.h +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysConstraints.h @@ -8,9 +8,6 @@ namespace T6 { class AssetDumperPhysConstraints final : public AbstractAssetDumper { - static constexpr const char* FILE_TYPE_STR = "PHYSCONSTRAINTS"; - static constexpr const char* GDF_NAME = "physconstraints.gdf"; - static InfoString CreateInfoString(XAssetInfo* asset); protected: diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysPreset.cpp b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysPreset.cpp index 1b292b92..f47b6e52 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysPreset.cpp +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysPreset.cpp @@ -5,6 +5,7 @@ #include #include +#include "Game/T6/ObjConstantsT6.h" #include "Game/T6/InfoString/InfoStringFromStructConverter.h" #include "Game/T6/InfoString/PhysPresetFields.h" @@ -95,8 +96,8 @@ std::string AssetDumperPhysPreset::GetFileNameForAsset(Zone* zone, XAssetInfo* asset) { const auto infoString = CreateInfoString(asset); - GdtEntry gdtEntry(asset->m_name, GDF_NAME); - infoString.ToGdtProperties(FILE_TYPE_STR, gdtEntry); + GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_PHYS_PRESET); + infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_PHYS_PRESET, gdtEntry); return gdtEntry; } @@ -104,6 +105,6 @@ GdtEntry AssetDumperPhysPreset::DumpGdtEntry(AssetDumpingContext& context, XAsse void AssetDumperPhysPreset::DumpRaw(AssetDumpingContext& context, XAssetInfo* asset, std::ostream& stream) { const auto infoString = CreateInfoString(asset); - const auto stringValue = infoString.ToString(FILE_TYPE_STR); + const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_PHYS_PRESET); stream.write(stringValue.c_str(), stringValue.size()); } \ No newline at end of file diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysPreset.h b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysPreset.h index 6919a5cf..dcd7ce9f 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysPreset.h +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperPhysPreset.h @@ -8,9 +8,6 @@ namespace T6 { class AssetDumperPhysPreset final : public AbstractAssetDumper { - static constexpr const char* FILE_TYPE_STR = "PHYSIC"; - static constexpr const char* GDF_NAME = "physpreset.gdf"; - static void CopyToPhysPresetInfo(const PhysPreset* physPreset, PhysPresetInfo* physPresetInfo); static InfoString CreateInfoString(XAssetInfo* asset); diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperTracer.cpp b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperTracer.cpp index b7f41148..64b16054 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperTracer.cpp +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperTracer.cpp @@ -3,6 +3,7 @@ #include #include +#include "Game/T6/ObjConstantsT6.h" #include "Game/T6/InfoString/EnumStrings.h" #include "Game/T6/InfoString/InfoStringFromStructConverter.h" #include "Game/T6/InfoString/TracerFields.h" @@ -74,8 +75,8 @@ std::string AssetDumperTracer::GetFileNameForAsset(Zone* zone, XAssetInfo* asset) { const auto infoString = CreateInfoString(asset); - GdtEntry gdtEntry(asset->m_name, GDF_NAME); - infoString.ToGdtProperties(FILE_TYPE_STR, gdtEntry); + GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_TRACER); + infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_TRACER, gdtEntry); return gdtEntry; } @@ -83,6 +84,6 @@ GdtEntry AssetDumperTracer::DumpGdtEntry(AssetDumpingContext& context, XAssetInf void AssetDumperTracer::DumpRaw(AssetDumpingContext& context, XAssetInfo* asset, std::ostream& stream) { const auto infoString = CreateInfoString(asset); - const auto stringValue = infoString.ToString("TRACER"); + const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_TRACER); stream.write(stringValue.c_str(), stringValue.size()); } diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperTracer.h b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperTracer.h index 5eb3d71a..a1b009b4 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperTracer.h +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperTracer.h @@ -8,9 +8,6 @@ namespace T6 { class AssetDumperTracer final : public AbstractAssetDumper { - static constexpr const char* FILE_TYPE_STR = "TRACER"; - static constexpr const char* GDF_NAME = "tracer.gdf"; - static InfoString CreateInfoString(XAssetInfo* asset); protected: diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperVehicle.cpp b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperVehicle.cpp index 03e9ae8a..36d1c0c6 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperVehicle.cpp +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperVehicle.cpp @@ -3,6 +3,7 @@ #include #include +#include "Game/T6/ObjConstantsT6.h" #include "Game/T6/InfoString/EnumStrings.h" #include "Game/T6/InfoString/InfoStringFromStructConverter.h" #include "Game/T6/InfoString/VehicleFields.h" @@ -120,8 +121,8 @@ std::string AssetDumperVehicle::GetFileNameForAsset(Zone* zone, XAssetInfo* asset) { const auto infoString = CreateInfoString(asset); - GdtEntry gdtEntry(asset->m_name, GDF_NAME); - infoString.ToGdtProperties(FILE_TYPE_STR, gdtEntry); + GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_VEHICLE); + infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_VEHICLE, gdtEntry); return gdtEntry; } @@ -129,6 +130,6 @@ GdtEntry AssetDumperVehicle::DumpGdtEntry(AssetDumpingContext& context, XAssetIn void AssetDumperVehicle::DumpRaw(AssetDumpingContext& context, XAssetInfo* asset, std::ostream& stream) { const auto infoString = CreateInfoString(asset); - const auto stringValue = infoString.ToString(FILE_TYPE_STR); + const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_VEHICLE); stream.write(stringValue.c_str(), stringValue.size()); } diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperVehicle.h b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperVehicle.h index 695e15f7..4c584677 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperVehicle.h +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperVehicle.h @@ -8,9 +8,6 @@ namespace T6 { class AssetDumperVehicle final : public AbstractAssetDumper { - static constexpr const char* FILE_TYPE_STR = "VEHICLEFILE"; - static constexpr const char* GDF_NAME = "vehicle.gdf"; - static InfoString CreateInfoString(XAssetInfo* asset); protected: diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeapon.cpp b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeapon.cpp index fc4e14f7..64fef188 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeapon.cpp +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeapon.cpp @@ -5,6 +5,7 @@ #include #include +#include "Game/T6/ObjConstantsT6.h" #include "Game/T6/InfoString/EnumStrings.h" #include "Game/T6/InfoString/InfoStringFromStructConverter.h" #include "Game/T6/InfoString/WeaponFields.h" @@ -390,8 +391,8 @@ std::string AssetDumperWeapon::GetFileNameForAsset(Zone* zone, XAssetInfo* asset) { const auto infoString = CreateInfoString(asset); - GdtEntry gdtEntry(asset->m_name, GDF_NAME); - infoString.ToGdtProperties(FILE_TYPE_STR, gdtEntry); + GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_WEAPON); + infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_WEAPON, gdtEntry); return gdtEntry; } @@ -399,6 +400,6 @@ GdtEntry AssetDumperWeapon::DumpGdtEntry(AssetDumpingContext& context, XAssetInf void AssetDumperWeapon::DumpRaw(AssetDumpingContext& context, XAssetInfo* asset, std::ostream& stream) { const auto infoString = CreateInfoString(asset); - const auto stringValue = infoString.ToString(FILE_TYPE_STR); + const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON); stream.write(stringValue.c_str(), stringValue.size()); } diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeapon.h b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeapon.h index cb079f98..47bad5c1 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeapon.h +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeapon.h @@ -8,9 +8,6 @@ namespace T6 { class AssetDumperWeapon final : public AbstractAssetDumper { - static constexpr const char* FILE_TYPE_STR = "WEAPONFILE"; - static constexpr const char* GDF_NAME = "weapon.gdf"; - static void CopyToFullDef(const WeaponVariantDef* weapon, WeaponFullDef* fullDef); static InfoString CreateInfoString(XAssetInfo* asset); diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachment.cpp b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachment.cpp index 54007b3d..4e797314 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachment.cpp +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachment.cpp @@ -1,10 +1,9 @@ #include "AssetDumperWeaponAttachment.h" #include -#include #include -#include +#include "Game/T6/ObjConstantsT6.h" #include "Game/T6/InfoString/EnumStrings.h" #include "Game/T6/InfoString/InfoStringFromStructConverter.h" #include "Game/T6/InfoString/WeaponAttachmentFields.h" @@ -82,8 +81,8 @@ std::string AssetDumperWeaponAttachment::GetFileNameForAsset(Zone* zone, XAssetI GdtEntry AssetDumperWeaponAttachment::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo* asset) { const auto infoString = CreateInfoString(asset); - GdtEntry gdtEntry(asset->m_name, GDF_NAME); - infoString.ToGdtProperties(FILE_TYPE_STR, gdtEntry); + GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_WEAPON_ATTACHMENT); + infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT, gdtEntry); return gdtEntry; } @@ -91,6 +90,6 @@ GdtEntry AssetDumperWeaponAttachment::DumpGdtEntry(AssetDumpingContext& context, void AssetDumperWeaponAttachment::DumpRaw(AssetDumpingContext& context, XAssetInfo* asset, std::ostream& stream) { const auto infoString = CreateInfoString(asset); - const auto stringValue = infoString.ToString(FILE_TYPE_STR); + const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT); stream.write(stringValue.c_str(), stringValue.size()); } diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachment.h b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachment.h index 16d2d454..2e610ef5 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachment.h +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachment.h @@ -8,9 +8,6 @@ namespace T6 { class AssetDumperWeaponAttachment final : public AbstractAssetDumper { - static constexpr const char* FILE_TYPE_STR = "ATTACHMENTFILE"; - static constexpr const char* GDF_NAME = "attachment.gdf"; - static InfoString CreateInfoString(XAssetInfo* asset); protected: diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachmentUnique.cpp b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachmentUnique.cpp index 119ab8ac..4bc0a4c9 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachmentUnique.cpp +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachmentUnique.cpp @@ -5,6 +5,7 @@ #include #include +#include "Game/T6/ObjConstantsT6.h" #include "Game/T6/InfoString/EnumStrings.h" #include "Game/T6/InfoString/InfoStringFromStructConverter.h" #include "Game/T6/InfoString/WeaponAttachmentUniqueFields.h" @@ -148,8 +149,8 @@ std::string AssetDumperWeaponAttachmentUnique::GetFileNameForAsset(Zone* zone, X GdtEntry AssetDumperWeaponAttachmentUnique::DumpGdtEntry(AssetDumpingContext& context, XAssetInfo* asset) { const auto infoString = CreateInfoString(asset); - GdtEntry gdtEntry(asset->m_name, GDF_NAME); - infoString.ToGdtProperties(FILE_TYPE_STR, gdtEntry); + GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_WEAPON_ATTACHMENT_UNIQUE); + infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT_UNIQUE, gdtEntry); return gdtEntry; } @@ -157,6 +158,6 @@ GdtEntry AssetDumperWeaponAttachmentUnique::DumpGdtEntry(AssetDumpingContext& co void AssetDumperWeaponAttachmentUnique::DumpRaw(AssetDumpingContext& context, XAssetInfo* asset, std::ostream& stream) { const auto infoString = CreateInfoString(asset); - const auto stringValue = infoString.ToString(FILE_TYPE_STR); + const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT_UNIQUE); stream.write(stringValue.c_str(), stringValue.size()); } diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachmentUnique.h b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachmentUnique.h index fd925249..a21f62d9 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachmentUnique.h +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperWeaponAttachmentUnique.h @@ -8,9 +8,6 @@ namespace T6 { class AssetDumperWeaponAttachmentUnique final : public AbstractAssetDumper { - static constexpr const char* FILE_TYPE_STR = "ATTACHMENTUNIQUEFILE"; - static constexpr const char* GDF_NAME = "attachmentunique.gdf"; - static void CopyToFullDef(const WeaponAttachmentUnique* attachment, WeaponAttachmentUniqueFull* fullDef); static InfoString CreateInfoString(XAssetInfo* asset); diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperZBarrier.cpp b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperZBarrier.cpp index 3610edba..f7aa9f72 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperZBarrier.cpp +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperZBarrier.cpp @@ -3,6 +3,7 @@ #include #include +#include "Game/T6/ObjConstantsT6.h" #include "Game/T6/InfoString/InfoStringFromStructConverter.h" #include "Game/T6/InfoString/ZBarrierFields.h" @@ -63,8 +64,8 @@ std::string AssetDumperZBarrier::GetFileNameForAsset(Zone* zone, XAssetInfo* asset) { const auto infoString = CreateInfoString(asset); - GdtEntry gdtEntry(asset->m_name, GDF_NAME); - infoString.ToGdtProperties(FILE_TYPE_STR, gdtEntry); + GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_ZBARRIER); + infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_ZBARRIER, gdtEntry); return gdtEntry; } @@ -72,6 +73,6 @@ GdtEntry AssetDumperZBarrier::DumpGdtEntry(AssetDumpingContext& context, XAssetI void AssetDumperZBarrier::DumpRaw(AssetDumpingContext& context, XAssetInfo* asset, std::ostream& stream) { const auto infoString = CreateInfoString(asset); - const auto stringValue = infoString.ToString(FILE_TYPE_STR); + const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_ZBARRIER); stream.write(stringValue.c_str(), stringValue.size()); } diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperZBarrier.h b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperZBarrier.h index df161ecb..e52b8c0a 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperZBarrier.h +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperZBarrier.h @@ -8,9 +8,6 @@ namespace T6 { class AssetDumperZBarrier final : public AbstractAssetDumper { - static constexpr const char* FILE_TYPE_STR = "ZBARRIER"; - static constexpr const char* GDF_NAME = "zbarrier.gdf"; - static InfoString CreateInfoString(XAssetInfo* asset); protected: