Reformat code with clang format

This commit is contained in:
Clang Format
2023-11-19 15:28:38 +01:00
committed by Jan
parent 22e17272fd
commit 6b4f5d94a8
1099 changed files with 16763 additions and 18076 deletions

View File

@ -1,7 +1,8 @@
#pragma once
#include <vector>
#include "GameLanguage.h"
#include <vector>
class Zone;
class IGame
@ -20,4 +21,4 @@ public:
virtual void RemoveZone(Zone* zone) = 0;
virtual std::vector<Zone*> GetZones() = 0;
virtual std::vector<GameLanguagePrefix> GetLanguagePrefixes() = 0;
};
};

View File

@ -10,7 +10,7 @@ namespace IW3
static constexpr uint32_t R_HashString(const char* string, const uint32_t hash)
{
const char* v2 = string; // edx@1
char v3 = *string; // cl@1
char v3 = *string; // cl@1
uint32_t result = hash;
for (; *v2; v3 = *v2)
@ -28,4 +28,4 @@ namespace IW3
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
};
}
} // namespace IW3

View File

@ -1,9 +1,9 @@
#include "GameIW3.h"
#include <algorithm>
#include "IW3.h"
#include <algorithm>
using namespace IW3;
GameIW3 g_GameIW3;

View File

@ -14,4 +14,4 @@ public:
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
};
extern GameIW3 g_GameIW3;
extern GameIW3 g_GameIW3;

View File

@ -1,10 +1,14 @@
#pragma once
//#include <d3d11.h>
// clang-format off: Order of includes matters here
// #include <d3d9.h>
#include "Image/Texture.h"
#include "IW3_Assets.h"
// clang-format on
namespace IW3
{
struct ScriptStringList
@ -79,4 +83,4 @@ namespace IW3
WFT_NUM_FIELD_TYPES
};
}
} // namespace IW3

View File

