IW5 Fixups

This commit is contained in:
Jan 2021-07-23 16:28:59 +02:00
parent 02b0f11c29
commit 88710cb3bf
27 changed files with 566 additions and 269 deletions

View File

@ -3,9 +3,11 @@
#ifndef __IW5_ASSETS_H #ifndef __IW5_ASSETS_H
#define __IW5_ASSETS_H #define __IW5_ASSETS_H
#ifndef __zonecodegenerator
#ifndef __cplusplus #ifndef __cplusplus
#define __ida #define __ida
#endif #endif
#endif
#include "../../Utils/TypeAlignment.h" #include "../../Utils/TypeAlignment.h"
@ -47,6 +49,7 @@ namespace IW5
ASSET_TYPE_LOCALIZE_ENTRY = 0x1B, ASSET_TYPE_LOCALIZE_ENTRY = 0x1B,
ASSET_TYPE_ATTACHMENT = 0x1C, ASSET_TYPE_ATTACHMENT = 0x1C,
ASSET_TYPE_WEAPON = 0x1D, ASSET_TYPE_WEAPON = 0x1D,
ASSET_TYPE_SNDDRIVER_GLOBALS = 0x1E,
ASSET_TYPE_FX = 0x1F, ASSET_TYPE_FX = 0x1F,
ASSET_TYPE_IMPACT_FX = 0x20, ASSET_TYPE_IMPACT_FX = 0x20,
ASSET_TYPE_SURFACE_FX = 0x21, ASSET_TYPE_SURFACE_FX = 0x21,
@ -78,6 +81,8 @@ namespace IW5
XFILE_BLOCK_VIRTUAL, XFILE_BLOCK_VIRTUAL,
XFILE_BLOCK_LARGE, XFILE_BLOCK_LARGE,
XFILE_BLOCK_CALLBACK, XFILE_BLOCK_CALLBACK,
XFILE_BLOCK_VERTEX,
XFILE_BLOCK_INDEX,
XFILE_BLOCK_SCRIPT, XFILE_BLOCK_SCRIPT,
MAX_XFILE_COUNT MAX_XFILE_COUNT
@ -236,7 +241,7 @@ namespace IW5
typedef unsigned char cbrushedge_t; typedef unsigned char cbrushedge_t;
struct cbrush_t struct cbrushWrapper_t
{ {
unsigned short numsides; unsigned short numsides;
unsigned short glassPieceIndex; unsigned short glassPieceIndex;
@ -247,8 +252,6 @@ namespace IW5
unsigned char edgeCount[2][3]; unsigned char edgeCount[2][3];
}; };
typedef struct cbrush_t cbrushWrapper_t;
struct BrushWrapper struct BrushWrapper
{ {
Bounds bounds; Bounds bounds;
@ -674,6 +677,23 @@ namespace IW5
GfxImage* image; GfxImage* image;
}; };
enum TextureSemantic
{
TS_2D = 0x0,
TS_FUNCTION = 0x1,
TS_COLOR_MAP = 0x2,
TS_DETAIL_MAP = 0x3,
TS_UNUSED_2 = 0x4,
TS_NORMAL_MAP = 0x5,
TS_UNUSED_3 = 0x6,
TS_UNUSED_4 = 0x7,
TS_SPECULAR_MAP = 0x8,
TS_UNUSED_5 = 0x9,
TS_UNUSED_6 = 0xA,
TS_WATER_MAP = 0xB,
TS_DISPLACEMENT_MAP = 0xC
};
union MaterialTextureDefInfo union MaterialTextureDefInfo
{ {
GfxImage* image; GfxImage* image;
@ -733,7 +753,7 @@ namespace IW5
uint16_t loadForRenderer; uint16_t loadForRenderer;
}; };
union MaterialPixelShaderProgram struct MaterialPixelShaderProgram
{ {
void* ps; void* ps;
GfxPixelShaderLoadDef loadDef; GfxPixelShaderLoadDef loadDef;
@ -784,6 +804,23 @@ namespace IW5
MaterialVertexStreamRouting routing; MaterialVertexStreamRouting routing;
}; };
enum MaterialShaderArgumentType
{
MTL_ARG_MATERIAL_VERTEX_CONST = 0x0,
MTL_ARG_LITERAL_VERTEX_CONST = 0x1,
MTL_ARG_MATERIAL_VERTEX_SAMPLER = 0x2,
MTL_ARG_MATERIAL_PIXEL_SAMPLER = 0x3,
MTL_ARG_CODE_PRIM_BEGIN = 0x4,
MTL_ARG_CODE_VERTEX_CONST = 0x4,
MTL_ARG_CODE_PIXEL_SAMPLER = 0x5,
MTL_ARG_CODE_PIXEL_CONST = 0x6,
MTL_ARG_CODE_PRIM_END = 0x7,
MTL_ARG_MATERIAL_PIXEL_CONST = 0x7,
MTL_ARG_LITERAL_PIXEL_CONST = 0x8,
MTL_ARG_COUNT
};
struct MaterialArgumentCodeConst struct MaterialArgumentCodeConst
{ {
unsigned short index; unsigned short index;
@ -885,6 +922,15 @@ namespace IW5
const char* name; const char* name;
}; };
enum snd_alias_type_t
{
SAT_UNKNOWN = 0x0,
SAT_LOADED = 0x1,
SAT_STREAMED = 0x2,
SAT_VOICED = 0x3,
SAT_COUNT = 0x4
};
struct StreamedSound struct StreamedSound
{ {
const char* dir; const char* dir;
@ -1029,6 +1075,18 @@ namespace IW5
int contents; int contents;
cLeafBrushNodeData_t data; cLeafBrushNodeData_t data;
}; };
struct cbrush_t
{
unsigned short numsides;
unsigned short glassPieceIndex;
cbrushside_t* sides;
cbrushedge_t* baseAdjacentSide;
short axialMaterialNum[2][3];
unsigned char firstAdjacentSideOffsets[2][3];
unsigned char edgeCount[2][3];
};
typedef tdef_align(128) cbrush_t cbrush_array_t; typedef tdef_align(128) cbrush_t cbrush_array_t;
typedef tdef_align(128) Bounds BoundsArray; typedef tdef_align(128) Bounds BoundsArray;
@ -2102,7 +2160,7 @@ namespace IW5
unsigned int sortKeyEffectAuto; unsigned int sortKeyEffectAuto;
unsigned int sortKeyDistortion; unsigned int sortKeyDistortion;
GfxWorldDpvsPlanes dpvsPlanes; GfxWorldDpvsPlanes dpvsPlanes;
GfxCellTreeCount* aabbTreeCounts; int/*GfxCellTreeCount*/* aabbTreeCounts;
GfxCellTree128* aabbTrees; GfxCellTree128* aabbTrees;
GfxCell* cells; GfxCell* cells;
GfxWorldDraw draw; GfxWorldDraw draw;
@ -2185,10 +2243,9 @@ namespace IW5
VAL_INT = 0x0, VAL_INT = 0x0,
VAL_FLOAT = 0x1, VAL_FLOAT = 0x1,
VAL_STRING = 0x2, VAL_STRING = 0x2,
NUM_INTERNAL_DATATYPES = 0x3,
VAL_FUNCTION = 0x3, VAL_FUNCTION = 0x3,
NUM_DATATYPES NUM_DATATYPES,
}; };
struct ExpressionString struct ExpressionString
@ -2545,6 +2602,12 @@ namespace IW5
NUM_OPERATORS NUM_OPERATORS
}; };
enum expressionEntryType : int
{
EET_OPERATOR = 0x0,
EET_OPERAND = 0x1,
};
union entryInternalData union entryInternalData
{ {
operationEnum op; operationEnum op;
@ -2678,6 +2741,19 @@ namespace IW5
SetLocalVarData* setLocalVarData; SetLocalVarData* setLocalVarData;
}; };
enum EventType
{
EVENT_UNCONDITIONAL = 0x0,
EVENT_IF = 0x1,
EVENT_ELSE = 0x2,
EVENT_SET_LOCAL_VAR_BOOL = 0x3,
EVENT_SET_LOCAL_VAR_INT = 0x4,
EVENT_SET_LOCAL_VAR_FLOAT = 0x5,
EVENT_SET_LOCAL_VAR_STRING = 0x6,
EVENT_COUNT
};
struct MenuEventHandler struct MenuEventHandler
{ {
EventData eventData; EventData eventData;
@ -2732,11 +2808,11 @@ namespace IW5
Statement_s* openSoundExp; Statement_s* openSoundExp;
Statement_s* closeSoundExp; Statement_s* closeSoundExp;
Statement_s* soundLoopExp; Statement_s* soundLoopExp;
int cursorItem[4]; int cursorItem[1];
menuTransition scaleTransition[4]; menuTransition scaleTransition[1];
menuTransition alphaTransition[4]; menuTransition alphaTransition[1];
menuTransition xTransition[4]; menuTransition xTransition[1];
menuTransition yTransition[4]; menuTransition yTransition[1];
ExpressionSupportingData* expressionData; ExpressionSupportingData* expressionData;
unsigned char priority; unsigned char priority;
}; };
@ -2763,7 +2839,7 @@ namespace IW5
int ownerDrawFlags; int ownerDrawFlags;
float borderSize; float borderSize;
int staticFlags; int staticFlags;
int dynamicFlags[4]; int dynamicFlags[1];
int nextTime; int nextTime;
float foreColor[4]; float foreColor[4];
float backColor[4]; float backColor[4];
@ -2785,8 +2861,9 @@ namespace IW5
struct listBoxDef_s struct listBoxDef_s
{ {
int startPos[4]; int mousePos;
int endPos[4]; int startPos[1];
int endPos[1];
int drawPadding; int drawPadding;
float elementWidth; float elementWidth;
float elementHeight; float elementHeight;
@ -2852,10 +2929,10 @@ namespace IW5
Statement_s* expression; Statement_s* expression;
}; };
struct itemDef_t struct itemDef_s
{ {
windowDef_t window; windowDef_t window;
rectDef_s textRect[4]; rectDef_s textRect[1];
int type; int type;
int dataType; int dataType;
int alignment; int alignment;
@ -2887,7 +2964,7 @@ namespace IW5
int dvarFlags; int dvarFlags;
snd_alias_list_t* focusSound; snd_alias_list_t* focusSound;
float special; float special;
int cursorPos[4]; int cursorPos[1];
itemDefData_t typeData; itemDefData_t typeData;
int floatExpressionCount; int floatExpressionCount;
ItemFloatExpression* floatExpressions; ItemFloatExpression* floatExpressions;
@ -2910,7 +2987,7 @@ namespace IW5
menuData_t* data; menuData_t* data;
windowDef_t window; windowDef_t window;
int itemCount; int itemCount;
itemDef_t** items; itemDef_s** items;
}; };
struct LocalizeEntry struct LocalizeEntry
@ -3255,6 +3332,17 @@ namespace IW5
WEAPPROJEXP_NUM WEAPPROJEXP_NUM
}; };
struct snd_alias_list_name
{
const char* soundName;
};
union SndAliasCustom
{
snd_alias_list_name* name;
snd_alias_list_t* sound;
};
struct AttProjectile struct AttProjectile
{ {
int explosionRadius; int explosionRadius;
@ -3269,9 +3357,9 @@ namespace IW5
weapProjExposion_t projExplosionType; weapProjExposion_t projExplosionType;
FxEffectDef* projExplosionEffect; FxEffectDef* projExplosionEffect;
bool projExplosionEffectForceNormalUp; bool projExplosionEffectForceNormalUp;
snd_alias_list_t* projExplosionSound; SndAliasCustom projExplosionSound;
FxEffectDef* projDudEffect; FxEffectDef* projDudEffect;
snd_alias_list_t* projDudSound; SndAliasCustom projDudSound;
bool projImpactExplode; bool projImpactExplode;
float destabilizationRateTime; float destabilizationRateTime;
float destabilizationCurvatureMax; float destabilizationCurvatureMax;
@ -3279,7 +3367,7 @@ namespace IW5
FxEffectDef* projTrailEffect; FxEffectDef* projTrailEffect;
int projIgnitionDelay; int projIgnitionDelay;
FxEffectDef* projIgnitionEffect; FxEffectDef* projIgnitionEffect;
snd_alias_list_t* projIgnitionSound; SndAliasCustom projIgnitionSound;
}; };
struct WeaponAttachment struct WeaponAttachment
@ -3454,6 +3542,80 @@ namespace IW5
MISSILE_GUIDANCE_COUNT MISSILE_GUIDANCE_COUNT
}; };
enum weapAnimFiles_t
{
WEAP_ANIM_ROOT = 0x0,
WEAP_ANIM_IDLE = 0x1,
WEAP_ANIM_EMPTY_IDLE = 0x2,
WEAP_ANIM_FIRE = 0x3,
WEAP_ANIM_HOLD_FIRE = 0x4,
WEAP_ANIM_LASTSHOT = 0x5,
WEAP_ANIM_RECHAMBER = 0x6,
WEAP_ANIM_MELEE = 0x7,
WEAP_ANIM_MELEE_CHARGE = 0x8,
WEAP_ANIM_RELOAD = 0x9,
WEAP_ANIM_RELOAD_EMPTY = 0xA,
WEAP_ANIM_RELOAD_START = 0xB,
WEAP_ANIM_RELOAD_END = 0xC,
WEAP_ANIM_RAISE = 0xD,
WEAP_ANIM_FIRST_RAISE = 0xE,
WEAP_ANIM_BREACH_RAISE = 0xF,
WEAP_ANIM_DROP = 0x10,
WEAP_ANIM_ALT_RAISE = 0x11,
WEAP_ANIM_ALT_DROP = 0x12,
WEAP_ANIM_QUICK_RAISE = 0x13,
WEAP_ANIM_QUICK_DROP = 0x14,
WEAP_ANIM_EMPTY_RAISE = 0x15,
WEAP_ANIM_EMPTY_DROP = 0x16,
WEAP_ANIM_SPRINT_IN = 0x17,
WEAP_ANIM_SPRINT_LOOP = 0x18,
WEAP_ANIM_SPRINT_OUT = 0x19,
WEAP_ANIM_STUNNED_START = 0x1A,
WEAP_ANIM_STUNNED_LOOP = 0x1B,
WEAP_ANIM_STUNNED_END = 0x1C,
WEAP_ANIM_DETONATE = 0x1D,
WEAP_ANIM_NIGHTVISION_WEAR = 0x1E,
WEAP_ANIM_NIGHTVISION_REMOVE = 0x1F,
WEAP_ANIM_ADS_FIRE = 0x20,
WEAP_ANIM_ADS_LASTSHOT = 0x21,
WEAP_ANIM_ADS_RECHAMBER = 0x22,
WEAP_ANIM_BLAST_FRONT = 0x23,
WEAP_ANIM_BLAST_RIGHT = 0x24,
WEAP_ANIM_BLAST_BACK = 0x25,
WEAP_ANIM_BLAST_LEFT = 0x26,
WEAP_ANIM_ADS_UP = 0x27,
WEAP_ANIM_ADS_DOWN = 0x28,
WEAP_ALT_ANIM_ADJUST = 0x29,
NUM_WEAP_ANIMS
};
enum hitLocation_t
{
HITLOC_NONE = 0x0,
HITLOC_HELMET = 0x1,
HITLOC_HEAD = 0x2,
HITLOC_NECK = 0x3,
HITLOC_TORSO_UPR = 0x4,
HITLOC_TORSO_LWR = 0x5,
HITLOC_R_ARM_UPR = 0x6,
HITLOC_L_ARM_UPR = 0x7,
HITLOC_R_ARM_LWR = 0x8,
HITLOC_L_ARM_LWR = 0x9,
HITLOC_R_HAND = 0xA,
HITLOC_L_HAND = 0xB,
HITLOC_R_LEG_UPR = 0xC,
HITLOC_L_LEG_UPR = 0xD,
HITLOC_R_LEG_LWR = 0xE,
HITLOC_L_LEG_LWR = 0xF,
HITLOC_R_FOOT = 0x10,
HITLOC_L_FOOT = 0x11,
HITLOC_GUN = 0x12,
HITLOC_SHIELD = 0x13,
HITLOC_NUM
};
struct WeaponDef struct WeaponDef
{ {
const char* szOverlayName; const char* szOverlayName;
@ -3462,10 +3624,10 @@ namespace IW5
const char** szXAnimsRightHanded; const char** szXAnimsRightHanded;
const char** szXAnimsLeftHanded; const char** szXAnimsLeftHanded;
const char* szModeName; const char* szModeName;
unsigned short* notetrackSoundMapKeys; ScriptString* notetrackSoundMapKeys;
unsigned short* notetrackSoundMapValues; ScriptString* notetrackSoundMapValues;
unsigned short* notetrackRumbleMapKeys; ScriptString* notetrackRumbleMapKeys;
unsigned short* notetrackRumbleMapValues; ScriptString* notetrackRumbleMapValues;
int playerAnimType; int playerAnimType;
weapType_t weapType; weapType_t weapType;
weapClass_t weapClass; weapClass_t weapClass;
@ -3476,56 +3638,56 @@ namespace IW5
weapStance_t stance; weapStance_t stance;
FxEffectDef* viewFlashEffect; FxEffectDef* viewFlashEffect;
FxEffectDef* worldFlashEffect; FxEffectDef* worldFlashEffect;
snd_alias_list_t* pickupSound; SndAliasCustom pickupSound;
snd_alias_list_t* pickupSoundPlayer; SndAliasCustom pickupSoundPlayer;
snd_alias_list_t* ammoPickupSound; SndAliasCustom ammoPickupSound;
snd_alias_list_t* ammoPickupSoundPlayer; SndAliasCustom ammoPickupSoundPlayer;
snd_alias_list_t* projectileSound; SndAliasCustom projectileSound;
snd_alias_list_t* pullbackSound; SndAliasCustom pullbackSound;
snd_alias_list_t* pullbackSoundPlayer; SndAliasCustom pullbackSoundPlayer;
snd_alias_list_t* fireSound; SndAliasCustom fireSound;
snd_alias_list_t* fireSoundPlayer; SndAliasCustom fireSoundPlayer;
snd_alias_list_t* fireSoundPlayerAkimbo; SndAliasCustom fireSoundPlayerAkimbo;
snd_alias_list_t* fireLoopSound; SndAliasCustom fireLoopSound;
snd_alias_list_t* fireLoopSoundPlayer; SndAliasCustom fireLoopSoundPlayer;
snd_alias_list_t* fireStopSound; SndAliasCustom fireStopSound;
snd_alias_list_t* fireStopSoundPlayer; SndAliasCustom fireStopSoundPlayer;
snd_alias_list_t* fireLastSound; SndAliasCustom fireLastSound;
snd_alias_list_t* fireLastSoundPlayer; SndAliasCustom fireLastSoundPlayer;
snd_alias_list_t* emptyFireSound; SndAliasCustom emptyFireSound;
snd_alias_list_t* emptyFireSoundPlayer; SndAliasCustom emptyFireSoundPlayer;
snd_alias_list_t* meleeSwipeSound; SndAliasCustom meleeSwipeSound;
snd_alias_list_t* meleeSwipeSoundPlayer; SndAliasCustom meleeSwipeSoundPlayer;
snd_alias_list_t* meleeHitSound; SndAliasCustom meleeHitSound;
snd_alias_list_t* meleeMissSound; SndAliasCustom meleeMissSound;
snd_alias_list_t* rechamberSound; SndAliasCustom rechamberSound;
snd_alias_list_t* rechamberSoundPlayer; SndAliasCustom rechamberSoundPlayer;
snd_alias_list_t* reloadSound; SndAliasCustom reloadSound;
snd_alias_list_t* reloadSoundPlayer; SndAliasCustom reloadSoundPlayer;
snd_alias_list_t* reloadEmptySound; SndAliasCustom reloadEmptySound;
snd_alias_list_t* reloadEmptySoundPlayer; SndAliasCustom reloadEmptySoundPlayer;
snd_alias_list_t* reloadStartSound; SndAliasCustom reloadStartSound;
snd_alias_list_t* reloadStartSoundPlayer; SndAliasCustom reloadStartSoundPlayer;
snd_alias_list_t* reloadEndSound; SndAliasCustom reloadEndSound;
snd_alias_list_t* reloadEndSoundPlayer; SndAliasCustom reloadEndSoundPlayer;
snd_alias_list_t* detonateSound; SndAliasCustom detonateSound;
snd_alias_list_t* detonateSoundPlayer; SndAliasCustom detonateSoundPlayer;
snd_alias_list_t* nightVisionWearSound; SndAliasCustom nightVisionWearSound;
snd_alias_list_t* nightVisionWearSoundPlayer; SndAliasCustom nightVisionWearSoundPlayer;
snd_alias_list_t* nightVisionRemoveSound; SndAliasCustom nightVisionRemoveSound;
snd_alias_list_t* nightVisionRemoveSoundPlayer; SndAliasCustom nightVisionRemoveSoundPlayer;
snd_alias_list_t* altSwitchSound; SndAliasCustom altSwitchSound;
snd_alias_list_t* altSwitchSoundPlayer; SndAliasCustom altSwitchSoundPlayer;
snd_alias_list_t* raiseSound; SndAliasCustom raiseSound;
snd_alias_list_t* raiseSoundPlayer; SndAliasCustom raiseSoundPlayer;
snd_alias_list_t* firstRaiseSound; SndAliasCustom firstRaiseSound;
snd_alias_list_t* firstRaiseSoundPlayer; SndAliasCustom firstRaiseSoundPlayer;
snd_alias_list_t* putawaySound; SndAliasCustom putawaySound;
snd_alias_list_t* putawaySoundPlayer; SndAliasCustom putawaySoundPlayer;
snd_alias_list_t* scanSound; SndAliasCustom scanSound;
snd_alias_list_t* changeVariableZoomSound; SndAliasCustom changeVariableZoomSound;
snd_alias_list_t** bounceSound; SndAliasCustom* bounceSound;
snd_alias_list_t** rollingSound; SndAliasCustom* rollingSound;
FxEffectDef* viewShellEjectEffect; FxEffectDef* viewShellEjectEffect;
FxEffectDef* worldShellEjectEffect; FxEffectDef* worldShellEjectEffect;
FxEffectDef* viewLastShotEjectEffect; FxEffectDef* viewLastShotEjectEffect;
@ -3662,8 +3824,8 @@ namespace IW5
weapProjExposion_t projExplosion; weapProjExposion_t projExplosion;
FxEffectDef* projExplosionEffect; FxEffectDef* projExplosionEffect;
FxEffectDef* projDudEffect; FxEffectDef* projDudEffect;
snd_alias_list_t* projExplosionSound; SndAliasCustom projExplosionSound;
snd_alias_list_t* projDudSound; SndAliasCustom projDudSound;
WeapStickinessType stickiness; WeapStickinessType stickiness;
float lowAmmoWarningThreshold; float lowAmmoWarningThreshold;
float ricochetChance; float ricochetChance;
@ -3679,7 +3841,7 @@ namespace IW5
float maxSteeringAccel; float maxSteeringAccel;
int projIgnitionDelay; int projIgnitionDelay;
FxEffectDef* projIgnitionEffect; FxEffectDef* projIgnitionEffect;
snd_alias_list_t* projIgnitionSound; SndAliasCustom projIgnitionSound;
float fAdsAimPitch; float fAdsAimPitch;
float fAdsCrosshairInFrac; float fAdsCrosshairInFrac;
float fAdsCrosshairOutFrac; float fAdsCrosshairOutFrac;
@ -3718,8 +3880,14 @@ namespace IW5
float fHipViewScatterMax; float fHipViewScatterMax;
float fightDist; float fightDist;
float maxDist; float maxDist;
const char* accuracyGraphName[2]; // const char* accuracyGraphName[2];// TODO: Order is accuracyGraphName[0] -> originalAccuracyGraphKnots[0] -> accuracyGraphName[1] -> ...
float(*originalAccuracyGraphKnots[2])[2]; // Which is currently not possible to do in code generation. Afaik this is the only place where this is the case.
// So might be something to fix but on the other hand it might be too much work for this little inconvenience.
// vec2_t* originalAccuracyGraphKnots[2];
const char* accuracyGraphName0;
const char* accuracyGraphName1;
vec2_t* originalAccuracyGraphKnots0;
vec2_t* originalAccuracyGraphKnots1;
unsigned short originalAccuracyGraphKnotCount[2]; unsigned short originalAccuracyGraphKnotCount[2];
int iPositionReloadTransTime; int iPositionReloadTransTime;
float leftArc; float leftArc;
@ -3769,17 +3937,17 @@ namespace IW5
float turretOverheatUpRate; float turretOverheatUpRate;
float turretOverheatDownRate; float turretOverheatDownRate;
float turretOverheatPenalty; float turretOverheatPenalty;
snd_alias_list_t* turretOverheatSound; SndAliasCustom turretOverheatSound;
FxEffectDef* turretOverheatEffect; FxEffectDef* turretOverheatEffect;
const char* turretBarrelSpinRumble; const char* turretBarrelSpinRumble;
float turretBarrelSpinSpeed; float turretBarrelSpinSpeed;
float turretBarrelSpinUpTime; float turretBarrelSpinUpTime;
float turretBarrelSpinDownTime; float turretBarrelSpinDownTime;
snd_alias_list_t* turretBarrelSpinMaxSnd; SndAliasCustom turretBarrelSpinMaxSnd;
snd_alias_list_t* turretBarrelSpinUpSnd[4]; SndAliasCustom turretBarrelSpinUpSnd[4];
snd_alias_list_t* turretBarrelSpinDownSnd[4]; SndAliasCustom turretBarrelSpinDownSnd[4];
snd_alias_list_t* missileConeSoundAlias; SndAliasCustom missileConeSoundAlias;
snd_alias_list_t* missileConeSoundAliasAtBase; SndAliasCustom missileConeSoundAliasAtBase;
float missileConeSoundRadiusAtTop; float missileConeSoundRadiusAtTop;
float missileConeSoundRadiusAtBase; float missileConeSoundRadiusAtBase;
float missileConeSoundHeight; float missileConeSoundHeight;
@ -3845,7 +4013,7 @@ namespace IW5
bool missileConeSoundCrossfadeEnabled; bool missileConeSoundCrossfadeEnabled;
bool offhandHoldIsCancelable; bool offhandHoldIsCancelable;
bool doNotAllowAttachmentsToOverrideSpread; bool doNotAllowAttachmentsToOverrideSpread;
unsigned short stowTag; ScriptString stowTag;
XModel* stowOffsetModel; XModel* stowOffsetModel;
}; };
@ -3864,8 +4032,8 @@ namespace IW5
{ {
unsigned short attachment1; unsigned short attachment1;
unsigned short attachment2; unsigned short attachment2;
snd_alias_list_t* overrideSound; SndAliasCustom overrideSound;
snd_alias_list_t* altmodeSound; SndAliasCustom altmodeSound;
unsigned int soundType; unsigned int soundType;
}; };
@ -3888,8 +4056,8 @@ namespace IW5
struct NoteTrackToSoundEntry struct NoteTrackToSoundEntry
{ {
int attachment; int attachment;
unsigned short* notetrackSoundMapKeys; ScriptString* notetrackSoundMapKeys;
unsigned short* notetrackSoundMapValues; ScriptString* notetrackSoundMapValues;
}; };
struct WeaponCompleteDef struct WeaponCompleteDef
@ -3897,7 +4065,7 @@ namespace IW5
const char* szInternalName; const char* szInternalName;
WeaponDef* weapDef; WeaponDef* weapDef;
const char* szDisplayName; const char* szDisplayName;
unsigned short* hideTags; ScriptString* hideTags;
WeaponAttachment** scopes; WeaponAttachment** scopes;
WeaponAttachment** underBarrels; WeaponAttachment** underBarrels;
WeaponAttachment** others; WeaponAttachment** others;
@ -3937,7 +4105,7 @@ namespace IW5
float adsDofStart; float adsDofStart;
float adsDofEnd; float adsDofEnd;
unsigned short accuracyGraphKnotCount[2]; unsigned short accuracyGraphKnotCount[2];
float(*accuracyGraphKnots[2])[2]; vec2_t* accuracyGraphKnots[2];
bool motionTracker; bool motionTracker;
bool enhanced; bool enhanced;
bool dpadIconShowsAmmo; bool dpadIconShowsAmmo;
@ -4096,7 +4264,27 @@ namespace IW5
FxTrailDef* trailDef; FxTrailDef* trailDef;
FxSparkFountainDef* sparkFountainDef; FxSparkFountainDef* sparkFountainDef;
FxSpotLightDef* spotLightDef; FxSpotLightDef* spotLightDef;
void* unknownDef; char* unknownDef;
};
enum FxElemType
{
FX_ELEM_TYPE_SPRITE_BILLBOARD = 0x0,
FX_ELEM_TYPE_SPRITE_ORIENTED = 0x1,
FX_ELEM_TYPE_TAIL = 0x2,
FX_ELEM_TYPE_TRAIL = 0x3,
FX_ELEM_TYPE_CLOUD = 0x4,
FX_ELEM_TYPE_SPARK_CLOUD = 0x5,
FX_ELEM_TYPE_SPARK_FOUNTAIN = 0x6,
FX_ELEM_TYPE_MODEL = 0x7,
FX_ELEM_TYPE_OMNI_LIGHT = 0x8,
FX_ELEM_TYPE_SPOT_LIGHT = 0x9,
FX_ELEM_TYPE_SOUND = 0xA,
FX_ELEM_TYPE_DECAL = 0xB,
FX_ELEM_TYPE_RUNNER = 0xC,
FX_ELEM_TYPE_COUNT = 0xD,
FX_ELEM_TYPE_LAST_SPRITE = 0x3,
FX_ELEM_TYPE_LAST_DRAWN = 0x9
}; };
struct FxElemDef struct FxElemDef
@ -4178,18 +4366,12 @@ namespace IW5
SurfaceFxEntry* table; SurfaceFxEntry* table;
}; };
union RawFileBuffer
{
const char* compressedBuffer;
const char* buffer;
};
struct RawFile struct RawFile
{ {
const char* name; const char* name;
int compressedLen; int compressedLen;
int len; int len;
RawFileBuffer data; const char* buffer;
}; };
struct ScriptFile struct ScriptFile
@ -4598,14 +4780,14 @@ namespace IW5
float turretVertResistUp; float turretVertResistUp;
float turretVertResistDown; float turretVertResistDown;
float turretRotRate; float turretRotRate;
snd_alias_list_t* turretSpinSnd; SndAliasCustom turretSpinSnd;
snd_alias_list_t* turretStopSnd; SndAliasCustom turretStopSnd;
int trophyEnabled; int trophyEnabled;
float trophyRadius; float trophyRadius;
float trophyInactiveRadius; float trophyInactiveRadius;
int trophyAmmoCount; int trophyAmmoCount;
float trophyReloadTime; float trophyReloadTime;
unsigned short trophyTags[4]; ScriptString trophyTags[4];
FxEffectDef* trophyExplodeFx; FxEffectDef* trophyExplodeFx;
FxEffectDef* trophyFlashFx; FxEffectDef* trophyFlashFx;
Material* compassFriendlyIcon; Material* compassFriendlyIcon;
@ -4614,45 +4796,53 @@ namespace IW5
Material* compassEnemyAltIcon; Material* compassEnemyAltIcon;
int compassIconWidth; int compassIconWidth;
int compassIconHeight; int compassIconHeight;
snd_alias_list_t* idleLowSnd; SndAliasCustom idleLowSnd;
snd_alias_list_t* idleHighSnd; SndAliasCustom idleHighSnd;
snd_alias_list_t* engineLowSnd; SndAliasCustom engineLowSnd;
snd_alias_list_t* engineHighSnd; SndAliasCustom engineHighSnd;
float engineSndSpeed; float engineSndSpeed;
unsigned short audioOriginTag; ScriptString audioOriginTag;
snd_alias_list_t* idleLowSndAlt; SndAliasCustom idleLowSndAlt;
snd_alias_list_t* idleHighSndAlt; SndAliasCustom idleHighSndAlt;
snd_alias_list_t* engineLowSndAlt; SndAliasCustom engineLowSndAlt;
snd_alias_list_t* engineHighSndAlt; SndAliasCustom engineHighSndAlt;
float engineSndSpeedAlt; float engineSndSpeedAlt;
unsigned short audioOriginTagAlt; ScriptString audioOriginTagAlt;
snd_alias_list_t* turretSpinSndAlt; SndAliasCustom turretSpinSndAlt;
snd_alias_list_t* turretStopSndAlt; SndAliasCustom turretStopSndAlt;
snd_alias_list_t* engineStartUpSnd; SndAliasCustom engineStartUpSnd;
int engineStartUpLength; int engineStartUpLength;
snd_alias_list_t* engineShutdownSnd; SndAliasCustom engineShutdownSnd;
snd_alias_list_t* engineIdleSnd; SndAliasCustom engineIdleSnd;
snd_alias_list_t* engineSustainSnd; SndAliasCustom engineSustainSnd;
snd_alias_list_t* engineRampUpSnd; SndAliasCustom engineRampUpSnd;
int engineRampUpLength; int engineRampUpLength;
snd_alias_list_t* engineRampDownSnd; SndAliasCustom engineRampDownSnd;
int engineRampDownLength; int engineRampDownLength;
snd_alias_list_t* suspensionSoftSnd; SndAliasCustom suspensionSoftSnd;
float suspensionSoftCompression; float suspensionSoftCompression;
snd_alias_list_t* suspensionHardSnd; SndAliasCustom suspensionHardSnd;
float suspensionHardCompression; float suspensionHardCompression;
snd_alias_list_t* collisionSnd; SndAliasCustom collisionSnd;
float collisionBlendSpeed; float collisionBlendSpeed;
snd_alias_list_t* speedSnd; SndAliasCustom speedSnd;
float speedSndBlendSpeed; float speedSndBlendSpeed;
const char* surfaceSndPrefix; const char* surfaceSndPrefix;
snd_alias_list_t* surfaceSnds[31]; SndAliasCustom surfaceSnds[31];
float surfaceSndBlendSpeed; float surfaceSndBlendSpeed;
float slideVolume; float slideVolume;
float slideBlendSpeed; float slideBlendSpeed;
float inAirPitch; float inAirPitch;
}; };
struct cmodel2_t
{
Bounds bounds;
float radius;
ClipInfo* info;
cLeaf_t leaf;
};
struct AddonMapEnts struct AddonMapEnts
{ {
const char* name; const char* name;
@ -4661,7 +4851,7 @@ namespace IW5
MapTriggers trigger; MapTriggers trigger;
ClipInfo* info; ClipInfo* info;
unsigned int numSubModels; unsigned int numSubModels;
cmodel_t* cmodels; cmodel2_t* cmodels;
GfxBrushModel* models; GfxBrushModel* models;
}; };

