mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-05-17 07:21:43 +00:00
Add IW3 PhysPreset dump logic (#744)
* Copied template from font. * Create PhysPreset writer from Font dumper template. * Completely refactor to match previous implementation. * Remove files from previous implementation. * Fix PhysPresetFields. * Add missing fields and correct order. * Add static infinity check as builtin does not work. * Wasn't clang formatted. * Remove unused 'perSurfaceSndAlias' field. * Removed unsupported vals (tracer & vehicle) and un-needed vals (material). * Make order match struct and mark 'tempDefaultToCylinder' as QBOOLEAN. * Make order match struct and clamp vals for 'mass' and 'tempDefaultToCylinder'. * Remove un-needed includes and add limits for float max. * Remove clamping of mass. * Use float max to determine if friction is infinite. * Clang format. * chore: formatting * chore: do not use classes for obj constants --------- Co-authored-by: njohnson <gitea.nicholasjohnson.info> Co-authored-by: Jan Laupetin <jan@laupetin.net>
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
#include "InfoStringFromStructConverter.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
using namespace IW3;
|
||||
|
||||
void InfoStringFromStructConverter::FillFromBaseField(const cspField_t& field)
|
||||
{
|
||||
switch (static_cast<csParseFieldType_t>(field.iFieldType))
|
||||
{
|
||||
case CSPFT_STRING:
|
||||
FillFromString(std::string(field.szName), field.iOffset);
|
||||
break;
|
||||
|
||||
case CSPFT_STRING_MAX_STRING_CHARS:
|
||||
FillFromStringBuffer(std::string(field.szName), field.iOffset, 1024);
|
||||
break;
|
||||
|
||||
case CSPFT_STRING_MAX_QPATH:
|
||||
FillFromStringBuffer(std::string(field.szName), field.iOffset, 64);
|
||||
break;
|
||||
|
||||
case CSPFT_STRING_MAX_OSPATH:
|
||||
FillFromStringBuffer(std::string(field.szName), field.iOffset, 256);
|
||||
break;
|
||||
|
||||
case CSPFT_INT:
|
||||
FillFromInt(std::string(field.szName), field.iOffset);
|
||||
break;
|
||||
|
||||
case CSPFT_QBOOLEAN:
|
||||
FillFromQBoolean(std::string(field.szName), field.iOffset);
|
||||
break;
|
||||
|
||||
case CSPFT_FLOAT:
|
||||
FillFromFloat(std::string(field.szName), field.iOffset);
|
||||
break;
|
||||
|
||||
case CSPFT_MILLISECONDS:
|
||||
FillFromMilliseconds(std::string(field.szName), field.iOffset);
|
||||
break;
|
||||
|
||||
case CSPFT_FX:
|
||||
{
|
||||
const auto* fx = *reinterpret_cast<FxEffectDef**>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset);
|
||||
|
||||
if (fx)
|
||||
m_info_string.SetValueForKey(std::string(field.szName), std::string(AssetName(fx->name)));
|
||||
else
|
||||
m_info_string.SetValueForKey(std::string(field.szName), "");
|
||||
break;
|
||||
}
|
||||
|
||||
case CSPFT_XMODEL:
|
||||
{
|
||||
const auto* model = *reinterpret_cast<XModel**>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset);
|
||||
|
||||
if (model)
|
||||
m_info_string.SetValueForKey(std::string(field.szName), std::string(AssetName(model->name)));
|
||||
else
|
||||
m_info_string.SetValueForKey(std::string(field.szName), "");
|
||||
break;
|
||||
}
|
||||
|
||||
case CSPFT_MATERIAL:
|
||||
{
|
||||
const auto* material = *reinterpret_cast<Material**>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset);
|
||||
|
||||
if (material)
|
||||
m_info_string.SetValueForKey(std::string(field.szName), std::string(AssetName(material->info.name)));
|
||||
else
|
||||
m_info_string.SetValueForKey(std::string(field.szName), "");
|
||||
break;
|
||||
}
|
||||
|
||||
case CSPFT_SOUND:
|
||||
{
|
||||
const auto* sndAlias = reinterpret_cast<SndAliasCustom*>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset);
|
||||
|
||||
if (sndAlias->name)
|
||||
m_info_string.SetValueForKey(std::string(field.szName), std::string(sndAlias->name->soundName));
|
||||
else
|
||||
m_info_string.SetValueForKey(std::string(field.szName), "");
|
||||
break;
|
||||
}
|
||||
|
||||
case CSPFT_NUM_BASE_FIELD_TYPES:
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void InfoStringFromStructConverter::FillInfoString()
|
||||
{
|
||||
for (auto fieldIndex = 0u; fieldIndex < m_field_count; fieldIndex++)
|
||||
{
|
||||
const auto& field = m_fields[fieldIndex];
|
||||
assert(field.iFieldType >= 0);
|
||||
|
||||
if (field.iFieldType < CSPFT_NUM_BASE_FIELD_TYPES)
|
||||
FillFromBaseField(field);
|
||||
else
|
||||
FillFromExtensionField(field);
|
||||
}
|
||||
}
|
||||
|
||||
InfoStringFromStructConverter::InfoStringFromStructConverter(const void* structure, const cspField_t* fields, const size_t fieldCount)
|
||||
: InfoStringFromStructConverterBase(structure),
|
||||
m_fields(fields),
|
||||
m_field_count(fieldCount)
|
||||
{
|
||||
}
|
||||
|
||||
InfoStringFromStructConverter::InfoStringFromStructConverter(const void* structure,
|
||||
const cspField_t* fields,
|
||||
const size_t fieldCount,
|
||||
std::function<std::string(scr_string_t)> scriptStringValueCallback)
|
||||
: InfoStringFromStructConverterBase(structure, std::move(scriptStringValueCallback)),
|
||||
m_fields(fields),
|
||||
m_field_count(fieldCount)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
#include "Game/IW3/IW3.h"
|
||||
#include "InfoString/InfoStringFromStructConverterBase.h"
|
||||
|
||||
namespace IW3
|
||||
{
|
||||
class InfoStringFromStructConverter : public InfoStringFromStructConverterBase
|
||||
{
|
||||
protected:
|
||||
const cspField_t* m_fields;
|
||||
size_t m_field_count;
|
||||
|
||||
virtual void FillFromExtensionField(const cspField_t& field) = 0;
|
||||
void FillFromBaseField(const cspField_t& field);
|
||||
void FillInfoString() override;
|
||||
|
||||
public:
|
||||
InfoStringFromStructConverter(const void* structure, const cspField_t* fields, size_t fieldCount);
|
||||
InfoStringFromStructConverter(const void* structure,
|
||||
const cspField_t* fields,
|
||||
size_t fieldCount,
|
||||
std::function<std::string(scr_string_t)> scriptStringValueCallback);
|
||||
};
|
||||
} // namespace IW3
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "Image/ImageDumperIW3.h"
|
||||
#include "Localize/LocalizeDumperIW3.h"
|
||||
#include "Maps/MapEntsDumperIW3.h"
|
||||
#include "PhysPreset/PhysPresetInfoStringDumperIW3.h"
|
||||
#include "RawFile/RawFileDumperIW3.h"
|
||||
#include "Sound/LoadedSoundDumperIW3.h"
|
||||
#include "StringTable/StringTableDumperIW3.h"
|
||||
@@ -14,7 +15,7 @@ using namespace IW3;
|
||||
|
||||
void ObjWriter::RegisterAssetDumpers(AssetDumpingContext& context)
|
||||
{
|
||||
// REGISTER_DUMPER(AssetDumperPhysPreset)
|
||||
RegisterAssetDumper(std::make_unique<phys_preset::InfoStringDumperIW3>());
|
||||
// REGISTER_DUMPER(AssetDumperXAnimParts)
|
||||
RegisterAssetDumper(std::make_unique<xmodel::DumperIW3>());
|
||||
RegisterAssetDumper(std::make_unique<material::JsonDumperIW3>());
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
#include "PhysPresetInfoStringDumperIW3.h"
|
||||
|
||||
#include "Game/IW3/InfoString/InfoStringFromStructConverter.h"
|
||||
#include "Game/IW3/ObjConstantsIW3.h"
|
||||
#include "Game/IW3/PhysPreset/PhysPresetFields.h"
|
||||
#include "PhysPreset/PhysPresetCommon.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
|
||||
using namespace IW3;
|
||||
|
||||
namespace
|
||||
{
|
||||
class InfoStringFromPhysPresetConverter final : public InfoStringFromStructConverter
|
||||
{
|
||||
protected:
|
||||
void FillFromExtensionField(const cspField_t& field) override
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
|
||||
public:
|
||||
InfoStringFromPhysPresetConverter(const PhysPresetInfo* structure,
|
||||
const cspField_t* fields,
|
||||
const size_t fieldCount,
|
||||
std::function<std::string(scr_string_t)> scriptStringValueCallback)
|
||||
: InfoStringFromStructConverter(structure, fields, fieldCount, std::move(scriptStringValueCallback))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
void CopyToPhysPresetInfo(const PhysPreset* physPreset, PhysPresetInfo* physPresetInfo)
|
||||
{
|
||||
physPresetInfo->mass = physPreset->mass;
|
||||
physPresetInfo->bounce = physPreset->bounce;
|
||||
|
||||
if (physPreset->friction >= std::numeric_limits<float>::max())
|
||||
{
|
||||
physPresetInfo->isFrictionInfinity = 1;
|
||||
physPresetInfo->friction = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
physPresetInfo->isFrictionInfinity = 0;
|
||||
physPresetInfo->friction = physPreset->friction;
|
||||
}
|
||||
|
||||
physPresetInfo->bulletForceScale = physPreset->bulletForceScale;
|
||||
physPresetInfo->explosiveForceScale = physPreset->explosiveForceScale;
|
||||
physPresetInfo->sndAliasPrefix = physPreset->sndAliasPrefix;
|
||||
physPresetInfo->piecesSpreadFraction = physPreset->piecesSpreadFraction;
|
||||
physPresetInfo->piecesUpwardVelocity = physPreset->piecesUpwardVelocity;
|
||||
physPresetInfo->tempDefaultToCylinder = physPreset->tempDefaultToCylinder ? 1 : 0;
|
||||
}
|
||||
|
||||
InfoString CreateInfoString(const XAssetInfo<PhysPreset>& asset)
|
||||
{
|
||||
auto* physPresetInfo = new PhysPresetInfo;
|
||||
CopyToPhysPresetInfo(asset.Asset(), physPresetInfo);
|
||||
|
||||
InfoStringFromPhysPresetConverter converter(physPresetInfo,
|
||||
phys_preset_fields,
|
||||
std::extent_v<decltype(phys_preset_fields)>,
|
||||
[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 "";
|
||||
|
||||
return asset.m_zone->m_script_strings[scrStr];
|
||||
});
|
||||
|
||||
return converter.Convert();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace phys_preset
|
||||
{
|
||||
void InfoStringDumperIW3::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetPhysPreset::Type>& asset)
|
||||
{
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_PHYS_PRESET);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_PHYS_PRESET, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile(GetFileNameForAssetName(asset.m_name));
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_PHYS_PRESET);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
} // namespace phys_preset
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW3/IW3.h"
|
||||
|
||||
namespace phys_preset
|
||||
{
|
||||
class InfoStringDumperIW3 final : public AbstractAssetDumper<IW3::AssetPhysPreset>
|
||||
{
|
||||
protected:
|
||||
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW3::AssetPhysPreset::Type>& asset) override;
|
||||
};
|
||||
} // namespace phys_preset
|
||||
@@ -168,7 +168,7 @@ namespace
|
||||
GdtEntry& CreateGdtEntry()
|
||||
{
|
||||
m_entry = GdtEntry();
|
||||
m_entry.m_gdf_name = ObjConstants::GDF_FILENAME_MATERIAL;
|
||||
m_entry.m_gdf_name = GDF_FILENAME_MATERIAL;
|
||||
m_entry.m_name = m_material.info.name;
|
||||
|
||||
SetCommonValues();
|
||||
|
||||
@@ -86,8 +86,8 @@ namespace phys_preset
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_PHYS_PRESET);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_PHYS_PRESET, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -99,7 +99,7 @@ namespace phys_preset
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_PHYS_PRESET);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_PHYS_PRESET);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ namespace tracer
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_TRACER);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_TRACER, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -71,7 +71,7 @@ namespace tracer
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_TRACER);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_TRACER);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,8 +99,8 @@ namespace vehicle
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_VEHICLE);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_VEHICLE, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -112,7 +112,7 @@ namespace vehicle
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_VEHICLE);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_VEHICLE);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,8 +411,8 @@ namespace weapon
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_WEAPON);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_WEAPON, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -424,7 +424,7 @@ namespace weapon
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_WEAPON);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
|
||||
|
||||
@@ -741,8 +741,8 @@ namespace weapon
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_WEAPON);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_WEAPON, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -754,7 +754,7 @@ namespace weapon
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_WEAPON);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
|
||||
|
||||
@@ -67,8 +67,8 @@ namespace phys_constraints
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_PHYS_CONSTRAINTS);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_PHYS_CONSTRAINTS, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -80,7 +80,7 @@ namespace phys_constraints
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_PHYS_CONSTRAINTS);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_PHYS_CONSTRAINTS);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ namespace phys_preset
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_PHYS_PRESET);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_PHYS_PRESET, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -101,7 +101,7 @@ namespace phys_preset
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_PHYS_PRESET);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_PHYS_PRESET);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ namespace tracer
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_TRACER);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_TRACER, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -79,7 +79,7 @@ namespace tracer
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_TRACER);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_TRACER);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,8 +117,8 @@ namespace vehicle
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_VEHICLE);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_VEHICLE, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -130,7 +130,7 @@ namespace vehicle
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_VEHICLE);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_VEHICLE);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@ namespace attachment
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_WEAPON_ATTACHMENT);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_WEAPON_ATTACHMENT, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -86,7 +86,7 @@ namespace attachment
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_WEAPON_ATTACHMENT);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,8 +137,8 @@ namespace attachment_unique
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_WEAPON_ATTACHMENT_UNIQUE);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_WEAPON_ATTACHMENT_UNIQUE, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -150,7 +150,7 @@ namespace attachment_unique
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT_UNIQUE);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_WEAPON_ATTACHMENT_UNIQUE);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,8 +467,8 @@ namespace weapon
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_WEAPON);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_WEAPON, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -480,7 +480,7 @@ namespace weapon
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_WEAPON);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_WEAPON);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
|
||||
|
||||
@@ -56,8 +56,8 @@ namespace z_barrier
|
||||
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);
|
||||
GdtEntry gdtEntry(asset.m_name, GDF_FILENAME_ZBARRIER);
|
||||
infoString.ToGdtProperties(INFO_STRING_PREFIX_ZBARRIER, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
@@ -69,7 +69,7 @@ namespace z_barrier
|
||||
|
||||
auto& stream = *assetFile;
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString(ObjConstants::INFO_STRING_PREFIX_ZBARRIER);
|
||||
const auto stringValue = infoString.ToString(INFO_STRING_PREFIX_ZBARRIER);
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user