@ -45,7 +45,7 @@ namespace IW3
ASSET_TYPE_RAWFILE = 0x1F,
ASSET_TYPE_STRINGTABLE = 0x20,
ASSET_TYPE_COUNT,
ASSET_TYPE_STRING = ASSET_TYPE_COUNT,
ASSET_TYPE_ASSETLIST,
@ -100,35 +100,35 @@ namespace IW3
union XAssetHeader
{
// XModelPieces *xmodelPieces; // NOT AN ASSET
PhysPreset *physPreset;
XAnimParts *parts;
XModel *model;
Material *material;
MaterialPixelShader *pixelShader;
MaterialVertexShader *vertexShader;
MaterialTechniqueSet *techniqueSet;
GfxImage *image;
snd_alias_list_t *sound;
SndCurve *sndCurve;
LoadedSound *loadSnd;
clipMap_t *clipMap;
ComWorld *comWorld;
GameWorldSp *gameWorldSp;
GameWorldMp *gameWorldMp;
MapEnts *mapEnts;
GfxWorld *gfxWorld;
GfxLightDef *lightDef;
Font_s *font;
MenuList *menuList;
menuDef_t *menu;
LocalizeEntry *localize;
WeaponDef *weapon;
SndDriverGlobals *sndDriverGlobals;
FxEffectDef *fx;
FxImpactTable *impactFx;
RawFile *rawfile;
StringTable *stringTable;
void *data;
PhysPreset* physPreset;
XAnimParts* parts;
XModel* model;
Material* material;
MaterialPixelShader* pixelShader;
MaterialVertexShader* vertexShader;
MaterialTechniqueSet* techniqueSet;
GfxImage* image;
snd_alias_list_t* sound;
SndCurve* sndCurve;
LoadedSound* loadSnd;
clipMap_t* clipMap;
ComWorld* comWorld;
GameWorldSp* gameWorldSp;
GameWorldMp* gameWorldMp;
MapEnts* mapEnts;
GfxWorld* gfxWorld;
GfxLightDef* lightDef;
Font_s* font;
MenuList* menuList;
menuDef_t* menu;
LocalizeEntry* localize;
WeaponDef* weapon;
SndDriverGlobals* sndDriverGlobals;
FxEffectDef* fx;
FxImpactTable* impactFx;
RawFile* rawfile;
StringTable* stringTable;
void* data;
};
typedef char cbrushedge_t;
@ -142,7 +142,7 @@ namespace IW3
XModel* model;
float offset[3];
};
struct XModelPieces
{
const char* name;
@ -152,14 +152,14 @@ namespace IW3
struct PhysPreset
{
const char *name;
const char* name;
int type;
float mass;
float bounce;
float friction;
float bulletForceScale;
float explosiveForceScale;
const char *sndAliasPrefix;
const char* sndAliasPrefix;
float piecesSpreadFraction;
float piecesUpwardVelocity;
bool tempDefaultToCylinder;
@ -224,7 +224,7 @@ namespace IW3
struct XAnimDeltaPartQuatDataFrames
{
XQuat *frames;
XQuat* frames;
XAnimDynamicIndicesQuat indices;
};
@ -371,7 +371,7 @@ namespace IW3
char zoneHandle;
uint16_t baseTriIndex;
uint16_t baseVertIndex;
r_index16_t(*triIndices)[3];
r_index16_t (*triIndices)[3];
XSurfaceVertexInfo vertInfo;
GfxPackedVertex* verts0;
unsigned int vertListCount;
@ -485,8 +485,8 @@ namespace IW3
char lodRampType;
uint16_t* boneNames;
char* parentList;
int16_t(*quats)[4];
float(*trans)[4];
int16_t (*quats)[4];
float (*trans)[4];
char* partClassification;
DObjAnimMat* baseMat;
XSurface* surfs;
@ -705,7 +705,7 @@ namespace IW3
char nameStart;
char nameEnd;
unsigned char samplerState; // SamplerStateBits_e
unsigned char semantic; // TextureSemantic
unsigned char semantic; // TextureSemantic
MaterialTextureDefInfo u;
};
@ -820,7 +820,7 @@ namespace IW3
union MaterialArgumentDef
{
const float(*literalConst)[4];
const float (*literalConst)[4];
MaterialArgumentCodeConst codeConst;
unsigned int codeSampler;
unsigned int nameHash;
@ -1156,7 +1156,7 @@ namespace IW3
struct MaterialVertexStreamRouting
{
MaterialStreamRouting data[16];
void/*IDirect3DVertexDeclaration9*/* decl[16];
void /*IDirect3DVertexDeclaration9*/* decl[16];
};
struct MaterialVertexDeclaration
@ -1176,7 +1176,7 @@ namespace IW3
struct MaterialVertexShaderProgram
{
void/*IDirect3DVertexShader9*/* vs;
void /*IDirect3DVertexShader9*/* vs;
GfxVertexShaderLoadDef loadDef;
};
@ -1195,7 +1195,7 @@ namespace IW3
struct MaterialPixelShaderProgram
{
void/*IDirect3DPixelShader9*/* ps;
void /*IDirect3DPixelShader9*/* ps;
GfxPixelShaderLoadDef loadDef;
};
@ -1304,10 +1304,10 @@ namespace IW3
union GfxTexture
{
//void/*IDirect3DBaseTexture9*/* basemap;
//void/*IDirect3DTexture9*/* map;
//void/*IDirect3DVolumeTexture9*/* volmap;
//void/*IDirect3DCubeTexture9*/* cubemap;
// void/*IDirect3DBaseTexture9*/* basemap;
// void/*IDirect3DTexture9*/* map;
// void/*IDirect3DVolumeTexture9*/* volmap;
// void/*IDirect3DCubeTexture9*/* cubemap;
Texture* texture;
GfxImageLoadDef* loadDef;
};
@ -1681,7 +1681,7 @@ namespace IW3
unsigned int numLeafSurfaces;
unsigned int* leafsurfaces;
unsigned int vertCount;
vec3_t *verts;
vec3_t* verts;
int triCount;
uint16_t* triIndices;
char* triEdgeIsWalkable;
@ -1898,13 +1898,13 @@ namespace IW3
struct GfxWorldVertexData
{
GfxWorldVertex* vertices;
void/*IDirect3DVertexBuffer9*/* worldVb;
void /*IDirect3DVertexBuffer9*/* worldVb;
};
struct GfxWorldVertexLayerData
{
char* data;
void/*IDirect3DVertexBuffer9*/* layerVb;
void /*IDirect3DVertexBuffer9*/* layerVb;
};
struct SunLightParseParams
@ -1979,7 +1979,7 @@ namespace IW3
bool isAncestor;
char recursionDepth;
char hullPointCount;
float(*hullPoints)[2];
float (*hullPoints)[2];
GfxPortal* queuedParent;
};
@ -3076,13 +3076,13 @@ namespace IW3
// TODO: Order is accuracyGraphName[0] -> originalAccuracyGraphKnots[0] -> accuracyGraphName[1] -> ...
// 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.
//const char* accuracyGraphName[2];
// const char* accuracyGraphName[2];
const char* accuracyGraphName0;
const char* accuracyGraphName1;
//float(*accuracyGraphKnots[2])[2];
// float(*accuracyGraphKnots[2])[2];
vec2_t* accuracyGraphKnots0;
vec2_t* accuracyGraphKnots1;
//float(*originalAccuracyGraphKnots[2])[2];
// float(*originalAccuracyGraphKnots[2])[2];
vec2_t* originalAccuracyGraphKnots0;
vec2_t* originalAccuracyGraphKnots1;
int accuracyGraphKnotCount[2];

View File

@ -10,7 +10,7 @@ namespace IW4
static constexpr uint32_t R_HashString(const char* string, const uint32_t hash)
{
const char* v2 = string; // edx@1
char v3 = *string; // cl@1
char v3 = *string; // cl@1
uint32_t result = hash;
for (; *v2; v3 = *v2)
@ -35,4 +35,4 @@ namespace IW4
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
};
}
} // namespace IW4

