Add dumping of t6 weapons

This commit is contained in:
Jan 2020-10-20 12:49:20 +02:00
parent d942c5a625
commit c86139b0fa
9 changed files with 2378 additions and 91 deletions

View File

@ -0,0 +1,155 @@
#include "InfoStringT6.h"
#include <cassert>
using namespace T6;
void InfoStringToStructConverter::FillStructure()
{
}
InfoStringToStructConverter::InfoStringToStructConverter(const InfoString& infoString, void* structure,
const cspField_t* fields, const size_t fieldCount)
: InfoStringToStructConverterBase(infoString, structure),
m_fields(fields),
m_field_count(fieldCount)
{
}
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_UINT:
FillFromUint(std::string(field.szName), field.iOffset);
break;
case CSPFT_BOOL:
FillFromBool(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(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(model->name));
else
m_info_string.SetValueForKey(std::string(field.szName), "");
break;
}
case CSPFT_MATERIAL:
case CSPFT_MATERIAL_STREAM:
{
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(material->info.name));
else
m_info_string.SetValueForKey(std::string(field.szName), "");
break;
}
case CSPFT_PHYS_PRESET:
{
const auto* physPreset = *reinterpret_cast<PhysPreset**>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset);
if (physPreset)
m_info_string.SetValueForKey(std::string(field.szName), std::string(physPreset->name));
else
m_info_string.SetValueForKey(std::string(field.szName), "");
break;
}
case CSPFT_SCRIPT_STRING:
FillFromScriptString(std::string(field.szName), field.iOffset);
break;
case CSPFT_TRACER:
{
const auto* tracer = *reinterpret_cast<TracerDef**>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset);
if (tracer)
m_info_string.SetValueForKey(std::string(field.szName), std::string(tracer->name));
else
m_info_string.SetValueForKey(std::string(field.szName), "");
break;
}
case CSPFT_SOUND_ALIAS_ID:
assert(false);
FillFromUint(std::string(field.szName), field.iOffset);
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)
{
}

View File

@ -0,0 +1,32 @@
#pragma once
#include "Utils/InfoString.h"
#include "Game/T6/T6.h"
namespace T6
{
class InfoStringToStructConverter : public InfoStringToStructConverterBase
{
const cspField_t* m_fields;
size_t m_field_count;
protected:
void FillStructure() override;
public:
InfoStringToStructConverter(const InfoString& infoString, void* structure, const cspField_t* fields, size_t fieldCount);
};
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);
};
}

View File