View File

@ -28,15 +28,15 @@ bool AssetLoaderRawFile::LoadFromRaw(const std::string& assetName, ISearchPath*
auto* rawFile = memory->Create<RawFile>(); auto* rawFile = memory->Create<RawFile>();
rawFile->name = memory->Dup(assetName.c_str()); rawFile->name = memory->Dup(assetName.c_str());
rawFile->len = static_cast<int>(file.m_length); rawFile->compressedLen = static_cast<int>(file.m_length + 1);
auto* fileBuffer = static_cast<char*>(memory->Alloc(static_cast<size_t>(file.m_length + 1))); auto* fileBuffer = static_cast<char*>(memory->Alloc(static_cast<size_t>(file.m_length + 1)));
file.m_stream->read(fileBuffer, file.m_length); file.m_stream->read(fileBuffer, file.m_length);
if (file.m_stream->gcount() != file.m_length) if (file.m_stream->gcount() != file.m_length)
return false; return false;
fileBuffer[rawFile->len] = '\0'; fileBuffer[file.m_length] = '\0';
rawFile->data.buffer = fileBuffer; rawFile->buffer = fileBuffer;
manager->AddAsset(ASSET_TYPE_RAWFILE, assetName, rawFile); manager->AddAsset(ASSET_TYPE_RAWFILE, assetName, rawFile);
return true; return true;

View File

@ -40,7 +40,7 @@ void AssetDumperRawFile::DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFil
throw std::runtime_error("Initializing inflate failed"); throw std::runtime_error("Initializing inflate failed");
} }
zs.next_in = reinterpret_cast<const Bytef*>(rawFile->data.compressedBuffer); zs.next_in = reinterpret_cast<const Bytef*>(rawFile->buffer);
zs.avail_in = rawFile->compressedLen; zs.avail_in = rawFile->compressedLen;
Bytef buffer[0x1000]; Bytef buffer[0x1000];
@ -65,6 +65,6 @@ void AssetDumperRawFile::DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFil
} }
else if (rawFile->len > 0) else if (rawFile->len > 0)
{ {
stream.write(rawFile->data.buffer, rawFile->len); stream.write(rawFile->buffer, rawFile->len);
} }
} }