View File

@ -1,9 +1,9 @@
#include "GameIW4.h"
#include <algorithm>
#include "IW4.h"
#include <algorithm>
using namespace IW4;
GameIW4 g_GameIW4;

View File

@ -14,4 +14,4 @@ public:
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
};
extern GameIW4 g_GameIW4;
extern GameIW4 g_GameIW4;

View File

@ -1,10 +1,14 @@
#pragma once
//#include <d3d11.h>
// clang-format off: Order of includes matters here
// #include <d3d9.h>
#include "Image/Texture.h"
#include "IW4_Assets.h"
// clang-format on
namespace IW4
{
struct DB_AuthHash
@ -26,11 +30,11 @@ namespace IW4
struct DB_AuthHeader
{
char magic[8]; // + 0
unsigned int reserved; // + 8
DB_AuthHash subheaderHash; // + 12
DB_AuthSignature signedSubheaderHash; // + 44
DB_AuthSubHeader subheader; // + 300
char magic[8]; // + 0
unsigned int reserved; // + 8
DB_AuthHash subheaderHash; // + 12
DB_AuthSignature signedSubheaderHash; // + 44
DB_AuthSubHeader subheader; // + 300
};
struct ScriptStringList
@ -122,4 +126,4 @@ namespace IW4
VFT_NUM,
};
}
} // namespace IW4

View File