@ -0,0 +1,208 @@
#include "InfoString.h"
#include <cassert>
#include <sstream>
const std::string InfoString::EMPTY_VALUE;
bool InfoString::HasKey(const std::string& key) const
{
return m_values.find(key) != m_values.end();
}
const std::string& InfoString::GetValueForKey(const std::string& key) const
{
const auto& value = m_values.find(key);
if (value == m_values.end())
return EMPTY_VALUE;
return value->second;
}
const std::string& InfoString::GetValueForKey(const std::string& key, bool* foundValue) const
{
const auto& value = m_values.find(key);
if (value == m_values.end())
{
if (foundValue)
*foundValue = false;
return EMPTY_VALUE;
}
if (foundValue)
*foundValue = true;
return value->second;
}
void InfoString::SetValueForKey(const std::string& key, std::string value)
{
if (!HasKey(key))
m_keys_by_insertion.push_back(key);
m_values[key] = std::move(value);
}
void InfoString::RemoveKey(const std::string& key)
{
const auto& value = m_values.find(key);
if (value != m_values.end())
m_values.erase(value);
}
std::string InfoString::ToString() const
{
std::stringstream ss;
bool first = true;
for (const auto& key : m_keys_by_insertion)
{
const auto value = m_values.find(key);
if (!first)
ss << '\\';
else
first = false;
ss << key << '\\' << value->second;
}
return ss.str();
}
std::string InfoString::ToString(const std::string& prefix) const
{
std::stringstream ss;
ss << prefix;
for (const auto& key : m_keys_by_insertion)
{
const auto value = m_values.find(key);
ss << '\\' << key << '\\' << value->second;
}
return ss.str();
}
void InfoString::FromString()
{
}
void InfoString::FromString(const std::string& prefix)
{
}
InfoStringToStructConverterBase::InfoStringToStructConverterBase(const InfoString& infoString, void* structure)
: m_info_string(infoString),
m_structure(structure)
{
}
InfoStringToStructConverterBase::~InfoStringToStructConverterBase()
= default;
void InfoStringToStructConverterBase::Convert()
{
FillStructure();
}
InfoStringFromStructConverterBase::InfoStringFromStructConverterBase(const void* structure)
: m_structure(structure),
m_get_scr_string([](scr_string_t)
{
assert(false);
return "";
})
{
}
InfoStringFromStructConverterBase::InfoStringFromStructConverterBase(const void* structure,
std::function<std::string(scr_string_t)>
scriptStringValueCallback)
: m_structure(structure),
m_get_scr_string(std::move(scriptStringValueCallback))
{
}
InfoStringFromStructConverterBase::~InfoStringFromStructConverterBase()
= default;
InfoString InfoStringFromStructConverterBase::Convert()
{
FillInfoString();
return std::move(m_info_string);
}
void InfoStringFromStructConverterBase::FillFromString(const std::string& key, size_t offset)
{
const auto* str = *reinterpret_cast<const char**>(reinterpret_cast<uintptr_t>(m_structure) + offset);
if (str)
m_info_string.SetValueForKey(key, std::string(str));
else
m_info_string.SetValueForKey(key, "");
}
void InfoStringFromStructConverterBase::FillFromStringBuffer(const std::string& key, const size_t offset,
const size_t bufferSize)
{
const auto* str = reinterpret_cast<const char*>(reinterpret_cast<uintptr_t>(m_structure) + offset);
const auto strLen = strnlen_s(str, bufferSize);
m_info_string.SetValueForKey(key, std::string(str, strLen));
}
void InfoStringFromStructConverterBase::FillFromInt(const std::string& key, const size_t offset)
{
const auto* num = reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(m_structure) + offset);
m_info_string.SetValueForKey(key, std::to_string(*num));
}
void InfoStringFromStructConverterBase::FillFromUint(const std::string& key, const size_t offset)
{
const auto* num = reinterpret_cast<unsigned int*>(reinterpret_cast<uintptr_t>(m_structure) + offset);
m_info_string.SetValueForKey(key, std::to_string(*num));
}
void InfoStringFromStructConverterBase::FillFromBool(const std::string& key, const size_t offset)
{
const auto* bBool = reinterpret_cast<bool*>(reinterpret_cast<uintptr_t>(m_structure) + offset);
m_info_string.SetValueForKey(key, *bBool ? "1" : "0");
}
void InfoStringFromStructConverterBase::FillFromQBoolean(const std::string& key, const size_t offset)
{
const auto* iBool = reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(m_structure) + offset);
m_info_string.SetValueForKey(key, *iBool != 0 ? "1" : "0");
}
void InfoStringFromStructConverterBase::FillFromFloat(const std::string& key, const size_t offset)
{
const auto* num = reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(m_structure) + offset);
m_info_string.SetValueForKey(key, std::to_string(*num));
}
void InfoStringFromStructConverterBase::FillFromMilliseconds(const std::string& key, const size_t offset)
{
const auto* millis = reinterpret_cast<unsigned int*>(reinterpret_cast<uintptr_t>(m_structure) + offset);
m_info_string.SetValueForKey(key, std::to_string(static_cast<float>(*millis) / 1000.0f));
}
void InfoStringFromStructConverterBase::FillFromScriptString(const std::string& key, const size_t offset)
{
const auto* scrStr = reinterpret_cast<scr_string_t*>(reinterpret_cast<uintptr_t>(m_structure) + offset);
m_info_string.SetValueForKey(key, m_get_scr_string(*scrStr));
}
void InfoStringFromStructConverterBase::FillFromEnumInt(const std::string& key, const size_t offset,
const char** enumValues, const size_t enumSize)
{
const auto num = *reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(m_structure) + offset);
assert(num >= 0 && num < static_cast<int>(enumSize));
if (num >= 0 && num < static_cast<int>(enumSize))
m_info_string.SetValueForKey(key, std::string(enumValues[num]));
else
m_info_string.SetValueForKey(key, "");
}

View File

