refactor: use enum counts for game struct arrays (#1034)

* refactor: use enum counts for game struct arrays

* refactor: name flesh impact effect counts

* refactor: name weapon model and dynamic entity counts

* refactor: add missing enum counts as array sizes

* refactor: add dynentitydrawtype and dynentitycolltype to QOS and refactor GfxWorld to use them

---------

Co-authored-by: Jan Laupetin <[email protected]>
This commit is contained in:
moandJan Laupetin authored and GitHub committed 2026-10-18 20:12:17 +02:00
1 parent f556729d7e
commit 30d2d498bd
9 files changed
+485 -191

No files matched your search

+68 -19
View File
@@ -1444,7 +1444,7 @@ namespace IW3
bool hasBeenUploaded;
char unused[1];
MaterialTechniqueSet* remappedTechniqueSet;
MaterialTechnique* techniques[34];
MaterialTechnique* techniques[TECHNIQUE_COUNT];
};
struct CardMemory
@@ -1772,6 +1772,23 @@ namespace IW3
float origin[3];
};
enum DynEntityDrawType
{
DYNENT_DRAW_MODEL = 0x0,
DYNENT_DRAW_BRUSH = 0x1,
DYNENT_DRAW_COUNT,
};
enum DynEntityCollType
{
DYNENT_COLL_CLIENT_FIRST = 0x0,
DYNENT_COLL_CLIENT_MODEL = 0x0,
DYNENT_COLL_CLIENT_BRUSH = 0x1,
DYNENT_COLL_COUNT,
};
enum DynEntityType
{
DYNENT_TYPE_INVALID = 0x0,
@@ -1867,11 +1884,11 @@ namespace IW3
MapEnts* mapEnts;
cbrush_t* box_brush;
cmodel_t box_model;
uint16_t dynEntCount[2];
DynEntityDef* dynEntDefList[2];
DynEntityPose* dynEntPoseList[2];
DynEntityClient* dynEntClientList[2];
DynEntityColl* dynEntCollList[2];
uint16_t dynEntCount[DYNENT_COLL_COUNT];
DynEntityDef* dynEntDefList[DYNENT_DRAW_COUNT];
DynEntityPose* dynEntPoseList[DYNENT_DRAW_COUNT];
DynEntityClient* dynEntClientList[DYNENT_DRAW_COUNT];
DynEntityColl* dynEntCollList[DYNENT_COLL_COUNT];
unsigned int checksum;
};
@@ -2402,10 +2419,10 @@ namespace IW3
struct GfxWorldDpvsDynamic
{
unsigned int dynEntClientWordCount[2];
unsigned int dynEntClientCount[2];
unsigned int* dynEntCellBits[2];
raw_byte16* dynEntVisData[2][3];
unsigned int dynEntClientWordCount[DYNENT_DRAW_COUNT];
unsigned int dynEntClientCount[DYNENT_DRAW_COUNT];
unsigned int* dynEntCellBits[DYNENT_DRAW_COUNT];
raw_byte16* dynEntVisData[DYNENT_DRAW_COUNT][3];
};
struct GfxWorldStreamInfo
@@ -2464,7 +2481,7 @@ namespace IW3
GfxSceneDynModel4* sceneDynModel;
GfxSceneDynBrush* sceneDynBrush;
unsigned int* primaryLightEntityShadowVis;
unsigned int* primaryLightDynEntShadowVis[2];
unsigned int* primaryLightDynEntShadowVis[DYNENT_DRAW_COUNT];
char* nonSunPrimaryLightForModelDynEnt;
GfxShadowGeometry* shadowGeom;
GfxLightRegion* lightRegion;
@@ -3129,14 +3146,36 @@ namespace IW3
snd_alias_list_t* sound;
};
enum weaponAltModel_t
{
WEAP_ALT_MODEL0 = 0x0,
WEAP_ALT_MODEL1 = 0x1,
WEAP_ALT_MODEL2 = 0x2,
WEAP_ALT_MODEL3 = 0x3,
WEAP_ALT_MODEL4 = 0x4,
WEAP_ALT_MODEL5 = 0x5,
WEAP_ALT_MODEL6 = 0x6,
WEAP_ALT_MODEL7 = 0x7,
WEAP_ALT_MODEL8 = 0x8,
WEAP_ALT_MODEL9 = 0x9,
WEAP_ALT_MODEL10 = 0xA,
WEAP_ALT_MODEL11 = 0xB,
WEAP_ALT_MODEL12 = 0xC,
WEAP_ALT_MODEL13 = 0xD,
WEAP_ALT_MODEL14 = 0xE,
WEAP_ALT_MODEL15 = 0xF,
NUM_WEAP_ALTMODELS,
};
struct WeaponDef
{
const char* szInternalName;
const char* szDisplayName;
const char* szOverlayName;
XModel* gunXModel[16];
XModel* gunXModel[NUM_WEAP_ALTMODELS];
XModel* handXModel;
const char* szXAnims[33];
const char* szXAnims[NUM_WEAP_ANIMS];
const char* szModeName;
uint16_t hideTags[8];
uint16_t notetrackSoundMapKeys[16];
@@ -3226,7 +3265,7 @@ namespace IW3
float fStandRotMinSpeed;
float fDuckedRotMinSpeed;
float fProneRotMinSpeed;
XModel* worldModel[16];
XModel* worldModel[NUM_WEAP_ALTMODELS];
XModel* worldClipModel;
XModel* rocketModel;
XModel* knifeModel;
@@ -3404,8 +3443,8 @@ namespace IW3
int holdButtonToThrow;
int freezeMovementWhenFiring;
float lowAmmoWarningThreshold;
float parallelBounce[29];
float perpendicularBounce[29];
float parallelBounce[SURF_TYPE_NUM];
float perpendicularBounce[SURF_TYPE_NUM];
FxEffectDef* projTrailEffect;
float vProjectileColor[3];
guidedMissileType_t guidedMissileType;
@@ -3494,7 +3533,7 @@ namespace IW3
float destabilizationRateTime;
float destabilizationCurvatureMax;
int destabilizeDistance;
float locationDamageMultipliers[19];
float locationDamageMultipliers[HITLOC_COUNT];
const char* fireRumble;
const char* meleeImpactRumble;
float adsDofStart;
@@ -3695,10 +3734,20 @@ namespace IW3
FxElemDef* elemDefs;
};
enum FxFleshType
{
FX_FLESHTYPE_BODY_NONFATAL = 0x0,
FX_FLESHTYPE_BODY_FATAL = 0x1,
FX_FLESHTYPE_HEAD_NONFATAL = 0x2,
FX_FLESHTYPE_HEAD_FATAL = 0x3,
FX_FLESHTYPE_COUNT,
};
struct FxImpactEntry
{
FxEffectDef* nonflesh[29];
FxEffectDef* flesh[4];
FxEffectDef* nonflesh[SURF_TYPE_NUM];
FxEffectDef* flesh[FX_FLESHTYPE_COUNT];
};
struct FxImpactTable
+70 -21
View File
@@ -1733,7 +1733,7 @@ namespace IW4
bool hasBeenUploaded;
unsigned char unused[1];
MaterialTechniqueSet* remappedTechniqueSet;
MaterialTechnique* techniques[48];
MaterialTechnique* techniques[TECHNIQUE_COUNT];
};
union RawFileBuffer
@@ -2724,10 +2724,20 @@ namespace IW4
Glyph* glyphs;
};
enum FxFleshType
{
FX_FLESHTYPE_BODY_NONFATAL = 0x0,
FX_FLESHTYPE_BODY_FATAL = 0x1,
FX_FLESHTYPE_HEAD_NONFATAL = 0x2,
FX_FLESHTYPE_HEAD_FATAL = 0x3,
FX_FLESHTYPE_COUNT,
};
struct FxImpactEntry
{
FxEffectDef* nonflesh[31];
FxEffectDef* flesh[4];
FxEffectDef* flesh[FX_FLESHTYPE_COUNT];
};
struct FxImpactTable
@@ -3070,6 +3080,23 @@ namespace IW4
float origin[3];
};
enum DynEntityDrawType
{
DYNENT_DRAW_MODEL = 0x0,
DYNENT_DRAW_BRUSH = 0x1,
DYNENT_DRAW_COUNT,
};
enum DynEntityCollType
{
DYNENT_COLL_CLIENT_FIRST = 0x0,
DYNENT_COLL_CLIENT_MODEL = 0x0,
DYNENT_COLL_CLIENT_BRUSH = 0x1,
DYNENT_COLL_COUNT,
};
enum DynEntityType
{
DYNENT_TYPE_INVALID = 0x0,
@@ -3161,11 +3188,11 @@ namespace IW4
MapEnts* mapEnts;
uint16_t smodelNodeCount;
SModelAabbNode* smodelNodes;
uint16_t dynEntCount[2];
DynEntityDef* dynEntDefList[2];
DynEntityPose* dynEntPoseList[2];
DynEntityClient* dynEntClientList[2];
DynEntityColl* dynEntCollList[2];
uint16_t dynEntCount[DYNENT_COLL_COUNT];
DynEntityDef* dynEntDefList[DYNENT_DRAW_COUNT];
DynEntityPose* dynEntPoseList[DYNENT_DRAW_COUNT];
DynEntityClient* dynEntClientList[DYNENT_DRAW_COUNT];
DynEntityColl* dynEntCollList[DYNENT_COLL_COUNT];
unsigned int checksum;
char padding[48];
};
@@ -3921,10 +3948,10 @@ namespace IW4
struct GfxWorldDpvsDynamic
{
unsigned int dynEntClientWordCount[2];
unsigned int dynEntClientCount[2];
raw_uint* dynEntCellBits[2];
raw_byte16* dynEntVisData[2][3];
unsigned int dynEntClientWordCount[DYNENT_DRAW_COUNT];
unsigned int dynEntClientCount[DYNENT_DRAW_COUNT];
raw_uint* dynEntCellBits[DYNENT_DRAW_COUNT];
raw_byte16* dynEntVisData[DYNENT_DRAW_COUNT][3];
};
struct GfxHeroOnlyLight
@@ -3978,7 +4005,7 @@ namespace IW4
GfxSceneDynModel4* sceneDynModel;
GfxSceneDynBrush* sceneDynBrush;
raw_uint* primaryLightEntityShadowVis;
raw_uint* primaryLightDynEntShadowVis[2];
raw_uint* primaryLightDynEntShadowVis[DYNENT_DRAW_COUNT];
char* nonSunPrimaryLightForModelDynEnt;
GfxShadowGeometry* shadowGeom;
GfxLightRegion* lightRegion;
@@ -4291,6 +4318,28 @@ namespace IW4
snd_alias_list_t* sound;
};
enum weaponAltModel_t
{
WEAP_ALT_MODEL0 = 0x0,
WEAP_ALT_MODEL1 = 0x1,
WEAP_ALT_MODEL2 = 0x2,
WEAP_ALT_MODEL3 = 0x3,
WEAP_ALT_MODEL4 = 0x4,
WEAP_ALT_MODEL5 = 0x5,
WEAP_ALT_MODEL6 = 0x6,
WEAP_ALT_MODEL7 = 0x7,
WEAP_ALT_MODEL8 = 0x8,
WEAP_ALT_MODEL9 = 0x9,
WEAP_ALT_MODEL10 = 0xA,
WEAP_ALT_MODEL11 = 0xB,
WEAP_ALT_MODEL12 = 0xC,
WEAP_ALT_MODEL13 = 0xD,
WEAP_ALT_MODEL14 = 0xE,
WEAP_ALT_MODEL15 = 0xF,
NUM_WEAP_ALTMODELS,
};
struct WeaponDef
{
const char* szOverlayName;
@@ -4757,18 +4806,18 @@ namespace IW4
WeaponCompleteDef weapCompleteDef;
WeaponDef weapDef;
uint16_t hideTags[32];
const char* szXAnims[37];
XModel* gunXModel[16];
const char* szXAnimsRightHanded[37];
const char* szXAnimsLeftHanded[37];
const char* szXAnims[NUM_WEAP_ANIMS];
XModel* gunXModel[NUM_WEAP_ALTMODELS];
const char* szXAnimsRightHanded[NUM_WEAP_ANIMS];
const char* szXAnimsLeftHanded[NUM_WEAP_ANIMS];
uint16_t notetrackSoundMapKeys[16];
uint16_t notetrackSoundMapValues[16];
uint16_t notetrackRumbleMapKeys[16];
uint16_t notetrackRumbleMapValues[16];
XModel* worldModel[16];
float parallelBounce[31];
float perpendicularBounce[31];
float locationDamageMultipliers[20];
XModel* worldModel[NUM_WEAP_ALTMODELS];
float parallelBounce[SURF_TYPE_NUM];
float perpendicularBounce[SURF_TYPE_NUM];
float locationDamageMultipliers[HITLOC_COUNT];
};
enum VehicleAxleType
@@ -4940,7 +4989,7 @@ namespace IW4
SndAliasCustom speedSnd;
float speedSndBlendSpeed;
const char* surfaceSndPrefix;
SndAliasCustom surfaceSnds[31];
SndAliasCustom surfaceSnds[SURF_TYPE_NUM];
float surfaceSndBlendSpeed;
float slideVolume;
float slideBlendSpeed;
+72 -23
View File
@@ -1478,7 +1478,7 @@ namespace IW5
MaterialWorldVertexFormat worldVertFormat;
unsigned char unused[2];
MaterialTechniqueSet* remappedTechniqueSet;
MaterialTechnique* techniques[54];
MaterialTechnique* techniques[TECHNIQUE_COUNT];
};
struct type_align32(4) GfxImageLoadDef
@@ -1870,6 +1870,23 @@ namespace IW5
unsigned short childCount;
};
enum DynEntityDrawType
{
DYNENT_DRAW_MODEL = 0x0,
DYNENT_DRAW_BRUSH = 0x1,
DYNENT_DRAW_COUNT,
};
enum DynEntityCollType
{
DYNENT_COLL_CLIENT_FIRST = 0x0,
DYNENT_COLL_CLIENT_MODEL = 0x0,
DYNENT_COLL_CLIENT_BRUSH = 0x1,
DYNENT_COLL_COUNT,
};
enum DynEntityType
{
DYNENT_TYPE_INVALID = 0x0,
@@ -1978,11 +1995,11 @@ namespace IW5
MapTriggers stageTrigger;
unsigned short smodelNodeCount;
SModelAabbNode* smodelNodes;
unsigned short dynEntCount[2];
DynEntityDef* dynEntDefList[2];
DynEntityPose* dynEntPoseList[2];
DynEntityClient* dynEntClientList[2];
DynEntityColl* dynEntCollList[2];
unsigned short dynEntCount[DYNENT_COLL_COUNT];
DynEntityDef* dynEntDefList[DYNENT_DRAW_COUNT];
DynEntityPose* dynEntPoseList[DYNENT_DRAW_COUNT];
DynEntityClient* dynEntClientList[DYNENT_DRAW_COUNT];
DynEntityColl* dynEntCollList[DYNENT_COLL_COUNT];
unsigned int checksum;
unsigned char padding[20];
};
@@ -2772,10 +2789,10 @@ namespace IW5
struct GfxWorldDpvsDynamic
{
unsigned int dynEntClientWordCount[2];
unsigned int dynEntClientCount[2];
raw_uint* dynEntCellBits[2];
raw_byte16* dynEntVisData[2][3];
unsigned int dynEntClientWordCount[DYNENT_DRAW_COUNT];
unsigned int dynEntClientCount[DYNENT_DRAW_COUNT];
raw_uint* dynEntCellBits[DYNENT_DRAW_COUNT];
raw_byte16* dynEntVisData[DYNENT_DRAW_COUNT][3];
};
struct GfxHeroOnlyLight
@@ -2829,7 +2846,7 @@ namespace IW5
GfxSceneDynModel* sceneDynModel;
GfxSceneDynBrush* sceneDynBrush;
raw_uint* primaryLightEntityShadowVis;
raw_uint* primaryLightDynEntShadowVis[2];
raw_uint* primaryLightDynEntShadowVis[DYNENT_DRAW_COUNT];
raw_byte* nonSunPrimaryLightForModelDynEnt;
GfxShadowGeometry* shadowGeom;
GfxLightRegion* lightRegion;
@@ -4133,6 +4150,28 @@ namespace IW5
SURF_TYPE_COUNT
};
enum weaponAltModel_t
{
WEAP_ALT_MODEL0 = 0x0,
WEAP_ALT_MODEL1 = 0x1,
WEAP_ALT_MODEL2 = 0x2,
WEAP_ALT_MODEL3 = 0x3,
WEAP_ALT_MODEL4 = 0x4,
WEAP_ALT_MODEL5 = 0x5,
WEAP_ALT_MODEL6 = 0x6,
WEAP_ALT_MODEL7 = 0x7,
WEAP_ALT_MODEL8 = 0x8,
WEAP_ALT_MODEL9 = 0x9,
WEAP_ALT_MODEL10 = 0xA,
WEAP_ALT_MODEL11 = 0xB,
WEAP_ALT_MODEL12 = 0xC,
WEAP_ALT_MODEL13 = 0xD,
WEAP_ALT_MODEL14 = 0xE,
WEAP_ALT_MODEL15 = 0xF,
NUM_WEAP_ALTMODELS,
};
struct WeaponDef
{
const char* szOverlayName;
@@ -4673,18 +4712,18 @@ namespace IW5
WeaponCompleteDef weapCompleteDef;
WeaponDef weapDef;
uint16_t hideTags[32];
const char* szXAnims[42];
XModel* gunXModel[16];
const char* szXAnimsRightHanded[42];
const char* szXAnimsLeftHanded[42];
const char* szXAnims[WEAP_ANIM_COUNT];
XModel* gunXModel[NUM_WEAP_ALTMODELS];
const char* szXAnimsRightHanded[WEAP_ANIM_COUNT];
const char* szXAnimsLeftHanded[WEAP_ANIM_COUNT];
uint16_t notetrackSoundMapKeys[24];
uint16_t notetrackSoundMapValues[24];
uint16_t notetrackRumbleMapKeys[16];
uint16_t notetrackRumbleMapValues[16];
XModel* worldModel[16];
float parallelBounce[31];
float perpendicularBounce[31];
float locationDamageMultipliers[20];
XModel* worldModel[NUM_WEAP_ALTMODELS];
float parallelBounce[SURF_TYPE_COUNT];
float perpendicularBounce[SURF_TYPE_COUNT];
float locationDamageMultipliers[HITLOC_COUNT];
WeaponAttachment* scopes[6];
WeaponAttachment* underBarrels[3];
WeaponAttachment* others[4];
@@ -4923,10 +4962,20 @@ namespace IW5
FxElemDef* elemDefs;
};
enum FxFleshType
{
FX_FLESHTYPE_BODY_NONFATAL = 0x0,
FX_FLESHTYPE_BODY_FATAL = 0x1,
FX_FLESHTYPE_HEAD_NONFATAL = 0x2,
FX_FLESHTYPE_HEAD_FATAL = 0x3,
FX_FLESHTYPE_COUNT,
};
struct FxImpactEntry
{
FxEffectDef* nonflesh[31];
FxEffectDef* flesh[4];
FxEffectDef* nonflesh[SURF_TYPE_COUNT];
FxEffectDef* flesh[FX_FLESHTYPE_COUNT];
};
struct FxImpactTable
@@ -4937,7 +4986,7 @@ namespace IW5
struct SurfaceFxEntry
{
FxEffectDef* surfaceEffect[31];
FxEffectDef* surfaceEffect[SURF_TYPE_COUNT];
};
struct SurfaceFxTable
@@ -5430,7 +5479,7 @@ namespace IW5
SndAliasCustom speedSnd;
float speedSndBlendSpeed;
const char* surfaceSndPrefix;
SndAliasCustom surfaceSnds[31];
SndAliasCustom surfaceSnds[SURF_TYPE_COUNT];
float surfaceSndBlendSpeed;
float slideVolume;
float slideBlendSpeed;
+84 -31
View File
@@ -769,7 +769,7 @@ namespace QOS
{
const char* name;
char unknown[8];
MaterialTechnique* techniques[43];
MaterialTechnique* techniques[TECHNIQUE_COUNT];
};
struct complex_s
@@ -935,6 +935,42 @@ namespace QOS
gcc_align32(8) uint64_t packed;
};
enum materialSurfType_t
{
SURF_TYPE_DEFAULT,
SURF_TYPE_BARK,
SURF_TYPE_BRICK,
SURF_TYPE_CARPET,
SURF_TYPE_CLOTH,
SURF_TYPE_CONCRETE,
SURF_TYPE_DIRT,
SURF_TYPE_FLESH,
SURF_TYPE_FOLIAGE,
SURF_TYPE_GLASS,
SURF_TYPE_GRASS,
SURF_TYPE_GRAVEL,
SURF_TYPE_ICE,
SURF_TYPE_METAL,
SURF_TYPE_MUD,
SURF_TYPE_PAPER,
SURF_TYPE_PLASTER,
SURF_TYPE_ROCK,
SURF_TYPE_SAND,
SURF_TYPE_SNOW,
SURF_TYPE_WATER,
SURF_TYPE_WOOD,
SURF_TYPE_ASPHALT,
SURF_TYPE_CERAMIC,
SURF_TYPE_PLASTIC,
SURF_TYPE_RUBBER,
SURF_TYPE_CUSHION,
SURF_TYPE_FRUIT,
SURF_TYPE_PAINTED_METAL,
SURF_TYPE_METAL_GRATE,
SURF_TYPE_NUM
};
struct MaterialInfo
{
const char* name;
@@ -950,7 +986,7 @@ namespace QOS
struct Material
{
MaterialInfo info;
char stateBitsEntry[43];
char stateBitsEntry[TECHNIQUE_COUNT];
unsigned char textureCount;
unsigned char constantCount;
unsigned char stateBitsCount;
@@ -1185,6 +1221,26 @@ namespace QOS
char unknown[72];
};
enum DynEntityDrawType
{
DYNENT_DRAW_MODEL = 0x0,
DYNENT_DRAW_BRUSH = 0x1,
DYNENT_DRAW_COUNT,
};
enum DynEntityCollType
{
DYNENT_COLL_CLIENT_FIRST = 0x0,
DYNENT_COLL_CLIENT_MODEL = 0x0,
DYNENT_COLL_CLIENT_BRUSH = 0x1,
DYNENT_COLL_SERVER_FIRST = 0x2,
DYNENT_COLL_SERVER_MODEL = 0x2,
DYNENT_COLL_SERVER_BRUSH = 0x3,
DYNENT_COLL_COUNT,
};
struct clipMap_t
{
const char* name;
@@ -1236,11 +1292,11 @@ namespace QOS
MapEnts* mapEnts;
cbrush_t* box_brush;
char unknown1[74];
uint16_t dynEntCount[4];
DynEntityDef* dynEntDefList[2];
DynEntityClient* dynEntClientList[2];
DynEntityServer* dynEntServerList[2];
DynEntityColl* dynEntCollList[4];
uint16_t dynEntCount[DYNENT_COLL_COUNT];
DynEntityDef* dynEntDefList[DYNENT_DRAW_COUNT];
DynEntityClient* dynEntClientList[DYNENT_DRAW_COUNT];
DynEntityServer* dynEntServerList[DYNENT_DRAW_COUNT];
DynEntityColl* dynEntCollList[DYNENT_COLL_COUNT];
int num_constraints;
DynEntityPhysConstraint* constraints;
int unknown3;
@@ -1715,10 +1771,8 @@ namespace QOS
sunflare_t sun;
float outdoorLookupMatrix[4][4];
GfxImage* outdoorImage;
unsigned int gfxSceneDynModelCount; // Unknown name
unsigned int gfxSceneDynBrushCount; // Unknown name
unsigned int unknownGfxDynEntCellRefCount0;
unsigned int unknownGfxDynEntCellRefCount1;
unsigned int dynEntClientCount[DYNENT_DRAW_COUNT];
unsigned int unknownGfxDynEntCellRefCount[DYNENT_DRAW_COUNT];
unsigned char* smodelVisData0;
unsigned char* smodelVisData1;
unsigned char* smodelVisData2;
@@ -1731,26 +1785,15 @@ namespace QOS
unsigned int* surfaceCastsSunShadow;
unsigned int* cellCasterBits;
unsigned char* cellHasSunLitSurfsBits;
unsigned char* dynEntVisData0_0;
unsigned char* dynEntVisData0_1;
unsigned char* dynEntVisData0_2;
unsigned char* dynEntVisData0_3;
unsigned char* dynEntVisData1_0;
unsigned char* dynEntVisData1_1;
unsigned char* dynEntVisData1_2;
unsigned char* dynEntVisData1_3;
unsigned char* dynEntCellBits0;
unsigned char* dynEntCellBits1;
unsigned short* dynEntSortList0;
unsigned short* dynEntSortList1;
GfxDynEntCellRef* unknownGfxDynEntCellRef0;
GfxDynEntCellRef* unknownGfxDynEntCellRef1;
GfxSceneDynModel4* gfxSceneDynModel; // name unknown
GfxSceneDynBrush* gfxSceneDynBrush; // name unknown
unsigned char* dynEntVisData[DYNENT_DRAW_COUNT][4];
unsigned char* dynEntCellBits[DYNENT_DRAW_COUNT];
unsigned short* dynEntSortList[DYNENT_DRAW_COUNT];
GfxDynEntCellRef* unknownGfxDynEntCellRef[DYNENT_DRAW_COUNT];
GfxSceneDynModel4* sceneDynModel;
GfxSceneDynBrush* sceneDynBrush;
unsigned short* sortedSurfIndex;
unsigned int* primaryLightEntityShadowVis;
unsigned int* primaryLightDynEntShadowVis0;
unsigned int* primaryLightDynEntShadowVis1;
unsigned int* primaryLightDynEntShadowVis[DYNENT_DRAW_COUNT];
GfxShadowGeometry* shadowGeom;
unsigned int massiveAdSurfaceCount;
GfxMassiveAdSurface* massiveAdSurface;
@@ -2505,10 +2548,20 @@ namespace QOS
DestructiblePiece* pieces;
};
enum FxFleshType
{
FX_FLESHTYPE_BODY_NONFATAL = 0x0,
FX_FLESHTYPE_BODY_FATAL = 0x1,
FX_FLESHTYPE_HEAD_NONFATAL = 0x2,
FX_FLESHTYPE_HEAD_FATAL = 0x3,
FX_FLESHTYPE_COUNT,
};
struct FxImpactEntry
{
FxEffectDef* nonflesh[30];
FxEffectDef* flesh[4];
FxEffectDef* nonflesh[SURF_TYPE_NUM];
FxEffectDef* flesh[FX_FLESHTYPE_COUNT];
};
struct FxImpactTable
+40 -8
View File
@@ -1551,7 +1551,7 @@ namespace T4
bool hasBeenUploaded;
char unused[1];
MaterialTechniqueSet* remappedTechniqueSet;
MaterialTechnique* techniques[59];
MaterialTechnique* techniques[TECHNIQUE_COUNT];
};
struct CardMemory
@@ -3604,14 +3604,36 @@ namespace T4
SndAliasCustom flameCooldownSound;
};
enum weaponAltModel_t
{
WEAP_ALT_MODEL0 = 0x0,
WEAP_ALT_MODEL1 = 0x1,
WEAP_ALT_MODEL2 = 0x2,
WEAP_ALT_MODEL3 = 0x3,
WEAP_ALT_MODEL4 = 0x4,
WEAP_ALT_MODEL5 = 0x5,
WEAP_ALT_MODEL6 = 0x6,
WEAP_ALT_MODEL7 = 0x7,
WEAP_ALT_MODEL8 = 0x8,
WEAP_ALT_MODEL9 = 0x9,
WEAP_ALT_MODEL10 = 0xA,
WEAP_ALT_MODEL11 = 0xB,
WEAP_ALT_MODEL12 = 0xC,
WEAP_ALT_MODEL13 = 0xD,
WEAP_ALT_MODEL14 = 0xE,
WEAP_ALT_MODEL15 = 0xF,
NUM_WEAP_ALTMODELS,
};
struct WeaponDef
{
const char* szInternalName;
const char* szDisplayName;
const char* szOverlayName;
XModel* gunXModel[16];
XModel* gunXModel[NUM_WEAP_ALTMODELS];
XModel* handXModel;
const char* szXAnims[35];
const char* szXAnims[NUM_WEAP_ANIMS];
const char* szModeName;
uint16_t hideTags[8];
uint16_t notetrackSoundMapKeys[20];
@@ -3735,7 +3757,7 @@ namespace T4
float fStandRotMinSpeed;
float fDuckedRotMinSpeed;
float fProneRotMinSpeed;
XModel* worldModel[16];
XModel* worldModel[NUM_WEAP_ALTMODELS];
XModel* worldClipModel;
XModel* rocketModel;
XModel* knifeModel;
@@ -3928,8 +3950,8 @@ namespace T4
int holdButtonToThrow;
int freezeMovementWhenFiring;
float lowAmmoWarningThreshold;
float parallelBounce[31];
float perpendicularBounce[31];
float parallelBounce[SURF_TYPE_NUM];
float perpendicularBounce[SURF_TYPE_NUM];
FxEffectDef* projTrailEffect;
float vProjectileColor[3];
guidedMissileType_t guidedMissileType;
@@ -4290,10 +4312,20 @@ namespace T4
FxElemDef* elemDefs;
};
enum FxFleshType
{
FX_FLESHTYPE_BODY_NONFATAL = 0x0,
FX_FLESHTYPE_BODY_FATAL = 0x1,
FX_FLESHTYPE_HEAD_NONFATAL = 0x2,
FX_FLESHTYPE_HEAD_FATAL = 0x3,
FX_FLESHTYPE_COUNT,
};
struct FxImpactEntry
{
FxEffectDef* nonflesh[31];
FxEffectDef* flesh[4];
FxEffectDef* nonflesh[SURF_TYPE_NUM];
FxEffectDef* flesh[FX_FLESHTYPE_COUNT];
};
struct FxImpactTable
+72 -20
View File
@@ -1788,7 +1788,7 @@ namespace T5
MaterialWorldVertexFormat worldVertFormat;
char unused[1];
uint16_t techsetFlags;
MaterialTechnique* techniques[130];
MaterialTechnique* techniques[TECHNIQUE_COUNT];
};
struct GfxImageLoadDef
@@ -2233,6 +2233,26 @@ namespace T5
vec3_t* verts;
};
enum DynEntityDrawType
{
DYNENT_DRAW_MODEL = 0x0,
DYNENT_DRAW_BRUSH = 0x1,
DYNENT_DRAW_COUNT,
};
enum DynEntityCollType
{
DYNENT_COLL_CLIENT_FIRST = 0x0,
DYNENT_COLL_CLIENT_MODEL = 0x0,
DYNENT_COLL_CLIENT_BRUSH = 0x1,
DYNENT_COLL_SERVER_FIRST = 0x2,
DYNENT_COLL_SERVER_MODEL = 0x2,
DYNENT_COLL_SERVER_BRUSH = 0x3,
DYNENT_COLL_COUNT,
};
enum DynEntityType
{
DYNENT_TYPE_INVALID = 0x0,
@@ -2430,12 +2450,12 @@ namespace T5
cbrush_t* box_brush;
cmodel_t box_model;
uint16_t originalDynEntCount;
uint16_t dynEntCount[4];
DynEntityDef* dynEntDefList[2];
DynEntityPose* dynEntPoseList[2];
DynEntityClient* dynEntClientList[2];
DynEntityServer* dynEntServerList[2];
DynEntityColl* dynEntCollList[4];
uint16_t dynEntCount[DYNENT_COLL_COUNT];
DynEntityDef* dynEntDefList[DYNENT_DRAW_COUNT];
DynEntityPose* dynEntPoseList[DYNENT_DRAW_COUNT];
DynEntityClient* dynEntClientList[DYNENT_DRAW_COUNT];
DynEntityServer* dynEntServerList[DYNENT_DRAW_COUNT];
DynEntityColl* dynEntCollList[DYNENT_COLL_COUNT];
int num_constraints;
PhysConstraint* constraints;
int max_ropes;
@@ -3145,10 +3165,10 @@ namespace T5
struct GfxWorldDpvsDynamic
{
unsigned int dynEntClientWordCount[2];
unsigned int dynEntClientCount[2];
unsigned int* dynEntCellBits[2];
raw_byte16* dynEntVisData[2][3];
unsigned int dynEntClientWordCount[DYNENT_DRAW_COUNT];
unsigned int dynEntClientCount[DYNENT_DRAW_COUNT];
unsigned int* dynEntCellBits[DYNENT_DRAW_COUNT];
raw_byte16* dynEntVisData[DYNENT_DRAW_COUNT][3];
};
struct GfxWorldLodChain
@@ -3252,7 +3272,7 @@ namespace T5
GfxSceneDynModel4* sceneDynModel;
GfxSceneDynBrush* sceneDynBrush;
unsigned int* primaryLightEntityShadowVis;
unsigned int* primaryLightDynEntShadowVis[2];
unsigned int* primaryLightDynEntShadowVis[DYNENT_DRAW_COUNT];
char* nonSunPrimaryLightForModelDynEnt;
GfxShadowGeometry* shadowGeom;
GfxLightRegion* lightRegion;
@@ -4284,6 +4304,28 @@ namespace T5
const char* flameCooldownSound;
};
enum weaponAltModel_t
{
WEAP_ALT_MODEL0 = 0x0,
WEAP_ALT_MODEL1 = 0x1,
WEAP_ALT_MODEL2 = 0x2,
WEAP_ALT_MODEL3 = 0x3,
WEAP_ALT_MODEL4 = 0x4,
WEAP_ALT_MODEL5 = 0x5,
WEAP_ALT_MODEL6 = 0x6,
WEAP_ALT_MODEL7 = 0x7,
WEAP_ALT_MODEL8 = 0x8,
WEAP_ALT_MODEL9 = 0x9,
WEAP_ALT_MODEL10 = 0xA,
WEAP_ALT_MODEL11 = 0xB,
WEAP_ALT_MODEL12 = 0xC,
WEAP_ALT_MODEL13 = 0xD,
WEAP_ALT_MODEL14 = 0xE,
WEAP_ALT_MODEL15 = 0xF,
NUM_WEAP_ALTMODELS,
};
struct WeaponDef
{
const char* szOverlayName;
@@ -4847,15 +4889,15 @@ namespace T5
{
WeaponVariantDef weapVariantDef;
WeaponDef weapDef;
XModel* gunXModel[16];
const char* szXAnims[66];
XModel* gunXModel[NUM_WEAP_ALTMODELS];
const char* szXAnims[NUM_WEAP_ANIMS];
uint16_t hideTags[32];
uint16_t notetrackSoundMapKeys[20];
uint16_t notetrackSoundMapValues[20];
XModel* worldModel[16];
float parallelBounce[31];
float perpendicularBounce[31];
float locationDamageMultipliers[19];
XModel* worldModel[NUM_WEAP_ALTMODELS];
float parallelBounce[SURF_TYPE_NUM];
float perpendicularBounce[SURF_TYPE_NUM];
float locationDamageMultipliers[HITLOC_COUNT];
};
enum snd_category_t
@@ -5188,10 +5230,20 @@ namespace T5
float boundingSphere[4];
};
enum FxFleshType
{
FX_FLESHTYPE_BODY_NONFATAL = 0x0,
FX_FLESHTYPE_BODY_FATAL = 0x1,
FX_FLESHTYPE_HEAD_NONFATAL = 0x2,
FX_FLESHTYPE_HEAD_FATAL = 0x3,
FX_FLESHTYPE_COUNT,
};
struct FxImpactEntry
{
FxEffectDef* nonflesh[31];
FxEffectDef* flesh[4];
FxEffectDef* nonflesh[SURF_TYPE_NUM];
FxEffectDef* flesh[FX_FLESHTYPE_COUNT];
};
struct FxImpactTable
+45 -13
View File
@@ -804,7 +804,7 @@ namespace T6
{
const char* name;
MaterialWorldVertexFormat worldVertFormat;
MaterialTechnique* techniques[36];
MaterialTechnique* techniques[TECHNIQUE_COUNT];
};
union GfxTexture
@@ -2344,7 +2344,7 @@ namespace T6
int isDrivable;
int numberOfSeats;
int numberOfGunners;
int seatSwitchOrder[11];
int seatSwitchOrder[NUM_VEHICLE_POSITIONS];
int driverControlledGunPos;
float entryPointRadius[5];
float texScrollScale;
@@ -2379,9 +2379,9 @@ namespace T6
float gunnerRotRate;
vec2_t gunnerRestAngles[4];
view_limits_t passengerViewLimits[6];
const char* sndNames[2];
unsigned int sndIndices[2];
const char* sndMaterialNames[3];
const char* sndNames[NUM_VEHICLE_SNDS];
unsigned int sndIndices[NUM_VEHICLE_SNDS];
const char* sndMaterialNames[NUM_VEHICLE_MATERIAL_SNDS];
float skidSpeedMin;
float skidSpeedMax;
const char* futzName;
@@ -5175,25 +5175,47 @@ namespace T6
vec3_t ikLeftHandUiViewerRotation;
};
enum weaponAltModel_t
{
WEAP_ALT_MODEL0 = 0x0,
WEAP_ALT_MODEL1 = 0x1,
WEAP_ALT_MODEL2 = 0x2,
WEAP_ALT_MODEL3 = 0x3,
WEAP_ALT_MODEL4 = 0x4,
WEAP_ALT_MODEL5 = 0x5,
WEAP_ALT_MODEL6 = 0x6,
WEAP_ALT_MODEL7 = 0x7,
WEAP_ALT_MODEL8 = 0x8,
WEAP_ALT_MODEL9 = 0x9,
WEAP_ALT_MODEL10 = 0xA,
WEAP_ALT_MODEL11 = 0xB,
WEAP_ALT_MODEL12 = 0xC,
WEAP_ALT_MODEL13 = 0xD,
WEAP_ALT_MODEL14 = 0xE,
WEAP_ALT_MODEL15 = 0xF,
NUM_WEAP_ALTMODELS,
};
struct WeaponFullDef
{
WeaponVariantDef weapVariantDef;
WeaponDef weapDef;
WeaponAttachment* attachments[63];
WeaponAttachmentUnique* attachmentUniques[95];
XModel* gunXModel[16];
const char* szXAnims[88];
XModel* gunXModel[NUM_WEAP_ALTMODELS];
const char* szXAnims[NUM_WEAP_ANIMS];
uint16_t hideTags[32];
uint16_t notetrackSoundMapKeys[20];
uint16_t notetrackSoundMapValues[20];
XModel* worldModel[16];
XModel* worldModel[NUM_WEAP_ALTMODELS];
XModel* attachViewModel[8];
XModel* attachWorldModel[8];
const char* attachViewModelTag[8];
const char* attachWorldModelTag[8];
float parallelBounce[32];
float perpendicularBounce[32];
float locationDamageMultipliers[21];
float parallelBounce[SURF_TYPE_NUM];
float perpendicularBounce[SURF_TYPE_NUM];
float locationDamageMultipliers[HITLOC_COUNT];
char weaponCamo[64];
};
@@ -5505,10 +5527,20 @@ namespace T6
vec2_t billboardPivot;
};
enum FxFleshType
{
FX_FLESHTYPE_BODY_NONFATAL = 0x0,
FX_FLESHTYPE_BODY_FATAL = 0x1,
FX_FLESHTYPE_HEAD_NONFATAL = 0x2,
FX_FLESHTYPE_HEAD_FATAL = 0x3,
FX_FLESHTYPE_COUNT,
};
struct FxImpactEntry
{
FxEffectDef* nonflesh[32];
FxEffectDef* flesh[4];
FxEffectDef* nonflesh[SURF_TYPE_NUM];
FxEffectDef* flesh[FX_FLESHTYPE_COUNT];
};
struct StringTableCell
+32 -54
View File
@@ -46,45 +46,34 @@ set block cellCasterBits XFILE_BLOCK_RUNTIME;
set count cellCasterBits cellCount * ((cellCount + 31) / 32);
set block cellHasSunLitSurfsBits XFILE_BLOCK_RUNTIME;
set count cellHasSunLitSurfsBits (cellCount * 512) + 1;
set block dynEntVisData0_0 XFILE_BLOCK_RUNTIME;
set count dynEntVisData0_0 gfxSceneDynModelCount;
set block dynEntVisData0_1 XFILE_BLOCK_RUNTIME;
set count dynEntVisData0_1 gfxSceneDynModelCount;
set block dynEntVisData0_2 XFILE_BLOCK_RUNTIME;
set count dynEntVisData0_2 gfxSceneDynModelCount;
set block dynEntVisData0_3 XFILE_BLOCK_RUNTIME;
set count dynEntVisData0_3 gfxSceneDynModelCount;
set block dynEntVisData1_0 XFILE_BLOCK_RUNTIME;
set count dynEntVisData1_0 gfxSceneDynBrushCount;
set block dynEntVisData1_1 XFILE_BLOCK_RUNTIME;
set count dynEntVisData1_1 gfxSceneDynBrushCount;
set block dynEntVisData1_2 XFILE_BLOCK_RUNTIME;
set count dynEntVisData1_2 gfxSceneDynBrushCount;
set block dynEntVisData1_3 XFILE_BLOCK_RUNTIME;
set count dynEntVisData1_3 gfxSceneDynBrushCount;
set block dynEntCellBits0 XFILE_BLOCK_RUNTIME;
set count dynEntCellBits0 (cellCount * gfxSceneDynModelCount / 8) + 1;
set block dynEntCellBits1 XFILE_BLOCK_RUNTIME;
set count dynEntCellBits1 (cellCount * gfxSceneDynBrushCount / 8) + 1;
set block dynEntSortList0 XFILE_BLOCK_RUNTIME;
set count dynEntSortList0 gfxSceneDynModelCount;
set block dynEntSortList1 XFILE_BLOCK_RUNTIME;
set count dynEntSortList1 gfxSceneDynBrushCount;
set block unknownGfxDynEntCellRef0 XFILE_BLOCK_RUNTIME;
set count unknownGfxDynEntCellRef0 unknownGfxDynEntCellRefCount0;
set block unknownGfxDynEntCellRef1 XFILE_BLOCK_RUNTIME;
set count unknownGfxDynEntCellRef1 unknownGfxDynEntCellRefCount1;
set block gfxSceneDynModel XFILE_BLOCK_RUNTIME;
set count gfxSceneDynModel gfxSceneDynModelCount;
set block gfxSceneDynBrush XFILE_BLOCK_RUNTIME;
set count gfxSceneDynBrush gfxSceneDynBrushCount;
set block dynEntVisData XFILE_BLOCK_RUNTIME;
set count dynEntVisData[0][0] dynEntClientCount[0];
set count dynEntVisData[0][1] dynEntClientCount[0];
set count dynEntVisData[0][2] dynEntClientCount[0];
set count dynEntVisData[0][3] dynEntClientCount[0];
set count dynEntVisData[1][1] dynEntClientCount[1];
set count dynEntVisData[1][0] dynEntClientCount[1];
set count dynEntVisData[1][2] dynEntClientCount[1];
set count dynEntVisData[1][3] dynEntClientCount[1];
set block dynEntCellBits XFILE_BLOCK_RUNTIME;
set count dynEntCellBits[0] (cellCount * dynEntClientCount[0] / 8) + 1;
set count dynEntCellBits[1] (cellCount * dynEntClientCount[1] / 8) + 1;
set block dynEntSortList XFILE_BLOCK_RUNTIME;
set count dynEntSortList[0] dynEntClientCount[0];
set count dynEntSortList[1] dynEntClientCount[1];
set block unknownGfxDynEntCellRef XFILE_BLOCK_RUNTIME;
set count unknownGfxDynEntCellRef[0] unknownGfxDynEntCellRefCount[0];
set count unknownGfxDynEntCellRef[1] unknownGfxDynEntCellRefCount[1];
set block sceneDynModel XFILE_BLOCK_RUNTIME;
set count sceneDynModel dynEntClientCount[0];
set block sceneDynBrush XFILE_BLOCK_RUNTIME;
set count sceneDynBrush dynEntClientCount[1];
set count sortedSurfIndex models::surfaceCount;
set block primaryLightEntityShadowVis XFILE_BLOCK_RUNTIME;
set count primaryLightEntityShadowVis (primaryLightCount - sunPrimaryLightIndex - 1) * 0x1000;
set block primaryLightDynEntShadowVis0 XFILE_BLOCK_RUNTIME;
set count primaryLightDynEntShadowVis0 gfxSceneDynModelCount * (primaryLightCount - sunPrimaryLightIndex - 1);
set block primaryLightDynEntShadowVis1 XFILE_BLOCK_RUNTIME;
set count primaryLightDynEntShadowVis1 gfxSceneDynBrushCount * (primaryLightCount - sunPrimaryLightIndex - 1);
set block primaryLightDynEntShadowVis XFILE_BLOCK_RUNTIME;
set count primaryLightDynEntShadowVis[0] dynEntClientCount[0] * (primaryLightCount - sunPrimaryLightIndex - 1);
set count primaryLightDynEntShadowVis[1] dynEntClientCount[1] * (primaryLightCount - sunPrimaryLightIndex - 1);
set count shadowGeom primaryLightCount;
set count massiveAdSurface massiveAdSurfaceCount;
reorder:
@@ -123,25 +112,14 @@ reorder:
surfaceCastsSunShadow
cellCasterBits
cellHasSunLitSurfsBits
dynEntVisData0_0
dynEntVisData1_0
dynEntVisData0_1
dynEntVisData1_1
dynEntVisData0_2
dynEntVisData1_2
dynEntVisData0_3
dynEntVisData1_3
dynEntCellBits0
dynEntCellBits1
dynEntSortList0
dynEntSortList1
unknownGfxDynEntCellRef0
unknownGfxDynEntCellRef1
gfxSceneDynModel
gfxSceneDynBrush
dynEntVisData
dynEntCellBits
dynEntSortList
unknownGfxDynEntCellRef
sceneDynModel
sceneDynBrush
primaryLightEntityShadowVis
primaryLightDynEntShadowVis0
primaryLightDynEntShadowVis1
primaryLightDynEntShadowVis
sortedSurfIndex
shadowGeom
massiveAdSurface
+2 -2
View File
@@ -148,10 +148,10 @@ set count dynEntCellBits[0] dynEntClientWordCount[0] * GfxWorld::dpvsPlanes::cel
set count dynEntCellBits[1] dynEntClientWordCount[1] * GfxWorld::dpvsPlanes::cellCount;
set block dynEntVisData XFILE_BLOCK_RUNTIME;
set count dynEntVisData[0][0] 32 * dynEntClientWordCount[0];
set count dynEntVisData[1][0] 32 * dynEntClientWordCount[1];
set count dynEntVisData[0][1] 32 * dynEntClientWordCount[0];
set count dynEntVisData[1][1] 32 * dynEntClientWordCount[1];
set count dynEntVisData[0][2] 32 * dynEntClientWordCount[0];
set count dynEntVisData[1][1] 32 * dynEntClientWordCount[1];
set count dynEntVisData[1][0] 32 * dynEntClientWordCount[1];
set count dynEntVisData[1][2] 32 * dynEntClientWordCount[1];
// GfxWaterBuffer