@ -571,8 +571,8 @@ namespace IW4
unsigned int noScalePartBits[6];
uint16_t* boneNames;
unsigned char* parentList;
int16_t(*quats)[4];
float(*trans)[3];
int16_t (*quats)[4];
float (*trans)[3];
unsigned char* partClassification;
DObjAnimMat* baseMat;
Material** materialHandles;
@ -669,7 +669,7 @@ namespace IW4
char nameStart;
char nameEnd;
unsigned char samplerState; // SamplerStateBits_e
unsigned char semantic; // TextureSemantic
unsigned char semantic; // TextureSemantic
MaterialTextureDefInfo u;
};
@ -878,13 +878,13 @@ namespace IW4
SORTKEY_TRANS_START = 6,
SORTKEY_DECAL_BOTTOM_1 = 6, // prob decal - bottom 1
SORTKEY_DECAL_BOTTOM_2 = 7, // prob decal - bottom 2
SORTKEY_DECAL_BOTTOM_3 = 8, // prob decal - bottom 3
SORTKEY_DECAL_STATIC_DECAL = 9, // prob decal - static decal
SORTKEY_DECAL_MIDDLE_1 = 10, // prob decal - middle 1
SORTKEY_DECAL_MIDDLE_2 = 11, // prob decal - middle 2
SORTKEY_DECAL_MIDDLE_3 = 12, // prob decal - middle 3
SORTKEY_DECAL_BOTTOM_1 = 6, // prob decal - bottom 1
SORTKEY_DECAL_BOTTOM_2 = 7, // prob decal - bottom 2
SORTKEY_DECAL_BOTTOM_3 = 8, // prob decal - bottom 3
SORTKEY_DECAL_STATIC_DECAL = 9, // prob decal - static decal
SORTKEY_DECAL_MIDDLE_1 = 10, // prob decal - middle 1
SORTKEY_DECAL_MIDDLE_2 = 11, // prob decal - middle 2
SORTKEY_DECAL_MIDDLE_3 = 12, // prob decal - middle 3
SORTKEY_DECAL_WEAPON_IMPACT = 13, // prob decal - weapon impact
// ? = 14, // prob decal - top 1
// some decal = 15, // prob decal - top 2 or decal - top 3
@ -896,7 +896,7 @@ namespace IW4
// ? = 21,
// - = 22,
// - = 23,
SORTKEY_WINDOW_INSIDE = 24, // prob window inside
SORTKEY_WINDOW_INSIDE = 24, // prob window inside
SORTKEY_WINDOW_OUTSIDE = 25, // prob window outside
// ? = 26, // includes motiontracker3d, impact fx, atmos
// ? = 27,
@ -919,11 +919,11 @@ namespace IW4
// ? = 44,
// ? = 45,
// - = 46,
SORTKEY_BLEND_ADDITIVE = 47, // most likely blend / additive
SORTKEY_BLEND_ADDITIVE = 47, // most likely blend / additive
SORTKEY_EFFECT_AUTO_SORT = 48, // most likely effect - auto sort
SORTKEY_AFTER_EFFECTS_BOTTOM = 49,
SORTKEY_AFTER_EFFECTS_MIDDLE = 50, // prob after effects - middle
SORTKEY_AFTER_EFFECTS_TOP = 51, // prob after effects - top
SORTKEY_AFTER_EFFECTS_TOP = 51, // prob after effects - top
// - = 52,
SORTKEY_VIEWMODEL_EFFECT = 53, // maybe viewmodel effect
@ -1087,7 +1087,7 @@ namespace IW4
STREAM_SRC_COUNT
};
enum MaterialStreamDestination_e
{
STREAM_DST_POSITION = 0x0,
@ -1116,7 +1116,7 @@ namespace IW4
struct MaterialVertexStreamRouting
{
MaterialStreamRouting data[13];
void/*IDirect3DVertexDeclaration9*/* decl[16];
void /*IDirect3DVertexDeclaration9*/* decl[16];
};
struct MaterialVertexDeclaration
@ -1129,7 +1129,7 @@ namespace IW4
struct MaterialVertexShaderProgram
{
void/*IDirect3DVertexShader9*/* vs;
void /*IDirect3DVertexShader9*/* vs;
GfxVertexShaderLoadDef loadDef;
};
@ -1141,7 +1141,7 @@ namespace IW4
struct MaterialPixelShaderProgram
{
void/*IDirect3DPixelShader9*/* ps;
void /*IDirect3DPixelShader9*/* ps;
GfxPixelShaderLoadDef loadDef;
};
@ -1205,11 +1205,11 @@ namespace IW4
enum MaterialType
{
MTL_TYPE_DEFAULT = 0x0,
MTL_TYPE_MODEL = 0x1, // m_
MTL_TYPE_MODEL_VERTCOL = 0x2, // mc_
MTL_TYPE_MODEL = 0x1, // m_
MTL_TYPE_MODEL_VERTCOL = 0x2, // mc_
MTL_TYPE_MODEL_VERTCOL_GREY = 0x3, // mg_
MTL_TYPE_WORLD = 0x4, // w_
MTL_TYPE_WORLD_VERTCOL = 0x5, // wc_
MTL_TYPE_WORLD = 0x4, // w_
MTL_TYPE_WORLD_VERTCOL = 0x5, // wc_
MTL_TYPE_COUNT,
};
@ -1409,20 +1409,20 @@ namespace IW4
enum MaterialShaderArgumentType
{
MTL_ARG_MATERIAL_VERTEX_CONST = 0x0, // stable
MTL_ARG_LITERAL_VERTEX_CONST = 0x1, // stable
MTL_ARG_MATERIAL_VERTEX_CONST = 0x0, // stable
MTL_ARG_LITERAL_VERTEX_CONST = 0x1, // stable
MTL_ARG_MATERIAL_PIXEL_SAMPLER = 0x2, // stable
MTL_ARG_CODE_PRIM_BEGIN = 0x3,
MTL_ARG_CODE_VERTEX_CONST = 0x3, // stable object prim
MTL_ARG_CODE_VERTEX_CONST = 0x3, // stable object prim
MTL_ARG_CODE_PIXEL_SAMPLER = 0x4, // stable object
MTL_ARG_CODE_PIXEL_CONST = 0x5, // stable
MTL_ARG_CODE_PIXEL_CONST = 0x5, // stable
MTL_ARG_CODE_PRIM_END = 0x6,
MTL_ARG_MATERIAL_PIXEL_CONST = 0x6, // stable
MTL_ARG_LITERAL_PIXEL_CONST = 0x7, // stable
MTL_ARG_LITERAL_PIXEL_CONST = 0x7, // stable
MTL_ARG_COUNT
};
@ -1457,14 +1457,15 @@ namespace IW4
enum TechniqueFlags
{
// Guesses purely based on data analysis:
TECHNIQUE_FLAG_1 = 0x1, // uses resolvedPostSun code sampler // MTL_TECHFLAG_NEEDS_RESOLVED_POST_SUN
TECHNIQUE_FLAG_2 = 0x2, // uses resolvedScene code sampler MTL_TECHFLAG_NEEDS_RESOLVED_SCENE
TECHNIQUE_FLAG_4 = 0x4, // zprepass only
TECHNIQUE_FLAG_8 = 0x8, // build_floatz only
TECHNIQUE_FLAG_1 = 0x1, // uses resolvedPostSun code sampler // MTL_TECHFLAG_NEEDS_RESOLVED_POST_SUN
TECHNIQUE_FLAG_2 = 0x2, // uses resolvedScene code sampler MTL_TECHFLAG_NEEDS_RESOLVED_SCENE
TECHNIQUE_FLAG_4 = 0x4, // zprepass only
TECHNIQUE_FLAG_8 = 0x8, // build_floatz only
TECHNIQUE_FLAG_10 = 0x10, // build_shadowmap_depth + build_shadowmap_model only
TECHNIQUE_FLAG_20 = 0x20, // techniques with _i_ in its name (all use texcoord[1] in decl -> other optional stream sources are not used at all so might be any optional)
TECHNIQUE_FLAG_40 = 0x40, // uses code constant light.spotDir or light.spotFactors
TECHNIQUE_FLAG_80 = 0x80, // uses floatZ sampler and does not have 0x100 flag
TECHNIQUE_FLAG_20 =
0x20, // techniques with _i_ in its name (all use texcoord[1] in decl -> other optional stream sources are not used at all so might be any optional)
TECHNIQUE_FLAG_40 = 0x40, // uses code constant light.spotDir or light.spotFactors
TECHNIQUE_FLAG_80 = 0x80, // uses floatZ sampler and does not have 0x100 flag
TECHNIQUE_FLAG_100 = 0x100, // distortion_scale_zfeather_dtex + distortion_scale_ua_zfeather + distortion_scale_zfeather
TECHNIQUE_FLAG_200 = 0x200, // ?
};
@ -1758,7 +1759,7 @@ namespace IW4
DvarValue latched;
DvarValue reset;
DvarLimits domain;
//bool (__cdecl* domainFunc)(dvar_t*, DvarValue);
// bool (__cdecl* domainFunc)(dvar_t*, DvarValue);
void* domainFunc;
dvar_t* hashNext;
};
@ -3065,11 +3066,13 @@ namespace IW4
float fAngle;
float forward[2];
float fRadius;
union
{
float minUseDistSq;
PathNodeErrorCode error;
};
int16_t wOverlapNode[2];
uint16_t totalLinkCount;
pathlink_s* Links;
@ -3097,6 +3100,7 @@ namespace IW4
pathnode_t* pParent;
float fCost;
float fHeuristic;
union
{
float nodeCost;
@ -3259,6 +3263,7 @@ namespace IW4
FxSpatialFrame frame;
float radius;
};
unsigned int nextFree;
};
@ -3417,7 +3422,7 @@ namespace IW4
bool isAncestor;
char recursionDepth;
char hullPointCount;
float(*hullPoints)[2];
float (*hullPoints)[2];
GfxPortal* queuedParent;
};
@ -3470,13 +3475,13 @@ namespace IW4
struct GfxWorldVertexData
{
GfxWorldVertex* vertices;
void/*IDirect3DVertexBuffer9*/* worldVb;
void /*IDirect3DVertexBuffer9*/* worldVb;
};
struct GfxWorldVertexLayerData
{
char* data;
void/*IDirect3DVertexBuffer9*/* layerVb;
void /*IDirect3DVertexBuffer9*/* layerVb;
};
struct GfxWorldDraw
@ -3757,7 +3762,7 @@ namespace IW4
unsigned int sortKeyEffectAuto;
unsigned int sortKeyDistortion;
GfxWorldDpvsPlanes dpvsPlanes;
int/*GfxCellTreeCount*/* aabbTreeCounts;
int /*GfxCellTreeCount*/* aabbTreeCounts;
GfxCellTree128* aabbTrees;
GfxCell* cells;
GfxWorldDraw draw;
@ -4639,7 +4644,6 @@ namespace IW4
VEH_TYPE_COUNT = 0x7,
};
struct VehicleDef
{
const char* name;

View File

@ -22,17 +22,17 @@ int Common::StringTable_HashString(const char* str)
PackedTexCoords Common::Vec2PackTexCoords(const vec2_t* in)
{
return PackedTexCoords{ Pack32::Vec2PackTexCoords(reinterpret_cast<const float*>(in)) };
return PackedTexCoords{Pack32::Vec2PackTexCoords(reinterpret_cast<const float*>(in))};
}
PackedUnitVec Common::Vec3PackUnitVec(const vec3_t* in)
{
return PackedUnitVec{ Pack32::Vec3PackUnitVec(reinterpret_cast<const float*>(in)) };
return PackedUnitVec{Pack32::Vec3PackUnitVec(reinterpret_cast<const float*>(in))};
}
GfxColor Common::Vec4PackGfxColor(const vec4_t* in)
{
return GfxColor{ Pack32::Vec4PackGfxColor(reinterpret_cast<const float*>(in)) };
return GfxColor{Pack32::Vec4PackGfxColor(reinterpret_cast<const float*>(in))};
}
void Common::Vec2UnpackTexCoords(const PackedTexCoords& in, vec2_t* out)

View File

@ -16,4 +16,4 @@ namespace IW5
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
};
}
} // namespace IW5