@ -0,0 +1,78 @@
#pragma once
#include <functional>
#include <unordered_map>
#include <string>
#include <vector>
#include "Zone/ZoneTypes.h"
class InfoString
{
static const std::string EMPTY_VALUE;
std::unordered_map<std::string, std::string> m_values;
std::vector<std::string> m_keys_by_insertion;
public:
bool HasKey(const std::string& key) const;
const std::string& GetValueForKey(const std::string& key) const;
const std::string& GetValueForKey(const std::string& key, bool* foundValue) const;
void SetValueForKey(const std::string& key, std::string value);
void RemoveKey(const std::string& key);
std::string ToString() const;
std::string ToString(const std::string& prefix) const;
void FromString();
void FromString(const std::string& prefix);
};
class InfoStringToStructConverterBase
{
protected:
const InfoString& m_info_string;
void* m_structure;
virtual void FillStructure() = 0;
public:
InfoStringToStructConverterBase(const InfoString& infoString, void* structure);
virtual ~InfoStringToStructConverterBase();
InfoStringToStructConverterBase(const InfoStringToStructConverterBase& other) = delete;
InfoStringToStructConverterBase(InfoStringToStructConverterBase&& other) noexcept = delete;
InfoStringToStructConverterBase& operator=(const InfoStringToStructConverterBase& other) = delete;
InfoStringToStructConverterBase& operator=(InfoStringToStructConverterBase&& other) noexcept = delete;
void Convert();
};
class InfoStringFromStructConverterBase
{
protected:
InfoString m_info_string;
const void* m_structure;
const std::function<std::string(scr_string_t)> m_get_scr_string;
void FillFromString(const std::string& key, size_t offset);
void FillFromStringBuffer(const std::string& key, size_t offset, size_t bufferSize);
void FillFromInt(const std::string& key, size_t offset);
void FillFromUint(const std::string&, size_t offset);
void FillFromBool(const std::string&, size_t offset);
void FillFromQBoolean(const std::string& key, size_t offset);
void FillFromFloat(const std::string& key, size_t offset);
void FillFromMilliseconds(const std::string& key, size_t offset);
void FillFromScriptString(const std::string& key, size_t offset);
void FillFromEnumInt(const std::string& key, size_t offset, const char** enumValues, size_t enumSize);
virtual void FillInfoString() = 0;
public:
explicit InfoStringFromStructConverterBase(const void* structure);
InfoStringFromStructConverterBase(const void* structure, std::function<std::string(scr_string_t)> scriptStringValueCallback);
virtual ~InfoStringFromStructConverterBase();
InfoStringFromStructConverterBase(const InfoStringFromStructConverterBase& other) = delete;
InfoStringFromStructConverterBase(InfoStringFromStructConverterBase&& other) noexcept = delete;
InfoStringFromStructConverterBase& operator=(const InfoStringFromStructConverterBase& other) = delete;
InfoStringFromStructConverterBase& operator=(InfoStringFromStructConverterBase&& other) noexcept = delete;
InfoString Convert();
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
#pragma once
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T6/T6.h"
namespace T6
{
class AssetDumperWeapon final : public AbstractAssetDumper<WeaponVariantDef>
{
static cspField_t weapon_fields[];
void CopyToFullDef(const WeaponVariantDef* weapon, WeaponFullDef* fullDef) const;
protected:
bool ShouldDump(XAssetInfo<WeaponVariantDef>* asset) override;
std::string GetFileNameForAsset(Zone* zone, XAssetInfo<WeaponVariantDef>* asset) override;
void DumpAsset(Zone* zone, XAssetInfo<WeaponVariantDef>* asset, FileAPI::File* out) override;
};
}

View File

@ -11,6 +11,7 @@
#include "AssetDumpers/AssetDumperLocalizeEntry.h" #include "AssetDumpers/AssetDumperLocalizeEntry.h"
#include "AssetDumpers/AssetDumperGfxImage.h" #include "AssetDumpers/AssetDumperGfxImage.h"
#include "AssetDumpers/AssetDumperFontIcon.h" #include "AssetDumpers/AssetDumperFontIcon.h"
#include "AssetDumpers/AssetDumperWeapon.h"
using namespace T6; using namespace T6;
@ -52,7 +53,7 @@ bool ZoneDumper::DumpZone(Zone* zone, const std::string& basePath) const
// DUMP_ASSET_POOL(AssetDumperMenuList, m_menu_list); // DUMP_ASSET_POOL(AssetDumperMenuList, m_menu_list);
// DUMP_ASSET_POOL(AssetDumperMenuDef, m_menu_def); // DUMP_ASSET_POOL(AssetDumperMenuDef, m_menu_def);
DUMP_ASSET_POOL(AssetDumperLocalizeEntry, m_localize); DUMP_ASSET_POOL(AssetDumperLocalizeEntry, m_localize);
// DUMP_ASSET_POOL(AssetDumperWeaponVariantDef, m_weapon); DUMP_ASSET_POOL(AssetDumperWeapon, m_weapon);
// DUMP_ASSET_POOL(AssetDumperWeaponAttachment, m_attachment); // DUMP_ASSET_POOL(AssetDumperWeaponAttachment, m_attachment);
// DUMP_ASSET_POOL(AssetDumperWeaponAttachmentUnique, m_attachment_unique); // DUMP_ASSET_POOL(AssetDumperWeaponAttachmentUnique, m_attachment_unique);
// DUMP_ASSET_POOL(AssetDumperWeaponCamo, m_camo); // DUMP_ASSET_POOL(AssetDumperWeaponCamo, m_camo);

View File

@ -27,4 +27,93 @@ namespace T6
int assetCount; int assetCount;
XAsset* assets; XAsset* assets;
}; };
struct cspField_t
{
const char* szName;
int iOffset;
int iFieldType;
};
enum csParseFieldType_t
{
CSPFT_STRING = 0,
CSPFT_STRING_MAX_STRING_CHARS,
CSPFT_STRING_MAX_QPATH,
CSPFT_STRING_MAX_OSPATH,
CSPFT_INT,
CSPFT_UINT,
CSPFT_BOOL,
CSPFT_QBOOLEAN,
CSPFT_FLOAT,
CSPFT_MILLISECONDS,
CSPFT_FX,
CSPFT_XMODEL,
CSPFT_MATERIAL,
CSPFT_MATERIAL_STREAM,
CSPFT_PHYS_PRESET,
CSPFT_SCRIPT_STRING,
CSPFT_TRACER,
CSPFT_SOUND_ALIAS_ID,
CSPFT_NUM_BASE_FIELD_TYPES
};
enum weapFieldType_t
{
WFT_WEAPONTYPE = CSPFT_NUM_BASE_FIELD_TYPES,
WFT_WEAPONCLASS,
WFT_OVERLAYRETICLE,
WFT_PENETRATE_TYPE,
WFT_IMPACT_TYPE,
WFT_STANCE,
WFT_PROJ_EXPLOSION,
WFT_OFFHAND_CLASS,
WFT_OFFHAND_SLOT,
WFT_ANIMTYPE,
WFT_ACTIVE_RETICLE_TYPE,
WFT_GUIDED_MISSILE_TYPE,
WFT_BOUNCE_SOUND,
WFT_STICKINESS,
WFT_ROTATETYPE,
WFT_OVERLAYINTERFACE,
WFT_INVENTORYTYPE,
WFT_FIRETYPE,
WFT_CLIPTYPE,
WFT_AMMOCOUNTER_CLIPTYPE,
WFT_ICONRATIO_HUD,
WFT_ICONRATIO_AMMOCOUNTER,
WFT_ICONRATIO_KILL,
WFT_ICONRATIO_DPAD,
WFT_ICONRATIO_INDICATOR,
WFT_BARRELTYPE,
WFT_HIDETAGS,
WFT_EXPLOSION_TAG,
WFT_NOTETRACKSOUNDMAP,
WFT_WEAPON_CAMO,
WFT_NUM_FIELD_TYPES
};
enum VehicleFieldType
{
VFT_TYPE = CSPFT_NUM_BASE_FIELD_TYPES,
VFT_CAMERAMODE,
VFT_TRACTION_TYPE,
VFT_MPH_TO_INCHES_PER_SECOND,
VFT_POUNDS_TO_GAME_MASS,
VFT_TEAM,
VFT_KEY_BINDING,
VFT_GRAPH,
VFT_WIIUCONTROLOVERRIDE,
VFT_NUM
};
enum tracerFieldType_t
{
TFT_TRACERTYPE = CSPFT_NUM_BASE_FIELD_TYPES,
TFT_NUM_FIELD_TYPES
};
} }