View File

@ -85,18 +85,6 @@ void InfoStringFromStructConverter::FillFromBaseField(const cspField_t& field)
break; break;
} }
case CSPFT_PHYS_COLLMAP:
{
const auto* physCollMap = *reinterpret_cast<PhysCollmap**>(reinterpret_cast<uintptr_t>(m_structure) + field.
iOffset);
if (physCollMap)
m_info_string.SetValueForKey(std::string(field.szName), std::string(AssetName(physCollMap->name)));
else
m_info_string.SetValueForKey(std::string(field.szName), "");
break;
}
case CSPFT_SOUND: case CSPFT_SOUND:
{ {
const auto* sndAlias = reinterpret_cast<SndAliasCustom*>(reinterpret_cast<uintptr_t>(m_structure) + field. const auto* sndAlias = reinterpret_cast<SndAliasCustom*>(reinterpret_cast<uintptr_t>(m_structure) + field.

View File

@ -51,6 +51,8 @@ block runtime XFILE_BLOCK_RUNTIME default;
block normal XFILE_BLOCK_VIRTUAL default; block normal XFILE_BLOCK_VIRTUAL default;
block normal XFILE_BLOCK_LARGE; block normal XFILE_BLOCK_LARGE;
block normal XFILE_BLOCK_CALLBACK; block normal XFILE_BLOCK_CALLBACK;
block normal XFILE_BLOCK_VERTEX;
block normal XFILE_BLOCK_INDEX;
block normal XFILE_BLOCK_SCRIPT; block normal XFILE_BLOCK_SCRIPT;
#include "XAssets/PhysPreset.txt" #include "XAssets/PhysPreset.txt"

View File

@ -6,3 +6,13 @@ set block XFILE_BLOCK_TEMP;
set string name; set string name;
set name name; set name name;
set count entityString numEntityChars; set count entityString numEntityChars;
// MapTriggers
// see MapEnts
// ClipInfo
// see clipMap_t
// cmodel2_t
use cmodel2_t;
set reusable info;

View File

@ -43,6 +43,7 @@ set string name;
use FxElemExtendedDefPtr; use FxElemExtendedDefPtr;
set condition trailDef FxElemDef::elemType == FX_ELEM_TYPE_TRAIL; set condition trailDef FxElemDef::elemType == FX_ELEM_TYPE_TRAIL;
set condition sparkFountainDef FxElemDef::elemType == FX_ELEM_TYPE_SPARK_FOUNTAIN; set condition sparkFountainDef FxElemDef::elemType == FX_ELEM_TYPE_SPARK_FOUNTAIN;
set condition spotLightDef FxElemDef::elemType == FX_ELEM_TYPE_SPOT_LIGHT;
// FxTrailDef // FxTrailDef
use FxTrailDef; use FxTrailDef;

View File

@ -57,6 +57,7 @@ set count smodelIndexes smodelIndexCount;
use GfxCell; use GfxCell;
set count portals portalCount; set count portals portalCount;
set count reflectionProbes reflectionProbeCount; set count reflectionProbes reflectionProbeCount;
set count reflectionProbeReferences reflectionProbeReferenceCount;
// GfxPortal // GfxPortal
use GfxPortal; use GfxPortal;
@ -69,6 +70,7 @@ set count reflectionProbes reflectionProbeCount;
set count reflectionProbeOrigins reflectionProbeCount; set count reflectionProbeOrigins reflectionProbeCount;
set block reflectionProbeTextures XFILE_BLOCK_RUNTIME; set block reflectionProbeTextures XFILE_BLOCK_RUNTIME;
set count reflectionProbeTextures reflectionProbeCount; set count reflectionProbeTextures reflectionProbeCount;
set count reflectionProbeReferences reflectionProbeReferenceCount;
set count lightmaps lightmapCount; set count lightmaps lightmapCount;
set block lightmapPrimaryTextures XFILE_BLOCK_RUNTIME; set block lightmapPrimaryTextures XFILE_BLOCK_RUNTIME;
set count lightmapPrimaryTextures lightmapCount; set count lightmapPrimaryTextures lightmapCount;

View File

@ -5,3 +5,13 @@ use GlassWorld;
set block XFILE_BLOCK_TEMP; set block XFILE_BLOCK_TEMP;
set string name; set string name;
set name name; set name name;
// G_GlassData
use G_GlassData;
set count glassPieces pieceCount;
set count glassNames glassNameCount;
// G_GlassName
use G_GlassName;
set string nameStr;
set count pieceIndices pieceCount;

View File

@ -6,13 +6,9 @@ set block XFILE_BLOCK_TEMP;
set string name; set string name;
set name name; set name name;
set count entityString numEntityChars; set count entityString numEntityChars;
set count stages stageCount;
// MapTriggers // MapTriggers
use MapTriggers; use MapTriggers;
set count models count; set count models count;
set count hulls hullCount; set count hulls hullCount;
set count slabs slabCount; set count slabs slabCount;
// Stage
set string Stage::name;

View File

@ -11,6 +11,7 @@ set reusable constantTable;
set count constantTable constantCount; set count constantTable constantCount;
set reusable stateBitsTable; set reusable stateBitsTable;
set count stateBitsTable stateBitsCount; set count stateBitsTable stateBitsCount;
set condition subMaterials never;
// MaterialTextureDef // MaterialTextureDef
use MaterialTextureDef; use MaterialTextureDef;

View File

@ -5,3 +5,31 @@ use PathData;
set block XFILE_BLOCK_TEMP; set block XFILE_BLOCK_TEMP;
set string name; set string name;
set name name; set name name;
set count nodes nodeCount;
set block basenodes XFILE_BLOCK_RUNTIME;
set count basenodes nodeCount;
set count chainNodeForNode nodeCount;
set count nodeForChainNode nodeCount;
set count pathVis visBytes;
set count nodeTree nodeTreeCount;
// pathnode_t
set condition pathnode_t::dynamic never;
set condition pathnode_t::transient never;
// pathnode_constant_t
use pathnode_constant_t;
set scriptstring targetname;
set scriptstring script_linkName;
set scriptstring script_noteworthy;
set scriptstring target;
set scriptstring animscript;
set count Links totalLinkCount;
// pathnode_tree_t
use pathnode_tree_t;
set condition u::child axis >= 0;
set reusable u::child;
// pathnode_tree_nodes_t
set count pathnode_tree_nodes_t::nodes nodeCount;

View File

@ -5,6 +5,4 @@ use RawFile;
set block XFILE_BLOCK_TEMP; set block XFILE_BLOCK_TEMP;
set string name; set string name;
set name name; set name name;
set condition data::compressedBuffer compressedLen > 0; set count buffer compressedLen;
set count data::compressedBuffer compressedLen;
set count data::buffer len + 1;

View File

@ -5,3 +5,7 @@ use ScriptFile;
set block XFILE_BLOCK_TEMP; set block XFILE_BLOCK_TEMP;
set string name; set string name;
set name name; set name name;
set block buffer XFILE_BLOCK_SCRIPT;
set count buffer compressedLen;
set block bytecode XFILE_BLOCK_SCRIPT;
set count bytecode bytecodeLen;

View File

@ -5,3 +5,4 @@ use SurfaceFxTable;
set block XFILE_BLOCK_TEMP; set block XFILE_BLOCK_TEMP;
set string name; set string name;
set name name; set name name;
set count table 6;

View File

@ -8,6 +8,8 @@ set name name;
set string useHintString; set string useHintString;
set string turretWeaponName; set string turretWeaponName;
set scriptstring trophyTags; set scriptstring trophyTags;
set scriptstring audioOriginTag;
set scriptstring audioOriginTagAlt;
set string surfaceSndPrefix; set string surfaceSndPrefix;
// VehiclePhysDef // VehiclePhysDef

View File

@ -5,3 +5,17 @@ use VehicleTrack;
set block XFILE_BLOCK_TEMP; set block XFILE_BLOCK_TEMP;
set string name; set string name;
set name name; set name name;
set reusable segments;
set count segments segmentCount;
// VehicleTrackSegment
use VehicleTrackSegment;
set string targetName;
set count sectors sectorCount;
set reusable nextBranches;
set count nextBranches nextBranchesCount;
set reusable prevBranches;
set count prevBranches prevBranchesCount;
// VehicleTrackSector
set count VehicleTrackSector::obstacles obstacleCount;

View File

@ -3,5 +3,17 @@
// ========================================= // =========================================
use WeaponAttachment; use WeaponAttachment;
set block XFILE_BLOCK_TEMP; set block XFILE_BLOCK_TEMP;
set string name; set string szInternalName;
set name name; set name szInternalName;
set string szDisplayName;
set reusable worldModels;
set count worldModels 16;
set reusable viewModels;
set count viewModels 16;
set reusable reticleViewModels;
set count reticleViewModels 8;
// AttRumbles
use AttRumbles;
set string fireRumble;
set string meleeImpactRumble;

View File

@ -10,14 +10,44 @@ set string szDisplayName;
set reusable hideTags; set reusable hideTags;
set scriptstring hideTags; set scriptstring hideTags;
set count hideTags 32; set count hideTags 32;
set reusable scopes;
set count scopes 6;
set reusable underBarrels;
set count underBarrels 3;
set reusable others;
set count others 4;
set string szXAnims; set string szXAnims;
set reusable szXAnims; set reusable szXAnims;
set count szXAnims 37; set count szXAnims NUM_WEAP_ANIMS;
set reusable animOverrides;
set count animOverrides numAnimOverrides;
set reusable soundOverrides;
set count soundOverrides numSoundOverrides;
set reusable fxOverrides;
set count fxOverrides numFXOverrides;
set reusable reloadOverrides;
set count reloadOverrides numReloadStateTimerOverrides;
set reusable notetrackOverrides;
set count notetrackOverrides numNotetrackOverrides;
set string szAltWeaponName; set string szAltWeaponName;
set reusable accuracyGraphKnots; set reusable accuracyGraphKnots;
set count accuracyGraphKnots[0] accuracyGraphKnotCount[0]; set count accuracyGraphKnots[0] accuracyGraphKnotCount[0];
set count accuracyGraphKnots[1] accuracyGraphKnotCount[1]; set count accuracyGraphKnots[1] accuracyGraphKnotCount[1];
// AnimOverrideEntry
use AnimOverrideEntry;
set string overrideAnim;
set string altmodeAnim;
// NoteTrackToSoundEntry
use NoteTrackToSoundEntry;
set reusable notetrackSoundMapKeys;
set scriptstring notetrackSoundMapKeys;
set count notetrackSoundMapKeys 24;
set reusable notetrackSoundMapValues;
set scriptstring notetrackSoundMapValues;
set count notetrackSoundMapValues 24;
// WeaponDef // WeaponDef
use WeaponDef; use WeaponDef;
set string szOverlayName; set string szOverlayName;
@ -25,17 +55,17 @@ set reusable gunXModel;
set count gunXModel 16; set count gunXModel 16;
set reusable szXAnimsRightHanded; set reusable szXAnimsRightHanded;
set string szXAnimsRightHanded; set string szXAnimsRightHanded;
set count szXAnimsRightHanded 37; set count szXAnimsRightHanded NUM_WEAP_ANIMS;
set reusable szXAnimsLeftHanded; set reusable szXAnimsLeftHanded;
set string szXAnimsLeftHanded; set string szXAnimsLeftHanded;
set count szXAnimsLeftHanded 37; set count szXAnimsLeftHanded NUM_WEAP_ANIMS;
set string szModeName; set string szModeName;
set reusable notetrackSoundMapKeys; set reusable notetrackSoundMapKeys;
set scriptstring notetrackSoundMapKeys; set scriptstring notetrackSoundMapKeys;
set count notetrackSoundMapKeys 16; set count notetrackSoundMapKeys 24;
set reusable notetrackSoundMapValues; set reusable notetrackSoundMapValues;
set scriptstring notetrackSoundMapValues; set scriptstring notetrackSoundMapValues;
set count notetrackSoundMapValues 16; set count notetrackSoundMapValues 24;
set reusable notetrackRumbleMapKeys; set reusable notetrackRumbleMapKeys;
set scriptstring notetrackRumbleMapKeys; set scriptstring notetrackRumbleMapKeys;
set count notetrackRumbleMapKeys 16; set count notetrackRumbleMapKeys 16;
@ -44,6 +74,8 @@ set scriptstring notetrackRumbleMapValues;
set count notetrackRumbleMapValues 16; set count notetrackRumbleMapValues 16;
set reusable bounceSound; set reusable bounceSound;
set count bounceSound 31; set count bounceSound 31;
set reusable rollingSound;
set count rollingSound 31;
set reusable worldModel; set reusable worldModel;
set count worldModel 16; set count worldModel 16;
set string szAmmoName; set string szAmmoName;
@ -63,10 +95,11 @@ set string szUseHintString;
set string dropHintString; set string dropHintString;
set string szScript; set string szScript;
set reusable locationDamageMultipliers; set reusable locationDamageMultipliers;
set count locationDamageMultipliers 20; set count locationDamageMultipliers HITLOC_NUM;
set string fireRumble; set string fireRumble;
set string meleeImpactRumble; set string meleeImpactRumble;
set string turretBarrelSpinRumble; set string turretBarrelSpinRumble;
set scriptstring stowTag;
reorder: reorder:
... ...
accuracyGraphName0 accuracyGraphName0

View File

@ -24,49 +24,7 @@ set count boneInfo numBones;
// XModelLodInfo // XModelLodInfo
use XModelLodInfo; use XModelLodInfo;
set block modelSurfs XFILE_BLOCK_TEMP;
set action modelSurfs SetModelSurfs(XModelLodInfo, XModelSurfs);
set reusable modelSurfs;
set condition surfs never; set condition surfs never;
// XModelSurfs
use XModelSurfs;
set block XFILE_BLOCK_VIRTUAL;
set string name;
set count surfs XModelLodInfo::numsurfs; // No this is not a mistake. This is how the game does it.
// XSurface
use XSurface;
set reusable verts0;
set block verts0 XFILE_BLOCK_VERTEX;
set count verts0 vertCount;
set reusable vertList;
set count vertList vertListCount;
set reusable triIndices;
set block triIndices XFILE_BLOCK_INDEX;
set count triIndices triCount;
reorder:
zoneHandle
vertInfo
verts0
vertList
triIndices;
// XSurfaceVertexInfo
use XSurfaceVertexInfo;
set reusable vertsBlend;
set count vertsBlend vertCount[0]
+ 3 * vertCount[1]
+ 5 * vertCount[2]
+ 7 * vertCount[3];
// XRigidVertList
set reusable XRigidVertList::collisionTree;
// XSurfaceCollisionTree
use XSurfaceCollisionTree;
set count nodes nodeCount;
set count leafs leafCount;
// XModelCollSurf_s // XModelCollSurf_s
set count XModelCollSurf_s::collTris numCollTris; set count XModelCollSurf_s::collTris numCollTris;

View File

@ -5,3 +5,43 @@ use XModelSurfs;
set block XFILE_BLOCK_TEMP; set block XFILE_BLOCK_TEMP;
set string name; set string name;
set name name; set name name;
set count surfs numsurfs;
// XSurface
use XSurface;
set reusable vertList;
set count vertList vertListCount;
set reusable triIndices;
set block triIndices XFILE_BLOCK_INDEX;
set count triIndices triCount;
reorder:
zoneHandle
vertInfo
verts0
vertList
triIndices;
// XSurfaceVertexInfo
use XSurfaceVertexInfo;
set reusable vertsBlend;
set count vertsBlend vertCount[0]
+ 3 * vertCount[1]
+ 5 * vertCount[2]
+ 7 * vertCount[3];
// GfxVertexUnion0
use GfxVertexUnion0;
set condition quantizedNoColorVerts0 never;
set condition quantizedVerts0 never;
set condition verts0 never;
set reusable packedVerts0;
set block packedVerts0 XFILE_BLOCK_VERTEX;
set count packedVerts0 XSurface::vertCount;
// XRigidVertList
set reusable XRigidVertList::collisionTree;
// XSurfaceCollisionTree
use XSurfaceCollisionTree;
set count nodes nodeCount;
set count leafs leafCount;

View File

@ -5,17 +5,11 @@ use clipMap_t;
set block XFILE_BLOCK_TEMP; set block XFILE_BLOCK_TEMP;
set string name; set string name;
set name name; set name name;
set reusable planes; set block pInfo XFILE_BLOCK_TEMP;
set count planes planeCount; set reusable pInfo;
set count staticModelList numStaticModels; set count staticModelList numStaticModels;
set count materials numMaterials;
set count brushsides numBrushSides;
set count brushEdges numBrushEdges;
set count nodes numNodes; set count nodes numNodes;
set count leafs numLeafs; set count leafs numLeafs;
set count leafbrushNodes leafbrushNodesCount;
set count leafbrushes numLeafBrushes;
set count leafsurfaces numLeafSurfaces;
set count verts vertCount; set count verts vertCount;
set count triIndices 3 * triCount; set count triIndices 3 * triCount;
set count triEdgeIsWalkable ((3 * triCount + 31) / 32) * 4; set count triEdgeIsWalkable ((3 * triCount + 31) / 32) * 4;
@ -23,10 +17,8 @@ set count borders borderCount;
set count partitions partitionCount; set count partitions partitionCount;
set count aabbTrees aabbTreeCount; set count aabbTrees aabbTreeCount;
set count cmodels numSubModels; set count cmodels numSubModels;
set count brushes numBrushes;
set count brushBounds numBrushes;
set count brushContents numBrushes;
set count smodelNodes smodelNodeCount; set count smodelNodes smodelNodeCount;
set count stages stageCount;
set count dynEntDefList[0] dynEntCount[0]; set count dynEntDefList[0] dynEntCount[0];
set count dynEntDefList[1] dynEntCount[1]; set count dynEntDefList[1] dynEntCount[1];
set block dynEntPoseList XFILE_BLOCK_RUNTIME; set block dynEntPoseList XFILE_BLOCK_RUNTIME;
@ -38,20 +30,34 @@ set count dynEntClientList[1] dynEntCount[1];
set block dynEntCollList XFILE_BLOCK_RUNTIME; set block dynEntCollList XFILE_BLOCK_RUNTIME;
set count dynEntCollList[0] dynEntCount[0]; set count dynEntCollList[0] dynEntCount[0];
set count dynEntCollList[1] dynEntCount[1]; set count dynEntCollList[1] dynEntCount[1];
reorder:
... // ClipInfo
leafs use ClipInfo;
leafbrushes set reusable planes;
leafbrushNodes; set count planes planeCount;
reorder: set reusable materials;
... set count materials numMaterials;
brushContents set reusable brushsides;
smodelNodes set count brushsides numBrushSides;
mapEnts; set reusable brushEdges;
set count brushEdges numBrushEdges;
set reusable leafbrushNodes;
set count leafbrushNodes leafbrushNodesCount;
set reusable leafbrushes;
set count leafbrushes numLeafBrushes;
set reusable brushes;
set count brushes numBrushes;
set reusable brushBounds;
set count brushBounds numBrushes;
set reusable brushContents;
set count brushContents numBrushes;
// ClipMaterial // ClipMaterial
set string ClipMaterial::name; set string ClipMaterial::name;
// cbrushside_t
// see PhysCollmap
// cNode_t // cNode_t
set reusable cNode_t::plane; set reusable cNode_t::plane;
@ -62,10 +68,15 @@ set reusable data::leaf::brushes;
set count data::leaf::brushes leafBrushCount; set count data::leaf::brushes leafBrushCount;
// CollisionPartition // CollisionPartition
use CollisionPartition; set reusable CollisionPartition::borders;
set reusable borders;
// cbrush_t // cbrush_t
use cbrush_t; use cbrush_t;
set reusable sides; set reusable sides;
set reusable baseAdjacentSide; set reusable baseAdjacentSide;
// Stage
set string Stage::name;
// DynEntityDef
set reusable DynEntityDef::hinge;

View File

@ -5,7 +5,16 @@ use menuDef_t;
set block XFILE_BLOCK_TEMP; set block XFILE_BLOCK_TEMP;
set string window::name; set string window::name;
set name window::name; set name window::name;
set string font; set count items itemCount;
// windowDef_t
use windowDef_t;
set string name;
set string group;
// menuData_t
use menuData_t;
set reusable expressionData;
set reusable visibleExp; set reusable visibleExp;
set string allowedBinding; set string allowedBinding;
set string soundName; set string soundName;
@ -15,32 +24,10 @@ set reusable rectWExp;
set reusable rectHExp; set reusable rectHExp;
set reusable openSoundExp; set reusable openSoundExp;
set reusable closeSoundExp; set reusable closeSoundExp;
set count items itemCount; set reusable soundLoopExp;
set reusable expressionData;
reorder: reorder:
expressionData expressionData
window onOpen;
font
onOpen
onClose
onCloseRequest
onESC
onKey
visibleExp
allowedBinding
soundName
rectXExp
rectYExp
rectWExp
rectHExp
openSoundExp
closeSoundExp
items;
// windowDef_t
use windowDef_t;
set string name;
set string group;
// MenuEventHandlerSet // MenuEventHandlerSet
set count MenuEventHandlerSet::eventHandlers eventHandlerCount; set count MenuEventHandlerSet::eventHandlers eventHandlerCount;
@ -72,7 +59,7 @@ set reusable expression;
use Statement_s; use Statement_s;
set count entries numEntries; set count entries numEntries;
set reusable supportingData; set reusable supportingData;
set condition lastResult never; set condition persistentState never;
// expressionEntry // expressionEntry
set condition expressionEntry::data::operand type == EET_OPERAND; set condition expressionEntry::data::operand type == EET_OPERAND;
@ -123,6 +110,9 @@ set condition enumDvarName itemDef_s::type == 13;
set condition ticker itemDef_s::type == 20; set condition ticker itemDef_s::type == 20;
set condition scroll itemDef_s::type == 21; set condition scroll itemDef_s::type == 21;
// listBoxDef_s
set reusable listBoxDef_s::elementHeightExp;
// multiDef_s // multiDef_s
use multiDef_s; use multiDef_s;
set string dvarList; set string dvarList;

View File

@ -40,6 +40,7 @@ const char* GameAssetPoolIW5::ASSET_TYPE_NAMES[]
"localize", "localize",
"attachment", "attachment",
"weapon", "weapon",
"snddriverglobals",
"fx", "fx",
"impactfx", "impactfx",
"surfacefx", "surfacefx",

View File

@ -97,7 +97,7 @@ void ContentLoader::LoadXAsset(const bool atStreamStart)
loader.Load(&varXAsset->header.headerEntry); \ loader.Load(&varXAsset->header.headerEntry); \
break; \ break; \
} }
#define SKIP_ASSET(type_index, typeName, headerEntry) \ #define SKIP_ASSET(type_index) \
case type_index: \ case type_index: \
break; break;
@ -137,6 +137,7 @@ void ContentLoader::LoadXAsset(const bool atStreamStart)
LOAD_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize) LOAD_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize)
LOAD_ASSET(ASSET_TYPE_ATTACHMENT, WeaponAttachment, attachment) LOAD_ASSET(ASSET_TYPE_ATTACHMENT, WeaponAttachment, attachment)
LOAD_ASSET(ASSET_TYPE_WEAPON, WeaponCompleteDef, weapon) LOAD_ASSET(ASSET_TYPE_WEAPON, WeaponCompleteDef, weapon)
SKIP_ASSET(ASSET_TYPE_SNDDRIVER_GLOBALS)
LOAD_ASSET(ASSET_TYPE_FX, FxEffectDef, fx) LOAD_ASSET(ASSET_TYPE_FX, FxEffectDef, fx)
LOAD_ASSET(ASSET_TYPE_IMPACT_FX, FxImpactTable, impactFx) LOAD_ASSET(ASSET_TYPE_IMPACT_FX, FxImpactTable, impactFx)
LOAD_ASSET(ASSET_TYPE_SURFACE_FX, SurfaceFxTable, surfaceFx) LOAD_ASSET(ASSET_TYPE_SURFACE_FX, SurfaceFxTable, surfaceFx)