View File

@ -1,9 +1,9 @@
#include "GameIW5.h"
#include <algorithm>
#include "IW5.h"
#include <algorithm>
using namespace IW5;
GameIW5 g_GameIW5;

View File

@ -14,4 +14,4 @@ public:
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
};
extern GameIW5 g_GameIW5;
extern GameIW5 g_GameIW5;

View File

@ -1,10 +1,14 @@
#pragma once
//#include <d3d11.h>
// clang-format off: Order of includes matters here
// #include <d3d9.h>
#include "Image/Texture.h"
#include "IW5_Assets.h"
// clang-format on
namespace IW5
{
struct DB_AuthHash
@ -26,11 +30,11 @@ namespace IW5
struct DB_AuthHeader
{
char magic[8]; // + 0
unsigned int reserved; // + 8
DB_AuthHash subheaderHash; // + 12
DB_AuthSignature signedSubheaderHash; // + 44
DB_AuthSubHeader subheader; // + 300
char magic[8]; // + 0
unsigned int reserved; // + 8
DB_AuthHash subheaderHash; // + 12
DB_AuthSignature signedSubheaderHash; // + 44
DB_AuthSubHeader subheader; // + 300
};
struct ScriptStringList
@ -79,4 +83,4 @@ namespace IW5
CSPFT_NUM_BASE_FIELD_TYPES,
};
}
} // namespace IW5