View File

@ -1454,84 +1454,6 @@ namespace T6
WEAPON_ICON_RATIO_COUNT = 0x3, WEAPON_ICON_RATIO_COUNT = 0x3,
}; };
struct WeaponVariantDef
{
const char* szInternalName;
int iVariantCount;
WeaponDef* weapDef;
const char* szDisplayName;
const char* szAltWeaponName;
const char* szAttachmentUnique;
WeaponAttachment** attachments;
WeaponAttachmentUnique** attachmentUniques;
const char** szXAnims;
unsigned __int16* hideTags;
XModel** attachViewModel;
XModel** attachWorldModel;
const char** attachViewModelTag;
const char** attachWorldModelTag;
float attachViewModelOffsets[24];
float attachWorldModelOffsets[24];
float attachViewModelRotations[24];
float attachWorldModelRotations[24];
vec3_t stowedModelOffsets;
vec3_t stowedModelRotations;
unsigned int altWeaponIndex;
int iAttachments;
bool bIgnoreAttachments;
int iClipSize;
int iReloadTime;
int iReloadEmptyTime;
int iReloadQuickTime;
int iReloadQuickEmptyTime;
int iAdsTransInTime;
int iAdsTransOutTime;
int iAltRaiseTime;
const char* szAmmoDisplayName;
const char* szAmmoName;
int iAmmoIndex;
const char* szClipName;
int iClipIndex;
float fAimAssistRangeAds;
float fAdsSwayHorizScale;
float fAdsSwayVertScale;
float fAdsViewKickCenterSpeed;
float fHipViewKickCenterSpeed;
float fAdsZoomFov1;
float fAdsZoomFov2;
float fAdsZoomFov3;
float fAdsZoomInFrac;
float fAdsZoomOutFrac;
float fOverlayAlphaScale;
float fOOPosAnimLength[2];
bool bSilenced;
bool bDualMag;
bool bInfraRed;
bool bTVGuided;
unsigned int perks[2];
bool bAntiQuickScope;
Material* overlayMaterial;
Material* overlayMaterialLowRes;
Material* dpadIcon;
weaponIconRatioType_t dpadIconRatio;
bool noAmmoOnDpadIcon;
bool mmsWeapon;
bool mmsInScope;
float mmsFOV;
float mmsAspect;
float mmsMaxDist;
vec3_t ikLeftHandIdlePos;
vec3_t ikLeftHandOffset;
vec3_t ikLeftHandRotation;
bool bUsingLeftHandProneIK;
vec3_t ikLeftHandProneOffset;
vec3_t ikLeftHandProneRotation;
vec3_t ikLeftHandUiViewerOffset;
vec3_t ikLeftHandUiViewerRotation;
};
enum eAttachment enum eAttachment
{ {
ATTACHMENT_NONE = 0x0, ATTACHMENT_NONE = 0x0,
@ -4129,16 +4051,16 @@ namespace T6
struct WeaponDef struct WeaponDef
{ {
const char* szOverlayName; const char* szOverlayName; // covered
XModel** gunXModel; XModel** gunXModel; // covered
XModel* handXModel; XModel* handXModel; // covered
const char* szModeName; const char* szModeName; // covered
unsigned __int16* notetrackSoundMapKeys; unsigned __int16* notetrackSoundMapKeys; // covered
unsigned __int16* notetrackSoundMapValues; unsigned __int16* notetrackSoundMapValues; // covered
int playerAnimType; int playerAnimType; // covered
weapType_t weapType; weapType_t weapType;
weapClass_t weapClass; weapClass_t weapClass;
PenetrateType penetrateType; PenetrateType penetrateTWeaponAttachmentype;
ImpactType impactType; ImpactType impactType;
weapInventoryType_t inventoryType; weapInventoryType_t inventoryType;
weapFireType_t fireType; weapFireType_t fireType;
@ -4717,6 +4639,197 @@ namespace T6
int customBool2; int customBool2;
}; };
enum weapAnimFiles_t
{
WEAP_ANIM_ROOT = 0x0,
WEAP_ANIM_IDLE = 0x1,
WEAP_ANIM_EMPTY_IDLE = 0x2,
WEAP_ANIM_FIRE_INTRO = 0x3,
WEAP_ANIM_FIRE = 0x4,
WEAP_ANIM_HOLD_FIRE = 0x5,
WEAP_ANIM_LASTSHOT = 0x6,
WEAP_ANIM_FINALSHOT = 0x7,
WEAP_ANIM_RECHAMBER = 0x8,
WEAP_ANIM_MELEE = 0x9,
WEAP_ANIM_MELEE1 = 0xA,
WEAP_ANIM_MELEE2 = 0xB,
WEAP_ANIM_MELEE3 = 0xC,
WEAP_ANIM_MELEE_EMPTY = 0xD,
WEAP_ANIM_MELEE_CHARGE = 0xE,
WEAP_ANIM_MELEE_CHARGE_EMPTY = 0xF,
WEAP_ANIM_RELOAD = 0x10,
WEAP_ANIM_RELOAD_RIGHT = 0x11,
WEAP_ANIM_RELOAD_EMPTY = 0x12,
WEAP_ANIM_RELOAD_START = 0x13,
WEAP_ANIM_RELOAD_END = 0x14,
WEAP_ANIM_RELOAD_QUICK = 0x15,
WEAP_ANIM_RELOAD_QUICK_EMPTY = 0x16,
WEAP_ANIM_RAISE = 0x17,
WEAP_ANIM_FIRST_RAISE = 0x18,
WEAP_ANIM_DROP = 0x19,
WEAP_ANIM_ALT_RAISE = 0x1A,
WEAP_ANIM_ALT_DROP = 0x1B,
WEAP_ANIM_QUICK_RAISE = 0x1C,
WEAP_ANIM_QUICK_DROP = 0x1D,
WEAP_ANIM_EMPTY_RAISE = 0x1E,
WEAP_ANIM_EMPTY_DROP = 0x1F,
WEAP_ANIM_SPRINT_IN = 0x20,
WEAP_ANIM_SPRINT_LOOP = 0x21,
WEAP_ANIM_SPRINT_OUT = 0x22,
WEAP_ANIM_SPRINT_EMPTY_IN = 0x23,
WEAP_ANIM_SPRINT_EMPTY_LOOP = 0x24,
WEAP_ANIM_SPRINT_EMPTY_OUT = 0x25,
WEAP_ANIM_LOWREADY_IN = 0x26,
WEAP_ANIM_LOWREADY_LOOP = 0x27,
WEAP_ANIM_LOWREADY_OUT = 0x28,
WEAP_ANIM_CONT_FIRE_IN = 0x29,
WEAP_ANIM_CONT_FIRE_LOOP = 0x2A,
WEAP_ANIM_CONT_FIRE_OUT = 0x2B,
WEAP_ANIM_CRAWL_IN = 0x2C,
WEAP_ANIM_CRAWL_FORWARD = 0x2D,
WEAP_ANIM_CRAWL_BACK = 0x2E,
WEAP_ANIM_CRAWL_RIGHT = 0x2F,
WEAP_ANIM_CRAWL_LEFT = 0x30,
WEAP_ANIM_CRAWL_OUT = 0x31,
WEAP_ANIM_CRAWL_EMPTY_IN = 0x32,
WEAP_ANIM_CRAWL_EMPTY_FORWARD = 0x33,
WEAP_ANIM_CRAWL_EMPTY_BACK = 0x34,
WEAP_ANIM_CRAWL_EMPTY_RIGHT = 0x35,
WEAP_ANIM_CRAWL_EMPTY_LEFT = 0x36,
WEAP_ANIM_CRAWL_EMPTY_OUT = 0x37,
WEAP_ANIM_DEPLOY = 0x38,
WEAP_ANIM_BREAKDOWN = 0x39,
WEAP_ANIM_DETONATE = 0x3A,
WEAP_ANIM_NIGHTVISION_WEAR = 0x3B,
WEAP_ANIM_NIGHTVISION_REMOVE = 0x3C,
WEAP_ANIM_ADS_FIRE = 0x3D,
WEAP_ANIM_ADS_LASTSHOT = 0x3E,
WEAP_ANIM_ADS_FIRE_INTRO = 0x3F,
WEAP_ANIM_ADS_RECHAMBER = 0x40,
WEAP_ANIM_DTP_IN = 0x41,
WEAP_ANIM_DTP_LOOP = 0x42,
WEAP_ANIM_DTP_OUT = 0x43,
WEAP_ANIM_DTP_EMPTY_IN = 0x44,
WEAP_ANIM_DTP_EMPTY_LOOP = 0x45,
WEAP_ANIM_DTP_EMPTY_OUT = 0x46,
WEAP_ANIM_SLIDE_IN = 0x47,
WEAP_ANIM_MANTLE = 0x48,
WEAP_ANIM_CAMERA_SPRINT_LOOP = 0x49,
WEAP_ANIM_CAMERA_DTP_IN = 0x4A,
WEAP_ANIM_CAMERA_DTP_LOOP = 0x4B,
WEAP_ANIM_CAMERA_DTP_OUT = 0x4C,
WEAP_ANIM_CAMERA_MANTLE = 0x4D,
WEAP_ANIM_FIRE_LEFT = 0x4E,
WEAP_ANIM_LASTSHOT_LEFT = 0x4F,
WEAP_ANIM_FINALSHOT_LEFT = 0x50,
WEAP_ANIM_IDLE_LEFT = 0x51,
WEAP_ANIM_EMPTY_IDLE_LEFT = 0x52,
WEAP_ANIM_RELOAD_EMPTY_LEFT = 0x53,
WEAP_ANIM_RELOAD_LEFT = 0x54,
WEAP_ANIM_ADS_UP = 0x55,
WEAP_ANIM_ADS_DOWN = 0x56,
WEAP_ANIM_ADS_UP_OTHER_SCOPE = 0x57,
NUM_WEAP_ANIMS = 0x58,
};
struct WeaponVariantDef
{
const char* szInternalName;
int iVariantCount;
WeaponDef* weapDef;
const char* szDisplayName;
const char* szAltWeaponName;
const char* szAttachmentUnique;
WeaponAttachment** attachments;
WeaponAttachmentUnique** attachmentUniques;
const char** szXAnims;
unsigned __int16* hideTags;
XModel** attachViewModel;
XModel** attachWorldModel;
const char** attachViewModelTag;
const char** attachWorldModelTag;
float attachViewModelOffsets[24];
float attachWorldModelOffsets[24];
float attachViewModelRotations[24];
float attachWorldModelRotations[24];
vec3_t stowedModelOffsets;
vec3_t stowedModelRotations;
unsigned int altWeaponIndex;
int iAttachments;
bool bIgnoreAttachments;
int iClipSize;
int iReloadTime;
int iReloadEmptyTime;
int iReloadQuickTime;
int iReloadQuickEmptyTime;
int iAdsTransInTime;
int iAdsTransOutTime;
int iAltRaiseTime;
const char* szAmmoDisplayName;
const char* szAmmoName;
int iAmmoIndex;
const char* szClipName;
int iClipIndex;
float fAimAssistRangeAds;
float fAdsSwayHorizScale;
float fAdsSwayVertScale;
float fAdsViewKickCenterSpeed;
float fHipViewKickCenterSpeed;
float fAdsZoomFov1;
float fAdsZoomFov2;
float fAdsZoomFov3;
float fAdsZoomInFrac;
float fAdsZoomOutFrac;
float fOverlayAlphaScale;
float fOOPosAnimLength[2];
bool bSilenced;
bool bDualMag;
bool bInfraRed;
bool bTVGuided;
unsigned int perks[2];
bool bAntiQuickScope;
Material* overlayMaterial;
Material* overlayMaterialLowRes;
Material* dpadIcon;
weaponIconRatioType_t dpadIconRatio;
bool noAmmoOnDpadIcon;
bool mmsWeapon;
bool mmsInScope;
float mmsFOV;
float mmsAspect;
float mmsMaxDist;
vec3_t ikLeftHandIdlePos;
vec3_t ikLeftHandOffset;
vec3_t ikLeftHandRotation;
bool bUsingLeftHandProneIK;
vec3_t ikLeftHandProneOffset;
vec3_t ikLeftHandProneRotation;
vec3_t ikLeftHandUiViewerOffset;
vec3_t ikLeftHandUiViewerRotation;
};
struct WeaponFullDef
{
WeaponVariantDef weapVariantDef;
WeaponDef weapDef;
WeaponAttachment* attachments[63];
WeaponAttachmentUnique* attachmentUniques[95];
XModel* gunXModel[16];
const char* szXAnims[88];
unsigned __int16 hideTags[32];
unsigned __int16 notetrackSoundMapKeys[20];
unsigned __int16 notetrackSoundMapValues[20];
XModel* worldModel[16];
XModel* attachViewModel[8];
XModel* attachWorldModel[8];
const char* attachViewModelTag[8];
const char* attachWorldModelTag[8];
float parallelBounce[32];
float perpendicularBounce[32];
float locationDamageMultipliers[21];
char weaponCamo[64];
};
struct WeaponCamoSet struct WeaponCamoSet
{ {