View File

@ -67,13 +67,15 @@ class ZoneLoaderFactory::Impl
{ {
#define XBLOCK_DEF(name, type) std::make_unique<XBlock>(STR(name), name, type) #define XBLOCK_DEF(name, type) std::make_unique<XBlock>(STR(name), name, type)
zoneLoader->AddXBlock(XBLOCK_DEF(IW5::XFILE_BLOCK_TEMP, XBlock::Type::BLOCK_TYPE_TEMP)); zoneLoader->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_TEMP, XBlock::Type::BLOCK_TYPE_TEMP));
zoneLoader->AddXBlock(XBLOCK_DEF(IW5::XFILE_BLOCK_PHYSICAL, XBlock::Type::BLOCK_TYPE_NORMAL)); zoneLoader->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_PHYSICAL, XBlock::Type::BLOCK_TYPE_NORMAL));
zoneLoader->AddXBlock(XBLOCK_DEF(IW5::XFILE_BLOCK_RUNTIME, XBlock::Type::BLOCK_TYPE_RUNTIME)); zoneLoader->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_RUNTIME, XBlock::Type::BLOCK_TYPE_RUNTIME));
zoneLoader->AddXBlock(XBLOCK_DEF(IW5::XFILE_BLOCK_VIRTUAL, XBlock::Type::BLOCK_TYPE_NORMAL)); zoneLoader->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_VIRTUAL, XBlock::Type::BLOCK_TYPE_NORMAL));
zoneLoader->AddXBlock(XBLOCK_DEF(IW5::XFILE_BLOCK_LARGE, XBlock::Type::BLOCK_TYPE_NORMAL)); zoneLoader->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_LARGE, XBlock::Type::BLOCK_TYPE_NORMAL));
zoneLoader->AddXBlock(XBLOCK_DEF(IW5::XFILE_BLOCK_CALLBACK, XBlock::Type::BLOCK_TYPE_NORMAL)); zoneLoader->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_CALLBACK, XBlock::Type::BLOCK_TYPE_NORMAL));
zoneLoader->AddXBlock(XBLOCK_DEF(IW5::XFILE_BLOCK_SCRIPT, XBlock::Type::BLOCK_TYPE_NORMAL)); zoneLoader->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_VERTEX, XBlock::Type::BLOCK_TYPE_NORMAL));
zoneLoader->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_INDEX, XBlock::Type::BLOCK_TYPE_NORMAL));
zoneLoader->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_SCRIPT, XBlock::Type::BLOCK_TYPE_NORMAL));
#undef XBLOCK_DEF #undef XBLOCK_DEF
} }

View File

@ -40,6 +40,8 @@ public:
m_writer->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_VIRTUAL, XBlock::Type::BLOCK_TYPE_NORMAL)); m_writer->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_VIRTUAL, XBlock::Type::BLOCK_TYPE_NORMAL));
m_writer->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_LARGE, XBlock::Type::BLOCK_TYPE_NORMAL)); m_writer->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_LARGE, XBlock::Type::BLOCK_TYPE_NORMAL));
m_writer->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_CALLBACK, XBlock::Type::BLOCK_TYPE_NORMAL)); m_writer->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_CALLBACK, XBlock::Type::BLOCK_TYPE_NORMAL));
m_writer->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_VERTEX, XBlock::Type::BLOCK_TYPE_NORMAL));
m_writer->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_INDEX, XBlock::Type::BLOCK_TYPE_NORMAL));
m_writer->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_SCRIPT, XBlock::Type::BLOCK_TYPE_NORMAL)); m_writer->AddXBlock(XBLOCK_DEF(XFILE_BLOCK_SCRIPT, XBlock::Type::BLOCK_TYPE_NORMAL));
#undef XBLOCK_DEF #undef XBLOCK_DEF