View File

@ -536,7 +536,7 @@ namespace IW5
uint16_t baseTriIndex;
uint16_t baseVertIndex;
float quantizeScale;
r_index16_t(*triIndices)[3];
r_index16_t (*triIndices)[3];
XSurfaceVertexInfo vertInfo;
GfxVertexUnion0 verts0;
unsigned int vertListCount;
@ -606,8 +606,8 @@ namespace IW5
unsigned int noScalePartBits[6];
ScriptString* boneNames;
unsigned char* parentList;
short(*quats)[4];
float(*trans)[3];
short (*quats)[4];
float (*trans)[3];
unsigned char* partClassification;
DObjAnimMat* baseMat;
Material** materialHandles;
@ -802,13 +802,13 @@ namespace IW5
char source;
char dest;
};
struct MaterialVertexStreamRouting
{
MaterialStreamRouting data[13];
void* decl[16];
};
struct MaterialVertexDeclaration
{
const char* name;
@ -843,7 +843,7 @@ namespace IW5
union MaterialArgumentDef
{
const float(*literalConst)[4];
const float (*literalConst)[4];
MaterialArgumentCodeConst codeConst;
unsigned int codeSampler;
unsigned int nameHash;
@ -1507,6 +1507,7 @@ namespace IW5
pathnode_t* pParent;
float fCost;
float fHeuristic;
union
{
float nodeCost;
@ -1659,6 +1660,7 @@ namespace IW5
FxSpatialFrame frame;
float radius;
};
unsigned int nextFree;
};
@ -1817,7 +1819,7 @@ namespace IW5
bool isAncestor;
unsigned char recursionDepth;
unsigned char hullPointCount;
float(*hullPoints)[2];
float (*hullPoints)[2];
GfxPortal* queuedParent;
};
@ -2173,7 +2175,7 @@ namespace IW5
unsigned int sortKeyEffectAuto;
unsigned int sortKeyDistortion;
GfxWorldDpvsPlanes dpvsPlanes;
int/*GfxCellTreeCount*/* aabbTreeCounts;
int /*GfxCellTreeCount*/* aabbTreeCounts;
GfxCellTree128* aabbTrees;
GfxCell* cells;
GfxWorldDraw draw;
@ -2569,8 +2571,8 @@ namespace IW5
WINDOW_FLAG_POPUP = 0x1000000,
WINDOW_FLAG_LEGACY_SPLIT_SCREEN_SCALE = 0x4000000,
WINDOW_FLAG_HIDDEN_DURING_FLASH_BANG = 0x10000000, // confirmed
WINDOW_FLAG_HIDDEN_DURING_SCOPE = 0x20000000, // confirmed
WINDOW_FLAG_HIDDEN_DURING_UI = 0x40000000, // confirmed
WINDOW_FLAG_HIDDEN_DURING_SCOPE = 0x20000000, // confirmed
WINDOW_FLAG_HIDDEN_DURING_UI = 0x40000000, // confirmed
WINDOW_FLAG_TEXT_ONLY_FOCUS = 0x80000000,
};

View File

@ -1,9 +1,9 @@
#include "CommonT5.h"
#include <cctype>
#include "Utils/Pack.h"
#include <cctype>
using namespace T5;
int Common::Com_HashKey(const char* str, const int maxLen)

View File

@ -18,4 +18,4 @@ namespace T5
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
};
}
} // namespace T5

View File

@ -1,9 +1,9 @@
#include "GameT5.h"
#include <algorithm>
#include "T5.h"
#include <algorithm>
using namespace T5;
GameT5 g_GameT5;

View File

@ -14,4 +14,4 @@ public:
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
};
extern GameT5 g_GameT5;
extern GameT5 g_GameT5;

View File

@ -1,10 +1,14 @@
#pragma once
//#include <d3d9.h>
// clang-format off: Order of includes matters here
// #include <d3d9.h>
#include "Image/Texture.h"
#include "T5_Assets.h"
// clang-format on
namespace T5
{
struct ScriptStringList
@ -110,4 +114,4 @@ namespace T5
CFT_NUM_FIELD_TYPES
};
}
} // namespace T5

View File

@ -114,43 +114,43 @@ namespace T5
union XAssetHeader
{
//XModelPieces *xmodelPieces; // Not an asset
PhysPreset *physPreset;
PhysConstraints *physConstraints;
DestructibleDef *destructibleDef;
XAnimParts *parts;
XModel *model;
Material *material;
//MaterialPixelShader *pixelShader; // Not an asset
//MaterialVertexShader *vertexShader; // Not an asset
MaterialTechniqueSet *techniqueSet;
GfxImage *image;
SndBank *sound;
SndPatch *soundPatch;
clipMap_t *clipMap;
ComWorld *comWorld;
GameWorldSp *gameWorldSp;
GameWorldMp *gameWorldMp;
MapEnts *mapEnts;
GfxWorld *gfxWorld;
GfxLightDef *lightDef;
Font_s *font;
MenuList *menuList;
menuDef_t *menu;
LocalizeEntry *localize;
WeaponVariantDef *weapon;
SndDriverGlobals *sndDriverGlobals;
FxEffectDef *fx;
FxImpactTable *impactFx;
RawFile *rawfile;
StringTable *stringTable;
PackIndex *packIndex;
XGlobals *xGlobals;
ddlRoot_t *ddlRoot;
Glasses *glasses;
//TextureList *textureList; // Not an asset
EmblemSet *emblemSet;
void *data;
// XModelPieces *xmodelPieces; // Not an asset
PhysPreset* physPreset;
PhysConstraints* physConstraints;
DestructibleDef* destructibleDef;
XAnimParts* parts;
XModel* model;
Material* material;
// MaterialPixelShader *pixelShader; // Not an asset
// MaterialVertexShader *vertexShader; // Not an asset
MaterialTechniqueSet* techniqueSet;
GfxImage* image;
SndBank* sound;
SndPatch* soundPatch;
clipMap_t* clipMap;
ComWorld* comWorld;
GameWorldSp* gameWorldSp;
GameWorldMp* gameWorldMp;
MapEnts* mapEnts;
GfxWorld* gfxWorld;
GfxLightDef* lightDef;
Font_s* font;
MenuList* menuList;
menuDef_t* menu;
LocalizeEntry* localize;
WeaponVariantDef* weapon;
SndDriverGlobals* sndDriverGlobals;
FxEffectDef* fx;
FxImpactTable* impactFx;
RawFile* rawfile;
StringTable* stringTable;
PackIndex* packIndex;
XGlobals* xGlobals;
ddlRoot_t* ddlRoot;
Glasses* glasses;
// TextureList *textureList; // Not an asset
EmblemSet* emblemSet;
void* data;
};
typedef tdef_align(16) char char16;
@ -508,12 +508,12 @@ namespace T5
uint16_t triCount;
uint16_t baseTriIndex;
uint16_t baseVertIndex;
r_index16_t(*triIndices)[3];
r_index16_t (*triIndices)[3];
XSurfaceVertexInfo vertInfo;
GfxPackedVertex* verts0;
void/*IDirect3DVertexBuffer9*/* vb0;
void /*IDirect3DVertexBuffer9*/* vb0;
XRigidVertList* vertList;
void/*IDirect3DIndexBuffer9*/* indexBuffer;
void /*IDirect3DIndexBuffer9*/* indexBuffer;
int partBits[5];
};
@ -628,8 +628,8 @@ namespace T5
char lodRampType;
uint16_t* boneNames;
char* parentList;
int16_t(*quats)[4];
float(*trans)[4];
int16_t (*quats)[4];
float (*trans)[4];
char* partClassification;
DObjAnimMat* baseMat;
XSurface* surfs;
@ -837,7 +837,7 @@ namespace T5
struct MaterialVertexStreamRouting
{
MaterialStreamRouting data[16];
void/*IDirect3DVertexDeclaration9*/* decl[18];
void /*IDirect3DVertexDeclaration9*/* decl[18];
};
struct MaterialVertexDeclaration
@ -856,7 +856,7 @@ namespace T5
struct MaterialVertexShaderProgram
{
void/*IDirect3DVertexShader9*/* vs;
void /*IDirect3DVertexShader9*/* vs;
GfxVertexShaderLoadDef loadDef;
};
@ -874,7 +874,7 @@ namespace T5
struct MaterialPixelShaderProgram
{
void/*IDirect3DPixelShader9*/* ps;
void /*IDirect3DPixelShader9*/* ps;
GfxPixelShaderLoadDef loadDef;
};
@ -893,7 +893,7 @@ namespace T5
union MaterialArgumentDef
{
const float(*literalConst)[4];
const float (*literalConst)[4];
MaterialArgumentCodeConst codeConst;
unsigned int codeSampler;
unsigned int nameHash;
@ -1963,7 +1963,7 @@ namespace T5
bool isAncestor;
char recursionDepth;
char hullPointCount;
float(*hullPoints)[2];
float (*hullPoints)[2];
GfxPortal* queuedParent;
};
@ -2040,17 +2040,17 @@ namespace T5
PackedUnitVec normal;
PackedUnitVec tangent;
};
struct GfxWorldVertexData
{
GfxWorldVertex* vertices;
void/*IDirect3DVertexBuffer9*/* worldVb;
void /*IDirect3DVertexBuffer9*/* worldVb;
};
struct GfxWorldVertexLayerData
{
char* data;
void/*IDirect3DVertexBuffer9*/* layerVb;
void /*IDirect3DVertexBuffer9*/* layerVb;
};
struct GfxWorldDraw
@ -3861,15 +3861,16 @@ namespace T5
float fHipViewScatterMax;
float fightDist;
float maxDist;
//const char *accuracyGraphName[2]; // TODO: Order is accuracyGraphName[0] -> accuracyGraphKnots[0] -> originalAccuracyGraphKnots[0] -> accuracyGraphName[1] -> ...
// 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.
// const char *accuracyGraphName[2]; // TODO: Order is accuracyGraphName[0] -> accuracyGraphKnots[0] -> originalAccuracyGraphKnots[0] ->
// accuracyGraphName[1] -> ...
// 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.
const char* accuracyGraphName0;
const char* accuracyGraphName1;
//vec2_t *accuracyGraphKnots[2];
// vec2_t *accuracyGraphKnots[2];
vec2_t* accuracyGraphKnots0;
vec2_t* accuracyGraphKnots1;
//vec2_t *originalAccuracyGraphKnots[2];
// vec2_t *originalAccuracyGraphKnots[2];
vec2_t* originalAccuracyGraphKnots0;
vec2_t* originalAccuracyGraphKnots1;
int accuracyGraphKnotCount[2];

View File

@ -1,9 +1,9 @@
#include "CommonT6.h"
#include <cctype>
#include "Utils/Pack.h"
#include <cctype>
using namespace T6;
int Common::Com_HashKey(const char* str, const int maxLen)
@ -30,7 +30,7 @@ int Common::Com_HashString(const char* str)
auto result = 0x1505;
auto offset = 0;
while(str[offset])
while (str[offset])
{
const auto c = tolower(str[offset++]);
result = c + 33 * result;
@ -46,7 +46,7 @@ int Common::Com_HashString(const char* str, const int len)
int result = 0x1505;
int offset = 0;
while(str[offset])
while (str[offset])
{
if (len > 0 && offset >= len)
break;
@ -70,17 +70,17 @@ uint32_t Common::R_HashString(const char* str, uint32_t hash)
PackedTexCoords Common::Vec2PackTexCoords(const vec2_t* in)
{
return PackedTexCoords{ Pack32::Vec2PackTexCoords(in->v) };
return PackedTexCoords{Pack32::Vec2PackTexCoords(in->v)};
}
PackedUnitVec Common::Vec3PackUnitVec(const vec3_t* in)
{
return PackedUnitVec{ Pack32::Vec3PackUnitVec(in->v) };
return PackedUnitVec{Pack32::Vec3PackUnitVec(in->v)};
}
GfxColor Common::Vec4PackGfxColor(const vec4_t* in)
{
return GfxColor{ Pack32::Vec4PackGfxColor(in->v) };
return GfxColor{Pack32::Vec4PackGfxColor(in->v)};
}
void Common::Vec2UnpackTexCoords(const PackedTexCoords& in, vec2_t* out)
@ -96,4 +96,4 @@ void Common::Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out)
void Common::Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out)
{
Pack32::Vec4UnpackGfxColor(in.packed, out->v);
}
}

View File

@ -19,4 +19,4 @@ namespace T6
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
};
}
} // namespace T6

View File

@ -1,9 +1,9 @@
#include "GameT6.h"
#include <algorithm>
#include "T6.h"
#include <algorithm>
using namespace T6;
GameT6 g_GameT6;

View File

@ -14,4 +14,4 @@ public:
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
};
extern GameT6 g_GameT6;
extern GameT6 g_GameT6;

View File

@ -1,10 +1,14 @@
#pragma once
//#include <d3d11.h>
// clang-format off: Order of includes matters here
// #include <d3d11.h>
#include "Image/Texture.h"
#include "T6_Assets.h"
// clang-format on
namespace T6
{
struct ScriptStringList
@ -149,4 +153,4 @@ namespace T6
AUFT_NUM_FIELD_TYPES,
};
}
} // namespace T6

File diff suppressed because it is too large Load Diff