mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-07 13:28:08 -05:00
Reformat code with clang format
This commit is contained in:
parent
22e17272fd
commit
6b4f5d94a8
@ -17,9 +17,8 @@ IndentWidth: 4
|
|||||||
IndentWrappedFunctionNames: true
|
IndentWrappedFunctionNames: true
|
||||||
InsertNewlineAtEOF: true
|
InsertNewlineAtEOF: true
|
||||||
NamespaceIndentation: All
|
NamespaceIndentation: All
|
||||||
PackConstructorInitializers: CurrentLine
|
PackConstructorInitializers: Never
|
||||||
PointerAlignment: Left
|
PointerAlignment: Left
|
||||||
SeparateDefinitionBlocks: Always
|
SeparateDefinitionBlocks: Always
|
||||||
SortUsingDeclarations: Lexicographic
|
SortUsingDeclarations: Lexicographic
|
||||||
SpaceAfterTemplateKeyword: false
|
SpaceAfterTemplateKeyword: false
|
||||||
SpaceBeforeCpp11BracedList: true
|
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
# Go to repository root
|
# Go to repository root
|
||||||
cd "$(dirname "$0")/.." || exit 2
|
cd "$(dirname "$0")/.." || exit 2
|
||||||
|
|
||||||
find ./src ./test -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i
|
find ./src ./test -iname '*.h' -o -iname '*.cpp' | xargs clang-format --verbose -i
|
@ -1,7 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <vector>
|
|
||||||
#include "GameLanguage.h"
|
#include "GameLanguage.h"
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class Zone;
|
class Zone;
|
||||||
|
|
||||||
class IGame
|
class IGame
|
||||||
|
@ -28,4 +28,4 @@ namespace IW3
|
|||||||
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
|
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
|
||||||
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
|
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW3
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "GameIW3.h"
|
#include "GameIW3.h"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include "IW3.h"
|
#include "IW3.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace IW3;
|
using namespace IW3;
|
||||||
|
|
||||||
GameIW3 g_GameIW3;
|
GameIW3 g_GameIW3;
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
//#include <d3d11.h>
|
// clang-format off: Order of includes matters here
|
||||||
|
|
||||||
|
// #include <d3d9.h>
|
||||||
#include "Image/Texture.h"
|
#include "Image/Texture.h"
|
||||||
|
|
||||||
#include "IW3_Assets.h"
|
#include "IW3_Assets.h"
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
namespace IW3
|
namespace IW3
|
||||||
{
|
{
|
||||||
struct ScriptStringList
|
struct ScriptStringList
|
||||||
@ -79,4 +83,4 @@ namespace IW3
|
|||||||
|
|
||||||
WFT_NUM_FIELD_TYPES
|
WFT_NUM_FIELD_TYPES
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW3
|
||||||
|
@ -35,4 +35,4 @@ namespace IW4
|
|||||||
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
|
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
|
||||||
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
|
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW4
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "GameIW4.h"
|
#include "GameIW4.h"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include "IW4.h"
|
#include "IW4.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace IW4;
|
using namespace IW4;
|
||||||
|
|
||||||
GameIW4 g_GameIW4;
|
GameIW4 g_GameIW4;
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
//#include <d3d11.h>
|
// clang-format off: Order of includes matters here
|
||||||
|
|
||||||
|
// #include <d3d9.h>
|
||||||
#include "Image/Texture.h"
|
#include "Image/Texture.h"
|
||||||
|
|
||||||
#include "IW4_Assets.h"
|
#include "IW4_Assets.h"
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
namespace IW4
|
namespace IW4
|
||||||
{
|
{
|
||||||
struct DB_AuthHash
|
struct DB_AuthHash
|
||||||
@ -122,4 +126,4 @@ namespace IW4
|
|||||||
|
|
||||||
VFT_NUM,
|
VFT_NUM,
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW4
|
||||||
|
@ -1462,7 +1462,8 @@ namespace IW4
|
|||||||
TECHNIQUE_FLAG_4 = 0x4, // zprepass only
|
TECHNIQUE_FLAG_4 = 0x4, // zprepass only
|
||||||
TECHNIQUE_FLAG_8 = 0x8, // build_floatz only
|
TECHNIQUE_FLAG_8 = 0x8, // build_floatz only
|
||||||
TECHNIQUE_FLAG_10 = 0x10, // build_shadowmap_depth + build_shadowmap_model 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_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_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_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_100 = 0x100, // distortion_scale_zfeather_dtex + distortion_scale_ua_zfeather + distortion_scale_zfeather
|
||||||
@ -3065,11 +3066,13 @@ namespace IW4
|
|||||||
float fAngle;
|
float fAngle;
|
||||||
float forward[2];
|
float forward[2];
|
||||||
float fRadius;
|
float fRadius;
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
float minUseDistSq;
|
float minUseDistSq;
|
||||||
PathNodeErrorCode error;
|
PathNodeErrorCode error;
|
||||||
};
|
};
|
||||||
|
|
||||||
int16_t wOverlapNode[2];
|
int16_t wOverlapNode[2];
|
||||||
uint16_t totalLinkCount;
|
uint16_t totalLinkCount;
|
||||||
pathlink_s* Links;
|
pathlink_s* Links;
|
||||||
@ -3097,6 +3100,7 @@ namespace IW4
|
|||||||
pathnode_t* pParent;
|
pathnode_t* pParent;
|
||||||
float fCost;
|
float fCost;
|
||||||
float fHeuristic;
|
float fHeuristic;
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
float nodeCost;
|
float nodeCost;
|
||||||
@ -3259,6 +3263,7 @@ namespace IW4
|
|||||||
FxSpatialFrame frame;
|
FxSpatialFrame frame;
|
||||||
float radius;
|
float radius;
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned int nextFree;
|
unsigned int nextFree;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -4639,7 +4644,6 @@ namespace IW4
|
|||||||
VEH_TYPE_COUNT = 0x7,
|
VEH_TYPE_COUNT = 0x7,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct VehicleDef
|
struct VehicleDef
|
||||||
{
|
{
|
||||||
const char* name;
|
const char* name;
|
||||||
|
@ -16,4 +16,4 @@ namespace IW5
|
|||||||
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
|
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
|
||||||
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
|
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW5
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "GameIW5.h"
|
#include "GameIW5.h"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include "IW5.h"
|
#include "IW5.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace IW5;
|
using namespace IW5;
|
||||||
|
|
||||||
GameIW5 g_GameIW5;
|
GameIW5 g_GameIW5;
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
//#include <d3d11.h>
|
// clang-format off: Order of includes matters here
|
||||||
|
|
||||||
|
// #include <d3d9.h>
|
||||||
#include "Image/Texture.h"
|
#include "Image/Texture.h"
|
||||||
|
|
||||||
#include "IW5_Assets.h"
|
#include "IW5_Assets.h"
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
namespace IW5
|
namespace IW5
|
||||||
{
|
{
|
||||||
struct DB_AuthHash
|
struct DB_AuthHash
|
||||||
@ -79,4 +83,4 @@ namespace IW5
|
|||||||
|
|
||||||
CSPFT_NUM_BASE_FIELD_TYPES,
|
CSPFT_NUM_BASE_FIELD_TYPES,
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW5
|
||||||
|
@ -1507,6 +1507,7 @@ namespace IW5
|
|||||||
pathnode_t* pParent;
|
pathnode_t* pParent;
|
||||||
float fCost;
|
float fCost;
|
||||||
float fHeuristic;
|
float fHeuristic;
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
float nodeCost;
|
float nodeCost;
|
||||||
@ -1659,6 +1660,7 @@ namespace IW5
|
|||||||
FxSpatialFrame frame;
|
FxSpatialFrame frame;
|
||||||
float radius;
|
float radius;
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned int nextFree;
|
unsigned int nextFree;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "CommonT5.h"
|
#include "CommonT5.h"
|
||||||
|
|
||||||
#include <cctype>
|
|
||||||
|
|
||||||
#include "Utils/Pack.h"
|
#include "Utils/Pack.h"
|
||||||
|
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
using namespace T5;
|
using namespace T5;
|
||||||
|
|
||||||
int Common::Com_HashKey(const char* str, const int maxLen)
|
int Common::Com_HashKey(const char* str, const int maxLen)
|
||||||
|
@ -18,4 +18,4 @@ namespace T5
|
|||||||
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
|
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
|
||||||
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
|
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
|
||||||
};
|
};
|
||||||
}
|
} // namespace T5
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "GameT5.h"
|
#include "GameT5.h"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include "T5.h"
|
#include "T5.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace T5;
|
using namespace T5;
|
||||||
|
|
||||||
GameT5 g_GameT5;
|
GameT5 g_GameT5;
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// clang-format off: Order of includes matters here
|
||||||
|
|
||||||
// #include <d3d9.h>
|
// #include <d3d9.h>
|
||||||
#include "Image/Texture.h"
|
#include "Image/Texture.h"
|
||||||
|
|
||||||
#include "T5_Assets.h"
|
#include "T5_Assets.h"
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
namespace T5
|
namespace T5
|
||||||
{
|
{
|
||||||
struct ScriptStringList
|
struct ScriptStringList
|
||||||
@ -110,4 +114,4 @@ namespace T5
|
|||||||
|
|
||||||
CFT_NUM_FIELD_TYPES
|
CFT_NUM_FIELD_TYPES
|
||||||
};
|
};
|
||||||
}
|
} // namespace T5
|
||||||
|
@ -3861,7 +3861,8 @@ namespace T5
|
|||||||
float fHipViewScatterMax;
|
float fHipViewScatterMax;
|
||||||
float fightDist;
|
float fightDist;
|
||||||
float maxDist;
|
float maxDist;
|
||||||
//const char *accuracyGraphName[2]; // TODO: Order is accuracyGraphName[0] -> accuracyGraphKnots[0] -> originalAccuracyGraphKnots[0] -> accuracyGraphName[1] -> ...
|
// 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.
|
// 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.
|
// 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* accuracyGraphName0;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "CommonT6.h"
|
#include "CommonT6.h"
|
||||||
|
|
||||||
#include <cctype>
|
|
||||||
|
|
||||||
#include "Utils/Pack.h"
|
#include "Utils/Pack.h"
|
||||||
|
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
using namespace T6;
|
using namespace T6;
|
||||||
|
|
||||||
int Common::Com_HashKey(const char* str, const int maxLen)
|
int Common::Com_HashKey(const char* str, const int maxLen)
|
||||||
|
@ -19,4 +19,4 @@ namespace T6
|
|||||||
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
|
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
|
||||||
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
|
static void Vec4UnpackGfxColor(const GfxColor& in, vec4_t* out);
|
||||||
};
|
};
|
||||||
}
|
} // namespace T6
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "GameT6.h"
|
#include "GameT6.h"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include "T6.h"
|
#include "T6.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace T6;
|
using namespace T6;
|
||||||
|
|
||||||
GameT6 g_GameT6;
|
GameT6 g_GameT6;
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// clang-format off: Order of includes matters here
|
||||||
|
|
||||||
// #include <d3d11.h>
|
// #include <d3d11.h>
|
||||||
#include "Image/Texture.h"
|
#include "Image/Texture.h"
|
||||||
|
|
||||||
#include "T6_Assets.h"
|
#include "T6_Assets.h"
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
namespace T6
|
namespace T6
|
||||||
{
|
{
|
||||||
struct ScriptStringList
|
struct ScriptStringList
|
||||||
@ -149,4 +153,4 @@ namespace T6
|
|||||||
AUFT_NUM_FIELD_TYPES,
|
AUFT_NUM_FIELD_TYPES,
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace T6
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -99,12 +99,10 @@ enum D3DFORMAT
|
|||||||
// 2.8 biased fixed point
|
// 2.8 biased fixed point
|
||||||
D3DFMT_A2B10G10R10_XR_BIAS = 119,
|
D3DFMT_A2B10G10R10_XR_BIAS = 119,
|
||||||
|
|
||||||
|
|
||||||
// Binary format indicating that the data has no inherent type
|
// Binary format indicating that the data has no inherent type
|
||||||
D3DFMT_BINARYBUFFER = 199,
|
D3DFMT_BINARYBUFFER = 199,
|
||||||
|
|
||||||
/* -- D3D9Ex only */
|
/* -- D3D9Ex only */
|
||||||
|
|
||||||
|
|
||||||
D3DFMT_FORCE_DWORD = 0x7fffffff
|
D3DFMT_FORCE_DWORD = 0x7fffffff
|
||||||
};
|
};
|
@ -4,10 +4,7 @@
|
|||||||
|
|
||||||
constexpr uint32_t MakeFourCc(const char ch0, const char ch1, const char ch2, const char ch3)
|
constexpr uint32_t MakeFourCc(const char ch0, const char ch1, const char ch2, const char ch3)
|
||||||
{
|
{
|
||||||
return static_cast<uint32_t>(ch0)
|
return static_cast<uint32_t>(ch0) | static_cast<uint32_t>(ch1) << 8 | static_cast<uint32_t>(ch2) << 16 | static_cast<uint32_t>(ch3) << 24;
|
||||||
| static_cast<uint32_t>(ch1) << 8
|
|
||||||
| static_cast<uint32_t>(ch2) << 16
|
|
||||||
| static_cast<uint32_t>(ch3) << 24;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum DDP_FLAGS
|
enum DDP_FLAGS
|
||||||
|
@ -22,10 +22,18 @@ DXGI_FORMAT ImageFormat::GetDxgiFormat() const
|
|||||||
return m_dxgi_format;
|
return m_dxgi_format;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageFormatUnsigned::ImageFormatUnsigned(const ImageFormatId id, const D3DFORMAT d3dFormat, const DXGI_FORMAT dxgiFormat,
|
ImageFormatUnsigned::ImageFormatUnsigned(const ImageFormatId id,
|
||||||
const unsigned bitsPerPixel, const unsigned rOffset, const unsigned rSize,
|
const D3DFORMAT d3dFormat,
|
||||||
const unsigned gOffset, const unsigned gSize, const unsigned bOffset,
|
const DXGI_FORMAT dxgiFormat,
|
||||||
const unsigned bSize, const unsigned aOffset, const unsigned aSize)
|
const unsigned bitsPerPixel,
|
||||||
|
const unsigned rOffset,
|
||||||
|
const unsigned rSize,
|
||||||
|
const unsigned gOffset,
|
||||||
|
const unsigned gSize,
|
||||||
|
const unsigned bOffset,
|
||||||
|
const unsigned bSize,
|
||||||
|
const unsigned aOffset,
|
||||||
|
const unsigned aSize)
|
||||||
: ImageFormat(id, d3dFormat, dxgiFormat),
|
: ImageFormat(id, d3dFormat, dxgiFormat),
|
||||||
m_bits_per_pixel(bitsPerPixel),
|
m_bits_per_pixel(bitsPerPixel),
|
||||||
m_r_offset(rOffset),
|
m_r_offset(rOffset),
|
||||||
@ -53,8 +61,7 @@ size_t ImageFormatUnsigned::GetPitch(const unsigned mipLevel, const unsigned wid
|
|||||||
return mipWidth * m_bits_per_pixel / 8;
|
return mipWidth * m_bits_per_pixel / 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ImageFormatUnsigned::GetSizeOfMipLevel(const unsigned mipLevel, const unsigned width, const unsigned height,
|
size_t ImageFormatUnsigned::GetSizeOfMipLevel(const unsigned mipLevel, const unsigned width, const unsigned height, const unsigned depth) const
|
||||||
const unsigned depth) const
|
|
||||||
{
|
{
|
||||||
unsigned mipWidth = width >> mipLevel;
|
unsigned mipWidth = width >> mipLevel;
|
||||||
unsigned mipHeight = height >> mipLevel;
|
unsigned mipHeight = height >> mipLevel;
|
||||||
@ -70,8 +77,8 @@ size_t ImageFormatUnsigned::GetSizeOfMipLevel(const unsigned mipLevel, const uns
|
|||||||
return mipWidth * mipHeight * mipDepth * m_bits_per_pixel / 8;
|
return mipWidth * mipHeight * mipDepth * m_bits_per_pixel / 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageFormatBlockCompressed::ImageFormatBlockCompressed(const ImageFormatId id, const D3DFORMAT d3dFormat, const DXGI_FORMAT dxgiFormat,
|
ImageFormatBlockCompressed::ImageFormatBlockCompressed(
|
||||||
const unsigned blockSize, const unsigned bitsPerBlock)
|
const ImageFormatId id, const D3DFORMAT d3dFormat, const DXGI_FORMAT dxgiFormat, const unsigned blockSize, const unsigned bitsPerBlock)
|
||||||
: ImageFormat(id, d3dFormat, dxgiFormat),
|
: ImageFormat(id, d3dFormat, dxgiFormat),
|
||||||
m_block_size(blockSize),
|
m_block_size(blockSize),
|
||||||
m_bits_per_block(bitsPerBlock)
|
m_bits_per_block(bitsPerBlock)
|
||||||
@ -95,8 +102,7 @@ size_t ImageFormatBlockCompressed::GetPitch(const unsigned mipLevel, const unsig
|
|||||||
return blockCount * m_bits_per_block / 8;
|
return blockCount * m_bits_per_block / 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ImageFormatBlockCompressed::GetSizeOfMipLevel(const unsigned mipLevel, const unsigned width,
|
size_t ImageFormatBlockCompressed::GetSizeOfMipLevel(const unsigned mipLevel, const unsigned width, const unsigned height, const unsigned depth) const
|
||||||
const unsigned height, const unsigned depth) const
|
|
||||||
{
|
{
|
||||||
unsigned mipWidth = width >> mipLevel;
|
unsigned mipWidth = width >> mipLevel;
|
||||||
unsigned mipHeight = height >> mipLevel;
|
unsigned mipHeight = height >> mipLevel;
|
||||||
@ -109,9 +115,7 @@ size_t ImageFormatBlockCompressed::GetSizeOfMipLevel(const unsigned mipLevel, co
|
|||||||
if (mipDepth == 0)
|
if (mipDepth == 0)
|
||||||
mipDepth = 1;
|
mipDepth = 1;
|
||||||
|
|
||||||
const unsigned blockCount = ((mipWidth + m_block_size - 1) / m_block_size)
|
const unsigned blockCount = ((mipWidth + m_block_size - 1) / m_block_size) * ((mipHeight + m_block_size - 1) / m_block_size) * mipDepth;
|
||||||
* ((mipHeight + m_block_size - 1) / m_block_size)
|
|
||||||
* mipDepth;
|
|
||||||
|
|
||||||
return blockCount * m_bits_per_block / 8;
|
return blockCount * m_bits_per_block / 8;
|
||||||
}
|
}
|
||||||
@ -138,10 +142,13 @@ bool ImageFormatUnsigned::HasA() const
|
|||||||
|
|
||||||
const ImageFormatUnsigned ImageFormat::FORMAT_R8_G8_B8(ImageFormatId::R8_G8_B8, D3DFMT_R8G8B8, DXGI_FORMAT_UNKNOWN, 24, 0, 8, 8, 8, 16, 8, 0, 0);
|
const ImageFormatUnsigned ImageFormat::FORMAT_R8_G8_B8(ImageFormatId::R8_G8_B8, D3DFMT_R8G8B8, DXGI_FORMAT_UNKNOWN, 24, 0, 8, 8, 8, 16, 8, 0, 0);
|
||||||
const ImageFormatUnsigned ImageFormat::FORMAT_B8_G8_R8_X8(ImageFormatId::B8_G8_R8_X8, D3DFMT_X8R8G8B8, DXGI_FORMAT_B8G8R8X8_UNORM, 32, 16, 8, 8, 8, 0, 8, 0, 0);
|
const ImageFormatUnsigned ImageFormat::FORMAT_B8_G8_R8_X8(ImageFormatId::B8_G8_R8_X8, D3DFMT_X8R8G8B8, DXGI_FORMAT_B8G8R8X8_UNORM, 32, 16, 8, 8, 8, 0, 8, 0, 0);
|
||||||
const ImageFormatUnsigned ImageFormat::FORMAT_R8_G8_B8_A8(ImageFormatId::R8_G8_B8_A8, D3DFMT_A8B8G8R8, DXGI_FORMAT_R8G8B8A8_UNORM, 32, 0, 8, 8, 8, 16, 8, 24, 8);
|
const ImageFormatUnsigned
|
||||||
const ImageFormatUnsigned ImageFormat::FORMAT_B8_G8_R8_A8(ImageFormatId::B8_G8_R8_A8, D3DFMT_A8R8G8B8, DXGI_FORMAT_B8G8R8A8_UNORM, 32, 16, 8, 8, 8, 0, 8, 24, 8);
|
ImageFormat::FORMAT_R8_G8_B8_A8(ImageFormatId::R8_G8_B8_A8, D3DFMT_A8B8G8R8, DXGI_FORMAT_R8G8B8A8_UNORM, 32, 0, 8, 8, 8, 16, 8, 24, 8);
|
||||||
|
const ImageFormatUnsigned
|
||||||
|
ImageFormat::FORMAT_B8_G8_R8_A8(ImageFormatId::B8_G8_R8_A8, D3DFMT_A8R8G8B8, DXGI_FORMAT_B8G8R8A8_UNORM, 32, 16, 8, 8, 8, 0, 8, 24, 8);
|
||||||
const ImageFormatUnsigned ImageFormat::FORMAT_A8(ImageFormatId::A8, D3DFMT_A8, DXGI_FORMAT_A8_UNORM, 8, 0, 0, 0, 0, 0, 0, 0, 8);
|
const ImageFormatUnsigned ImageFormat::FORMAT_A8(ImageFormatId::A8, D3DFMT_A8, DXGI_FORMAT_A8_UNORM, 8, 0, 0, 0, 0, 0, 0, 0, 8);
|
||||||
const ImageFormatUnsigned ImageFormat::FORMAT_R16_G16_B16_A16_FLOAT(ImageFormatId::R16_G16_B16_A16_FLOAT, D3DFMT_A16B16G16R16F, DXGI_FORMAT_R16G16B16A16_FLOAT, 128, 0, 0, 0, 0, 0, 0, 0, 8);
|
const ImageFormatUnsigned ImageFormat::FORMAT_R16_G16_B16_A16_FLOAT(
|
||||||
|
ImageFormatId::R16_G16_B16_A16_FLOAT, D3DFMT_A16B16G16R16F, DXGI_FORMAT_R16G16B16A16_FLOAT, 128, 0, 0, 0, 0, 0, 0, 0, 8);
|
||||||
const ImageFormatUnsigned ImageFormat::FORMAT_R8(ImageFormatId::R8, D3DFMT_L8, DXGI_FORMAT_R8_UNORM, 8, 0, 8, 0, 0, 0, 0, 0, 0);
|
const ImageFormatUnsigned ImageFormat::FORMAT_R8(ImageFormatId::R8, D3DFMT_L8, DXGI_FORMAT_R8_UNORM, 8, 0, 8, 0, 0, 0, 0, 0, 0);
|
||||||
const ImageFormatUnsigned ImageFormat::FORMAT_R8_A8(ImageFormatId::R8_A8, D3DFMT_A8L8, DXGI_FORMAT_UNKNOWN, 16, 0, 8, 0, 0, 0, 0, 8, 8);
|
const ImageFormatUnsigned ImageFormat::FORMAT_R8_A8(ImageFormatId::R8_A8, D3DFMT_A8L8, DXGI_FORMAT_UNKNOWN, 16, 0, 8, 0, 0, 0, 0, 8, 8);
|
||||||
const ImageFormatBlockCompressed ImageFormat::FORMAT_BC1(ImageFormatId::BC1, D3DFMT_DXT1, DXGI_FORMAT_BC1_UNORM, 4, 64);
|
const ImageFormatBlockCompressed ImageFormat::FORMAT_BC1(ImageFormatId::BC1, D3DFMT_DXT1, DXGI_FORMAT_BC1_UNORM, 4, 64);
|
||||||
@ -150,8 +157,7 @@ const ImageFormatBlockCompressed ImageFormat::FORMAT_BC3(ImageFormatId::BC3, D3D
|
|||||||
const ImageFormatBlockCompressed ImageFormat::FORMAT_BC4(ImageFormatId::BC4, D3DFMT_UNKNOWN, DXGI_FORMAT_BC4_UNORM, 4, 64);
|
const ImageFormatBlockCompressed ImageFormat::FORMAT_BC4(ImageFormatId::BC4, D3DFMT_UNKNOWN, DXGI_FORMAT_BC4_UNORM, 4, 64);
|
||||||
const ImageFormatBlockCompressed ImageFormat::FORMAT_BC5(ImageFormatId::BC5, D3DFMT_UNKNOWN, DXGI_FORMAT_BC5_UNORM, 4, 128);
|
const ImageFormatBlockCompressed ImageFormat::FORMAT_BC5(ImageFormatId::BC5, D3DFMT_UNKNOWN, DXGI_FORMAT_BC5_UNORM, 4, 128);
|
||||||
|
|
||||||
const ImageFormat* const ImageFormat::ALL_FORMATS[static_cast<unsigned>(ImageFormatId::MAX)]
|
const ImageFormat* const ImageFormat::ALL_FORMATS[static_cast<unsigned>(ImageFormatId::MAX)]{
|
||||||
{
|
|
||||||
&FORMAT_R8_G8_B8,
|
&FORMAT_R8_G8_B8,
|
||||||
&FORMAT_B8_G8_R8_X8,
|
&FORMAT_B8_G8_R8_X8,
|
||||||
&FORMAT_R8_G8_B8_A8,
|
&FORMAT_R8_G8_B8_A8,
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <cstddef>
|
|
||||||
#include "D3DFormat.h"
|
#include "D3DFormat.h"
|
||||||
#include "DxgiFormat.h"
|
#include "DxgiFormat.h"
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
enum class ImageFormatId
|
enum class ImageFormatId
|
||||||
{
|
{
|
||||||
UNKNOWN = -1,
|
UNKNOWN = -1,
|
||||||
@ -84,9 +85,18 @@ public:
|
|||||||
unsigned m_a_offset;
|
unsigned m_a_offset;
|
||||||
unsigned m_a_size;
|
unsigned m_a_size;
|
||||||
|
|
||||||
ImageFormatUnsigned(ImageFormatId id, D3DFORMAT d3dFormat, DXGI_FORMAT dxgiFormat, unsigned bitsPerPixel, unsigned rOffset,
|
ImageFormatUnsigned(ImageFormatId id,
|
||||||
unsigned rSize, unsigned gOffset, unsigned gSize, unsigned bOffset, unsigned bSize,
|
D3DFORMAT d3dFormat,
|
||||||
unsigned aOffset, unsigned aSize);
|
DXGI_FORMAT dxgiFormat,
|
||||||
|
unsigned bitsPerPixel,
|
||||||
|
unsigned rOffset,
|
||||||
|
unsigned rSize,
|
||||||
|
unsigned gOffset,
|
||||||
|
unsigned gSize,
|
||||||
|
unsigned bOffset,
|
||||||
|
unsigned bSize,
|
||||||
|
unsigned aOffset,
|
||||||
|
unsigned aSize);
|
||||||
|
|
||||||
ImageFormatType GetType() const override;
|
ImageFormatType GetType() const override;
|
||||||
size_t GetPitch(unsigned mipLevel, unsigned width) const override;
|
size_t GetPitch(unsigned mipLevel, unsigned width) const override;
|
||||||
|
@ -54,7 +54,7 @@ namespace iwi6
|
|||||||
IMG_FLAG_RENDER_TARGET = 1 << 17,
|
IMG_FLAG_RENDER_TARGET = 1 << 17,
|
||||||
IMG_FLAG_SYSTEMMEM = 1 << 18
|
IMG_FLAG_SYSTEMMEM = 1 << 18
|
||||||
};
|
};
|
||||||
}
|
} // namespace iwi6
|
||||||
|
|
||||||
// IW4
|
// IW4
|
||||||
namespace iwi8
|
namespace iwi8
|
||||||
@ -122,7 +122,7 @@ namespace iwi8
|
|||||||
IMG_FLAG_RENDER_TARGET = 1 << 25,
|
IMG_FLAG_RENDER_TARGET = 1 << 25,
|
||||||
IMG_FLAG_SYSTEMMEM = 1 << 26
|
IMG_FLAG_SYSTEMMEM = 1 << 26
|
||||||
};
|
};
|
||||||
}
|
} // namespace iwi8
|
||||||
|
|
||||||
// T5
|
// T5
|
||||||
namespace iwi13
|
namespace iwi13
|
||||||
@ -177,7 +177,7 @@ namespace iwi13
|
|||||||
IMG_FLAG_SYSTEMMEM = 1 << 18,
|
IMG_FLAG_SYSTEMMEM = 1 << 18,
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace iwi13
|
||||||
|
|
||||||
// T6
|
// T6
|
||||||
namespace iwi27
|
namespace iwi27
|
||||||
@ -232,4 +232,4 @@ namespace iwi27
|
|||||||
IMG_FLAG_MULTISAMPLE = 1 << 18,
|
IMG_FLAG_MULTISAMPLE = 1 << 18,
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace iwi27
|
||||||
|
@ -260,8 +260,7 @@ Texture3D::Texture3D(const ImageFormat* format, const unsigned width, const unsi
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture3D::Texture3D(const ImageFormat* format, const unsigned width, const unsigned height, const unsigned depth,
|
Texture3D::Texture3D(const ImageFormat* format, const unsigned width, const unsigned height, const unsigned depth, const bool mipMaps)
|
||||||
const bool mipMaps)
|
|
||||||
: Texture(format, mipMaps)
|
: Texture(format, mipMaps)
|
||||||
{
|
{
|
||||||
m_width = width;
|
m_width = width;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ImageFormat.h"
|
#include "ImageFormat.h"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
enum class TextureType
|
enum class TextureType
|
||||||
|
@ -44,8 +44,7 @@ void TextureConverter::SetPixelFunctions(const unsigned inBitCount, const unsign
|
|||||||
|
|
||||||
for (auto pixelOffset = 0u; pixelOffset < bitCount; pixelOffset += 8)
|
for (auto pixelOffset = 0u; pixelOffset < bitCount; pixelOffset += 8)
|
||||||
{
|
{
|
||||||
result |= (static_cast<uint64_t>(*(static_cast<const uint8_t*>(offset) + (pixelOffset / 8))) <<
|
result |= (static_cast<uint64_t>(*(static_cast<const uint8_t*>(offset) + (pixelOffset / 8))) << pixelOffset);
|
||||||
pixelOffset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -99,9 +98,7 @@ void TextureConverter::SetPixelFunctions(const unsigned inBitCount, const unsign
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
assert(false);
|
assert(false);
|
||||||
m_write_pixel_func = [](void* offset, uint64_t pixel, unsigned bitCount)
|
m_write_pixel_func = [](void* offset, uint64_t pixel, unsigned bitCount) {};
|
||||||
{
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -120,18 +117,16 @@ void TextureConverter::CreateOutputTexture()
|
|||||||
switch (m_input_texture->GetTextureType())
|
switch (m_input_texture->GetTextureType())
|
||||||
{
|
{
|
||||||
case TextureType::T_2D:
|
case TextureType::T_2D:
|
||||||
m_output_texture = new Texture2D(m_output_format, m_input_texture->GetWidth(), m_input_texture->GetHeight(),
|
m_output_texture = new Texture2D(m_output_format, m_input_texture->GetWidth(), m_input_texture->GetHeight(), m_input_texture->HasMipMaps());
|
||||||
m_input_texture->HasMipMaps());
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TextureType::T_CUBE:
|
case TextureType::T_CUBE:
|
||||||
m_output_texture = new TextureCube(m_output_format, m_input_texture->GetWidth(), m_input_texture->GetHeight(),
|
m_output_texture = new TextureCube(m_output_format, m_input_texture->GetWidth(), m_input_texture->GetHeight(), m_input_texture->HasMipMaps());
|
||||||
m_input_texture->HasMipMaps());
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TextureType::T_3D:
|
case TextureType::T_3D:
|
||||||
m_output_texture = new Texture3D(m_output_format, m_input_texture->GetWidth(), m_input_texture->GetHeight(),
|
m_output_texture = new Texture3D(
|
||||||
m_input_texture->GetDepth(), m_input_texture->HasMipMaps());
|
m_output_format, m_input_texture->GetWidth(), m_input_texture->GetHeight(), m_input_texture->GetDepth(), m_input_texture->HasMipMaps());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
@ -166,8 +161,7 @@ void TextureConverter::ReorderUnsignedToUnsigned() const
|
|||||||
const auto outputBytePerPixel = outputFormat->m_bits_per_pixel / 8;
|
const auto outputBytePerPixel = outputFormat->m_bits_per_pixel / 8;
|
||||||
|
|
||||||
auto outputOffset = 0u;
|
auto outputOffset = 0u;
|
||||||
for (auto inputOffset = 0u; inputOffset < mipLevelSize; inputOffset += inputBytePerPixel, outputOffset +=
|
for (auto inputOffset = 0u; inputOffset < mipLevelSize; inputOffset += inputBytePerPixel, outputOffset += outputBytePerPixel)
|
||||||
outputBytePerPixel)
|
|
||||||
{
|
{
|
||||||
uint64_t outPixel = 0;
|
uint64_t outPixel = 0;
|
||||||
const auto inPixel = m_read_pixel_func(&inputBuffer[inputOffset], inputFormat->m_bits_per_pixel);
|
const auto inPixel = m_read_pixel_func(&inputBuffer[inputOffset], inputFormat->m_bits_per_pixel);
|
||||||
@ -196,9 +190,7 @@ void TextureConverter::ConvertUnsignedToUnsigned()
|
|||||||
|
|
||||||
SetPixelFunctions(inputFormat->m_bits_per_pixel, outputFormat->m_bits_per_pixel);
|
SetPixelFunctions(inputFormat->m_bits_per_pixel, outputFormat->m_bits_per_pixel);
|
||||||
|
|
||||||
if (inputFormat->m_r_size == outputFormat->m_r_size
|
if (inputFormat->m_r_size == outputFormat->m_r_size && inputFormat->m_g_size == outputFormat->m_g_size && inputFormat->m_b_size == outputFormat->m_b_size
|
||||||
&& inputFormat->m_g_size == outputFormat->m_g_size
|
|
||||||
&& inputFormat->m_b_size == outputFormat->m_b_size
|
|
||||||
&& inputFormat->m_a_size == outputFormat->m_a_size)
|
&& inputFormat->m_a_size == outputFormat->m_a_size)
|
||||||
{
|
{
|
||||||
ReorderUnsignedToUnsigned();
|
ReorderUnsignedToUnsigned();
|
||||||
@ -214,8 +206,7 @@ Texture* TextureConverter::Convert()
|
|||||||
{
|
{
|
||||||
CreateOutputTexture();
|
CreateOutputTexture();
|
||||||
|
|
||||||
if (m_input_format->GetType() == ImageFormatType::UNSIGNED
|
if (m_input_format->GetType() == ImageFormatType::UNSIGNED && m_output_format->GetType() == ImageFormatType::UNSIGNED)
|
||||||
&& m_output_format->GetType() == ImageFormatType::UNSIGNED)
|
|
||||||
{
|
{
|
||||||
ConvertUnsignedToUnsigned();
|
ConvertUnsignedToUnsigned();
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
#include "Texture.h"
|
#include "Texture.h"
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
class TextureConverter
|
class TextureConverter
|
||||||
{
|
{
|
||||||
Texture* m_input_texture;
|
Texture* m_input_texture;
|
||||||
@ -23,7 +23,6 @@ class TextureConverter
|
|||||||
void ConvertUnsignedToUnsigned();
|
void ConvertUnsignedToUnsigned();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TextureConverter(Texture* inputTexture, const ImageFormat* targetFormat);
|
TextureConverter(Texture* inputTexture, const ImageFormat* targetFormat);
|
||||||
|
|
||||||
Texture* Convert();
|
Texture* Convert();
|
||||||
|
@ -37,7 +37,9 @@ namespace state_map
|
|||||||
|
|
||||||
for (auto& resultVar : entry.m_result_vars)
|
for (auto& resultVar : entry.m_result_vars)
|
||||||
{
|
{
|
||||||
const auto correspondingVar = std::find_if(layout.m_var_layout.m_vars.begin(), layout.m_var_layout.m_vars.end(), [&resultVar](const StateMapLayoutVar& var)
|
const auto correspondingVar = std::find_if(layout.m_var_layout.m_vars.begin(),
|
||||||
|
layout.m_var_layout.m_vars.end(),
|
||||||
|
[&resultVar](const StateMapLayoutVar& var)
|
||||||
{
|
{
|
||||||
return var.m_name == resultVar;
|
return var.m_name == resultVar;
|
||||||
});
|
});
|
||||||
@ -48,7 +50,7 @@ namespace state_map
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
} // namespace state_map
|
||||||
|
|
||||||
StateMapLayoutEntry::StateMapLayoutEntry(std::string name, const size_t stateBitsIndex, const size_t stateBitsMask, std::vector<std::string> resultVars)
|
StateMapLayoutEntry::StateMapLayoutEntry(std::string name, const size_t stateBitsIndex, const size_t stateBitsMask, std::vector<std::string> resultVars)
|
||||||
: m_name(std::move(name)),
|
: m_name(std::move(name)),
|
||||||
|
@ -60,4 +60,4 @@ namespace state_map
|
|||||||
const StateMapLayoutEntries& m_entry_layout;
|
const StateMapLayoutEntries& m_entry_layout;
|
||||||
const StateMapLayoutVars& m_var_layout;
|
const StateMapLayoutVars& m_var_layout;
|
||||||
};
|
};
|
||||||
}
|
} // namespace state_map
|
||||||
|
@ -10,8 +10,7 @@ float HalfFloat::ToFloat(const half_float_t half)
|
|||||||
float f;
|
float f;
|
||||||
} result{};
|
} result{};
|
||||||
|
|
||||||
result.u = ((half << 16) & 0x80000000) | (((((half << 14) & 0xFFFC000)
|
result.u = ((half << 16) & 0x80000000) | (((((half << 14) & 0xFFFC000) - (~(half << 14) & 0x10000000)) ^ 0x80000000) >> 1);
|
||||||
- (~(half << 14) & 0x10000000)) ^ 0x80000000) >> 1);
|
|
||||||
return result.f;
|
return result.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include "Pack.h"
|
#include "Pack.h"
|
||||||
|
|
||||||
|
#include "HalfFloat.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "HalfFloat.h"
|
|
||||||
|
|
||||||
union PackUtil32
|
union PackUtil32
|
||||||
{
|
{
|
||||||
uint32_t u;
|
uint32_t u;
|
||||||
@ -16,8 +16,7 @@ union PackUtil32
|
|||||||
|
|
||||||
uint32_t Pack32::Vec2PackTexCoords(const float* in)
|
uint32_t Pack32::Vec2PackTexCoords(const float* in)
|
||||||
{
|
{
|
||||||
return static_cast<uint32_t>(HalfFloat::ToHalf(in[0])) << 16
|
return static_cast<uint32_t>(HalfFloat::ToHalf(in[0])) << 16 | HalfFloat::ToHalf(in[1]);
|
||||||
| HalfFloat::ToHalf(in[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Pack32::Vec3PackUnitVec(const float* in)
|
uint32_t Pack32::Vec3PackUnitVec(const float* in)
|
||||||
@ -28,10 +27,8 @@ uint32_t Pack32::Vec3PackUnitVec(const float* in)
|
|||||||
|
|
||||||
uint32_t Pack32::Vec4PackGfxColor(const float* in)
|
uint32_t Pack32::Vec4PackGfxColor(const float* in)
|
||||||
{
|
{
|
||||||
return static_cast<uint8_t>(std::clamp(in[0], 0.0f, 1.0f) * 255.0f)
|
return static_cast<uint8_t>(std::clamp(in[0], 0.0f, 1.0f) * 255.0f) | static_cast<uint8_t>(std::clamp(in[1], 0.0f, 1.0f) * 255.0f) << 8
|
||||||
| static_cast<uint8_t>(std::clamp(in[1], 0.0f, 1.0f) * 255.0f) << 8
|
| static_cast<uint8_t>(std::clamp(in[2], 0.0f, 1.0f) * 255.0f) << 16 | static_cast<uint8_t>(std::clamp(in[3], 0.0f, 1.0f) * 255.0f) << 24;
|
||||||
| static_cast<uint8_t>(std::clamp(in[2], 0.0f, 1.0f) * 255.0f) << 16
|
|
||||||
| static_cast<uint8_t>(std::clamp(in[3], 0.0f, 1.0f) * 255.0f) << 24;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pack32::Vec2UnpackTexCoordsUV(const uint32_t in, float* out)
|
void Pack32::Vec2UnpackTexCoordsUV(const uint32_t in, float* out)
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
#include "Crypto.h"
|
#include "Crypto.h"
|
||||||
|
|
||||||
#include "Impl/AlgorithmRSA.h"
|
#include "Impl/AlgorithmRSA.h"
|
||||||
#include "Impl/AlgorithmSHA1.h"
|
#include "Impl/AlgorithmSHA1.h"
|
||||||
#include "Impl/AlgorithmSalsa20.h"
|
|
||||||
#include "Impl/AlgorithmSHA256.h"
|
#include "Impl/AlgorithmSHA256.h"
|
||||||
|
#include "Impl/AlgorithmSalsa20.h"
|
||||||
|
|
||||||
std::unique_ptr<IHashFunction> Crypto::CreateSHA1()
|
std::unique_ptr<IHashFunction> Crypto::CreateSHA1()
|
||||||
{
|
{
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "IHashFunction.h"
|
||||||
|
#include "IPublicKeyAlgorithm.h"
|
||||||
|
#include "IStreamCipher.h"
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
#include "IHashFunction.h"
|
|
||||||
#include "IStreamCipher.h"
|
|
||||||
#include "IPublicKeyAlgorithm.h"
|
|
||||||
|
|
||||||
class Crypto
|
class Crypto
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
class IPublicKeyAlgorithm
|
class IPublicKeyAlgorithm
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
class IStreamCipher
|
class IStreamCipher
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
#include "AlgorithmRSA.h"
|
#include "AlgorithmRSA.h"
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
#include "CryptoLibrary.h"
|
#include "CryptoLibrary.h"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
class AlgorithmRSA::AlgorithmRSAImpl
|
class AlgorithmRSA::AlgorithmRSAImpl
|
||||||
{
|
{
|
||||||
rsa_key m_key{};
|
rsa_key m_key{};
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "IPublicKeyAlgorithm.h"
|
|
||||||
#include "Crypto.h"
|
#include "Crypto.h"
|
||||||
|
#include "IPublicKeyAlgorithm.h"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class AlgorithmRSA final : public IPublicKeyAlgorithm
|
class AlgorithmRSA final : public IPublicKeyAlgorithm
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "AlgorithmSHA1.h"
|
#include "AlgorithmSHA1.h"
|
||||||
|
|
||||||
#include "CryptoLibrary.h"
|
#include "CryptoLibrary.h"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class AlgorithmSHA1::AlgorithmSHA1Impl
|
class AlgorithmSHA1::AlgorithmSHA1Impl
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "AlgorithmSHA256.h"
|
#include "AlgorithmSHA256.h"
|
||||||
|
|
||||||
#include "CryptoLibrary.h"
|
#include "CryptoLibrary.h"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class AlgorithmSHA256::Impl
|
class AlgorithmSHA256::Impl
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "AlgorithmSalsa20.h"
|
#include "AlgorithmSalsa20.h"
|
||||||
|
|
||||||
#include "salsa20.h"
|
#include "salsa20.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "CryptoLibrary.h"
|
#include "CryptoLibrary.h"
|
||||||
|
|
||||||
#include "tommath.h"
|
#include "tommath.h"
|
||||||
|
|
||||||
void CryptoLibrary::Init()
|
void CryptoLibrary::Init()
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#include "ZoneCreatorIW3.h"
|
#include "ZoneCreatorIW3.h"
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "ObjLoading.h"
|
|
||||||
#include "AssetLoading/AssetLoadingContext.h"
|
#include "AssetLoading/AssetLoadingContext.h"
|
||||||
#include "Game/IW3/GameIW3.h"
|
|
||||||
#include "Game/IW3/GameAssetPoolIW3.h"
|
#include "Game/IW3/GameAssetPoolIW3.h"
|
||||||
|
#include "Game/IW3/GameIW3.h"
|
||||||
|
#include "ObjLoading.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
using namespace IW3;
|
using namespace IW3;
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <unordered_map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "Zone/ZoneTypes.h"
|
#include "Zone/ZoneTypes.h"
|
||||||
#include "ZoneCreation/IZoneCreator.h"
|
#include "ZoneCreation/IZoneCreator.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace IW3
|
namespace IW3
|
||||||
{
|
{
|
||||||
class ZoneCreator final : public IZoneCreator
|
class ZoneCreator final : public IZoneCreator
|
||||||
@ -22,4 +22,4 @@ namespace IW3
|
|||||||
_NODISCARD bool SupportsGame(const std::string& gameName) const override;
|
_NODISCARD bool SupportsGame(const std::string& gameName) const override;
|
||||||
_NODISCARD std::unique_ptr<Zone> CreateZoneForDefinition(ZoneCreationContext& context) const override;
|
_NODISCARD std::unique_ptr<Zone> CreateZoneForDefinition(ZoneCreationContext& context) const override;
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW3
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include "ZoneCreatorIW4.h"
|
#include "ZoneCreatorIW4.h"
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "ObjLoading.h"
|
|
||||||
#include "Game/IW4/GameIW4.h"
|
|
||||||
#include "Game/IW4/GameAssetPoolIW4.h"
|
#include "Game/IW4/GameAssetPoolIW4.h"
|
||||||
|
#include "Game/IW4/GameIW4.h"
|
||||||
|
#include "ObjLoading.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
using namespace IW4;
|
using namespace IW4;
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <unordered_map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "Zone/ZoneTypes.h"
|
#include "Zone/ZoneTypes.h"
|
||||||
#include "ZoneCreation/IZoneCreator.h"
|
#include "ZoneCreation/IZoneCreator.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace IW4
|
namespace IW4
|
||||||
{
|
{
|
||||||
class ZoneCreator final : public IZoneCreator
|
class ZoneCreator final : public IZoneCreator
|
||||||
@ -22,4 +22,4 @@ namespace IW4
|
|||||||
_NODISCARD bool SupportsGame(const std::string& gameName) const override;
|
_NODISCARD bool SupportsGame(const std::string& gameName) const override;
|
||||||
_NODISCARD std::unique_ptr<Zone> CreateZoneForDefinition(ZoneCreationContext& context) const override;
|
_NODISCARD std::unique_ptr<Zone> CreateZoneForDefinition(ZoneCreationContext& context) const override;
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW4
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include "ZoneCreatorIW5.h"
|
#include "ZoneCreatorIW5.h"
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "ObjLoading.h"
|
|
||||||
#include "Game/IW5/GameIW5.h"
|
|
||||||
#include "Game/IW5/GameAssetPoolIW5.h"
|
#include "Game/IW5/GameAssetPoolIW5.h"
|
||||||
|
#include "Game/IW5/GameIW5.h"
|
||||||
|
#include "ObjLoading.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
using namespace IW5;
|
using namespace IW5;
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <unordered_map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "Zone/ZoneTypes.h"
|
#include "Zone/ZoneTypes.h"
|
||||||
#include "ZoneCreation/IZoneCreator.h"
|
#include "ZoneCreation/IZoneCreator.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace IW5
|
namespace IW5
|
||||||
{
|
{
|
||||||
class ZoneCreator final : public IZoneCreator
|
class ZoneCreator final : public IZoneCreator
|
||||||
@ -22,4 +22,4 @@ namespace IW5
|
|||||||
_NODISCARD bool SupportsGame(const std::string& gameName) const override;
|
_NODISCARD bool SupportsGame(const std::string& gameName) const override;
|
||||||
_NODISCARD std::unique_ptr<Zone> CreateZoneForDefinition(ZoneCreationContext& context) const override;
|
_NODISCARD std::unique_ptr<Zone> CreateZoneForDefinition(ZoneCreationContext& context) const override;
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW5
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#include "ZoneCreatorT5.h"
|
#include "ZoneCreatorT5.h"
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "ObjLoading.h"
|
|
||||||
#include "AssetLoading/AssetLoadingContext.h"
|
#include "AssetLoading/AssetLoadingContext.h"
|
||||||
#include "Game/T5/GameT5.h"
|
|
||||||
#include "Game/T5/GameAssetPoolT5.h"
|
#include "Game/T5/GameAssetPoolT5.h"
|
||||||
|
#include "Game/T5/GameT5.h"
|
||||||
|
#include "ObjLoading.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
using namespace T5;
|
using namespace T5;
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <unordered_map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "Zone/ZoneTypes.h"
|
#include "Zone/ZoneTypes.h"
|
||||||
#include "ZoneCreation/IZoneCreator.h"
|
#include "ZoneCreation/IZoneCreator.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace T5
|
namespace T5
|
||||||
{
|
{
|
||||||
class ZoneCreator final : public IZoneCreator
|
class ZoneCreator final : public IZoneCreator
|
||||||
@ -22,4 +22,4 @@ namespace T5
|
|||||||
_NODISCARD bool SupportsGame(const std::string& gameName) const override;
|
_NODISCARD bool SupportsGame(const std::string& gameName) const override;
|
||||||
_NODISCARD std::unique_ptr<Zone> CreateZoneForDefinition(ZoneCreationContext& context) const override;
|
_NODISCARD std::unique_ptr<Zone> CreateZoneForDefinition(ZoneCreationContext& context) const override;
|
||||||
};
|
};
|
||||||
}
|
} // namespace T5
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
#include "ZoneCreatorT6.h"
|
#include "ZoneCreatorT6.h"
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "ObjLoading.h"
|
|
||||||
#include "Game/T6/CommonT6.h"
|
#include "Game/T6/CommonT6.h"
|
||||||
#include "Game/T6/T6.h"
|
|
||||||
#include "Game/T6/GameT6.h"
|
|
||||||
#include "Game/T6/GameAssetPoolT6.h"
|
#include "Game/T6/GameAssetPoolT6.h"
|
||||||
|
#include "Game/T6/GameT6.h"
|
||||||
|
#include "Game/T6/T6.h"
|
||||||
|
#include "ObjLoading.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
using namespace T6;
|
using namespace T6;
|
||||||
|
|
||||||
@ -87,12 +87,7 @@ void ZoneCreator::HandleMetadata(Zone* zone, const ZoneCreationContext& context)
|
|||||||
keyHash = Common::Com_HashKey(strValue.c_str(), 64);
|
keyHash = Common::Com_HashKey(strValue.c_str(), 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyValuePair kvp
|
KeyValuePair kvp{keyHash, Common::Com_HashKey(zone->m_name.c_str(), 64), zone->GetMemory()->Dup(metaData->m_value.c_str())};
|
||||||
{
|
|
||||||
keyHash,
|
|
||||||
Common::Com_HashKey(zone->m_name.c_str(), 64),
|
|
||||||
zone->GetMemory()->Dup(metaData->m_value.c_str())
|
|
||||||
};
|
|
||||||
kvpList.push_back(kvp);
|
kvpList.push_back(kvp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <unordered_map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "Zone/ZoneTypes.h"
|
#include "Zone/ZoneTypes.h"
|
||||||
#include "ZoneCreation/IZoneCreator.h"
|
#include "ZoneCreation/IZoneCreator.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace T6
|
namespace T6
|
||||||
{
|
{
|
||||||
class ZoneCreator final : public IZoneCreator
|
class ZoneCreator final : public IZoneCreator
|
||||||
@ -23,4 +23,4 @@ namespace T6
|
|||||||
_NODISCARD bool SupportsGame(const std::string& gameName) const override;
|
_NODISCARD bool SupportsGame(const std::string& gameName) const override;
|
||||||
_NODISCARD std::unique_ptr<Zone> CreateZoneForDefinition(ZoneCreationContext& context) const override;
|
_NODISCARD std::unique_ptr<Zone> CreateZoneForDefinition(ZoneCreationContext& context) const override;
|
||||||
};
|
};
|
||||||
}
|
} // namespace T6
|
||||||
|
@ -1,45 +1,43 @@
|
|||||||
#include "Linker.h"
|
#include "Linker.h"
|
||||||
|
|
||||||
#include <set>
|
|
||||||
#include <regex>
|
|
||||||
#include <filesystem>
|
|
||||||
#include <fstream>
|
|
||||||
#include <deque>
|
|
||||||
|
|
||||||
#include "Utils/ClassUtils.h"
|
|
||||||
#include "Utils/Arguments/ArgumentParser.h"
|
|
||||||
#include "ZoneLoading.h"
|
|
||||||
#include "ObjWriting.h"
|
|
||||||
#include "ObjLoading.h"
|
|
||||||
#include "SearchPath/SearchPaths.h"
|
|
||||||
#include "ObjContainer/IWD/IWD.h"
|
|
||||||
#include "LinkerArgs.h"
|
|
||||||
#include "LinkerSearchPaths.h"
|
|
||||||
#include "ZoneWriting.h"
|
|
||||||
#include "Game/IW3/ZoneCreatorIW3.h"
|
#include "Game/IW3/ZoneCreatorIW3.h"
|
||||||
#include "ZoneCreation/ZoneCreationContext.h"
|
|
||||||
#include "ZoneCreation/IZoneCreator.h"
|
|
||||||
#include "Game/IW4/ZoneCreatorIW4.h"
|
#include "Game/IW4/ZoneCreatorIW4.h"
|
||||||
#include "Game/IW5/ZoneCreatorIW5.h"
|
#include "Game/IW5/ZoneCreatorIW5.h"
|
||||||
#include "Game/T5/ZoneCreatorT5.h"
|
#include "Game/T5/ZoneCreatorT5.h"
|
||||||
#include "Game/T6/ZoneCreatorT6.h"
|
#include "Game/T6/ZoneCreatorT6.h"
|
||||||
|
#include "LinkerArgs.h"
|
||||||
|
#include "LinkerSearchPaths.h"
|
||||||
#include "ObjContainer/IPak/IPakWriter.h"
|
#include "ObjContainer/IPak/IPakWriter.h"
|
||||||
|
#include "ObjContainer/IWD/IWD.h"
|
||||||
|
#include "ObjLoading.h"
|
||||||
|
#include "ObjWriting.h"
|
||||||
|
#include "SearchPath/SearchPaths.h"
|
||||||
|
#include "Utils/Arguments/ArgumentParser.h"
|
||||||
|
#include "Utils/ClassUtils.h"
|
||||||
#include "Utils/ObjFileStream.h"
|
#include "Utils/ObjFileStream.h"
|
||||||
#include "Utils/StringUtils.h"
|
#include "Utils/StringUtils.h"
|
||||||
#include "Zone/AssetList/AssetList.h"
|
#include "Zone/AssetList/AssetList.h"
|
||||||
#include "Zone/AssetList/AssetListStream.h"
|
#include "Zone/AssetList/AssetListStream.h"
|
||||||
#include "Zone/Definition/ZoneDefinitionStream.h"
|
#include "Zone/Definition/ZoneDefinitionStream.h"
|
||||||
|
#include "ZoneCreation/IZoneCreator.h"
|
||||||
|
#include "ZoneCreation/ZoneCreationContext.h"
|
||||||
|
#include "ZoneLoading.h"
|
||||||
|
#include "ZoneWriting.h"
|
||||||
|
|
||||||
|
#include <deque>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <fstream>
|
||||||
|
#include <regex>
|
||||||
|
#include <set>
|
||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
const IZoneCreator* const ZONE_CREATORS[]
|
const IZoneCreator* const ZONE_CREATORS[]{
|
||||||
{
|
|
||||||
new IW3::ZoneCreator(),
|
new IW3::ZoneCreator(),
|
||||||
new IW4::ZoneCreator(),
|
new IW4::ZoneCreator(),
|
||||||
new IW5::ZoneCreator(),
|
new IW5::ZoneCreator(),
|
||||||
new T5::ZoneCreator(),
|
new T5::ZoneCreator(),
|
||||||
new T6::ZoneCreator()
|
new T6::ZoneCreator(),
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class ProjectType
|
enum class ProjectType
|
||||||
@ -51,11 +49,10 @@ enum class ProjectType
|
|||||||
MAX
|
MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr const char* PROJECT_TYPE_NAMES[static_cast<unsigned>(ProjectType::MAX)]
|
constexpr const char* PROJECT_TYPE_NAMES[static_cast<unsigned>(ProjectType::MAX)]{
|
||||||
{
|
|
||||||
"none",
|
"none",
|
||||||
"fastfile",
|
"fastfile",
|
||||||
"ipak"
|
"ipak",
|
||||||
};
|
};
|
||||||
|
|
||||||
class LinkerImpl final : public Linker
|
class LinkerImpl final : public Linker
|
||||||
@ -367,7 +364,10 @@ class LinkerImpl final : public Linker
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<Zone> CreateZoneForDefinition(const std::string& targetName, ZoneDefinition& zoneDefinition, ISearchPath* assetSearchPath, ISearchPath* gdtSearchPath,
|
std::unique_ptr<Zone> CreateZoneForDefinition(const std::string& targetName,
|
||||||
|
ZoneDefinition& zoneDefinition,
|
||||||
|
ISearchPath* assetSearchPath,
|
||||||
|
ISearchPath* gdtSearchPath,
|
||||||
ISearchPath* sourceSearchPath) const
|
ISearchPath* sourceSearchPath) const
|
||||||
{
|
{
|
||||||
const auto context = std::make_unique<ZoneCreationContext>(assetSearchPath, &zoneDefinition);
|
const auto context = std::make_unique<ZoneCreationContext>(assetSearchPath, &zoneDefinition);
|
||||||
@ -412,7 +412,11 @@ class LinkerImpl final : public Linker
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BuildFastFile(const std::string& projectName, const std::string& targetName, ZoneDefinition& zoneDefinition, SearchPaths& assetSearchPaths, SearchPaths& gdtSearchPaths,
|
bool BuildFastFile(const std::string& projectName,
|
||||||
|
const std::string& targetName,
|
||||||
|
ZoneDefinition& zoneDefinition,
|
||||||
|
SearchPaths& assetSearchPaths,
|
||||||
|
SearchPaths& gdtSearchPaths,
|
||||||
SearchPaths& sourceSearchPaths) const
|
SearchPaths& sourceSearchPaths) const
|
||||||
{
|
{
|
||||||
const auto zone = CreateZoneForDefinition(targetName, zoneDefinition, &assetSearchPaths, &gdtSearchPaths, &sourceSearchPaths);
|
const auto zone = CreateZoneForDefinition(targetName, zoneDefinition, &assetSearchPaths, &gdtSearchPaths, &sourceSearchPaths);
|
||||||
@ -460,7 +464,9 @@ class LinkerImpl final : public Linker
|
|||||||
|
|
||||||
bool BuildReferencedTargets(const std::string& projectName, const std::string& targetName, const ZoneDefinition& zoneDefinition)
|
bool BuildReferencedTargets(const std::string& projectName, const std::string& targetName, const ZoneDefinition& zoneDefinition)
|
||||||
{
|
{
|
||||||
return std::all_of(zoneDefinition.m_targets_to_build.begin(), zoneDefinition.m_targets_to_build.end(), [this, &projectName, &targetName](const std::string& buildTargetName)
|
return std::all_of(zoneDefinition.m_targets_to_build.begin(),
|
||||||
|
zoneDefinition.m_targets_to_build.end(),
|
||||||
|
[this, &projectName, &targetName](const std::string& buildTargetName)
|
||||||
{
|
{
|
||||||
if (buildTargetName == targetName)
|
if (buildTargetName == targetName)
|
||||||
{
|
{
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
#include "LinkerArgs.h"
|
#include "LinkerArgs.h"
|
||||||
|
|
||||||
|
#include "ObjLoading.h"
|
||||||
|
#include "ObjWriting.h"
|
||||||
|
#include "Utils/Arguments/UsageInformation.h"
|
||||||
|
#include "Utils/FileUtils.h"
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include "Utils/Arguments/UsageInformation.h"
|
|
||||||
#include "ObjLoading.h"
|
|
||||||
#include "ObjWriting.h"
|
|
||||||
#include "Utils/FileUtils.h"
|
|
||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
const CommandLineOption* const OPTION_HELP =
|
const CommandLineOption* const OPTION_HELP =
|
||||||
CommandLineOption::Builder::Create()
|
CommandLineOption::Builder::Create()
|
||||||
.WithShortName("?")
|
.WithShortName("?")
|
||||||
@ -79,11 +80,13 @@ const CommandLineOption* const OPTION_MENU_PERMISSIVE =
|
|||||||
const CommandLineOption* const OPTION_MENU_NO_OPTIMIZATION =
|
const CommandLineOption* const OPTION_MENU_NO_OPTIMIZATION =
|
||||||
CommandLineOption::Builder::Create()
|
CommandLineOption::Builder::Create()
|
||||||
.WithLongName("menu-no-optimization")
|
.WithLongName("menu-no-optimization")
|
||||||
.WithDescription("Refrain from applying optimizations to parsed menus. (Optimizations increase menu performance and size. May result in less source information when dumped though.)")
|
.WithDescription("Refrain from applying optimizations to parsed menus. (Optimizations increase menu performance and size. May result in less source "
|
||||||
|
"information when dumped though.)")
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
const CommandLineOption* const COMMAND_LINE_OPTIONS[]
|
// clang-format on
|
||||||
{
|
|
||||||
|
const CommandLineOption* const COMMAND_LINE_OPTIONS[]{
|
||||||
OPTION_HELP,
|
OPTION_HELP,
|
||||||
OPTION_VERBOSE,
|
OPTION_VERBOSE,
|
||||||
OPTION_BASE_FOLDER,
|
OPTION_BASE_FOLDER,
|
||||||
@ -93,7 +96,7 @@ const CommandLineOption* const COMMAND_LINE_OPTIONS[]
|
|||||||
OPTION_SOURCE_SEARCH_PATH,
|
OPTION_SOURCE_SEARCH_PATH,
|
||||||
OPTION_LOAD,
|
OPTION_LOAD,
|
||||||
OPTION_MENU_PERMISSIVE,
|
OPTION_MENU_PERMISSIVE,
|
||||||
OPTION_MENU_NO_OPTIMIZATION
|
OPTION_MENU_NO_OPTIMIZATION,
|
||||||
};
|
};
|
||||||
|
|
||||||
LinkerArgs::LinkerArgs()
|
LinkerArgs::LinkerArgs()
|
||||||
@ -182,14 +185,14 @@ std::set<std::string> LinkerArgs::GetSearchPathsForProject(const std::set<std::s
|
|||||||
|
|
||||||
for (const auto& path : set)
|
for (const auto& path : set)
|
||||||
{
|
{
|
||||||
if (path.find(PATTERN_GAME) == std::string::npos
|
if (path.find(PATTERN_GAME) == std::string::npos && path.find(PATTERN_PROJECT) == std::string::npos
|
||||||
&& path.find(PATTERN_PROJECT) == std::string::npos
|
|
||||||
&& (!m_base_folder_depends_on_project || path.find(PATTERN_BASE) == std::string::npos))
|
&& (!m_base_folder_depends_on_project || path.find(PATTERN_BASE) == std::string::npos))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
out.emplace(std::regex_replace(std::regex_replace(std::regex_replace(path, m_project_pattern, projectName), m_game_pattern, gameName), m_base_pattern, basePath));
|
out.emplace(std::regex_replace(
|
||||||
|
std::regex_replace(std::regex_replace(path, m_project_pattern, projectName), m_game_pattern, gameName), m_base_pattern, basePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <vector>
|
|
||||||
#include <set>
|
|
||||||
#include <regex>
|
|
||||||
|
|
||||||
#include "Utils/ClassUtils.h"
|
|
||||||
#include "Utils/Arguments/ArgumentParser.h"
|
#include "Utils/Arguments/ArgumentParser.h"
|
||||||
|
#include "Utils/ClassUtils.h"
|
||||||
#include "Zone/Zone.h"
|
#include "Zone/Zone.h"
|
||||||
|
|
||||||
|
#include <regex>
|
||||||
|
#include <set>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class LinkerArgs
|
class LinkerArgs
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -37,7 +37,8 @@ private:
|
|||||||
_NODISCARD std::string GetBasePathForProject(const std::string& projectName) const;
|
_NODISCARD std::string GetBasePathForProject(const std::string& projectName) const;
|
||||||
void SetDefaultBasePath();
|
void SetDefaultBasePath();
|
||||||
_NODISCARD std::set<std::string> GetProjectIndependentSearchPaths(const std::set<std::string>& set) const;
|
_NODISCARD std::set<std::string> GetProjectIndependentSearchPaths(const std::set<std::string>& set) const;
|
||||||
_NODISCARD std::set<std::string> GetSearchPathsForProject(const std::set<std::string>& set, const std::string& gameName, const std::string& projectName) const;
|
_NODISCARD std::set<std::string>
|
||||||
|
GetSearchPathsForProject(const std::set<std::string>& set, const std::string& gameName, const std::string& projectName) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::vector<std::string> m_zones_to_load;
|
std::vector<std::string> m_zones_to_load;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
#include "LinkerSearchPaths.h"
|
#include "LinkerSearchPaths.h"
|
||||||
|
|
||||||
|
#include "ObjContainer/IWD/IWD.h"
|
||||||
|
#include "ObjLoading.h"
|
||||||
|
#include "SearchPath/SearchPathFilesystem.h"
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "ObjLoading.h"
|
|
||||||
#include "ObjContainer/IWD/IWD.h"
|
|
||||||
#include "SearchPath/SearchPathFilesystem.h"
|
|
||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
LinkerSearchPaths::LinkerSearchPaths(const LinkerArgs& args)
|
LinkerSearchPaths::LinkerSearchPaths(const LinkerArgs& args)
|
||||||
@ -178,7 +178,6 @@ bool LinkerSearchPaths::BuildProjectIndependentSearchPaths()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LinkerSearchPaths::UnloadProjectSpecificSearchPaths()
|
void LinkerSearchPaths::UnloadProjectSpecificSearchPaths()
|
||||||
{
|
{
|
||||||
for (const auto& loadedSearchPath : m_loaded_project_search_paths)
|
for (const auto& loadedSearchPath : m_loaded_project_search_paths)
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#include "LinkerArgs.h"
|
||||||
#include "SearchPath/SearchPaths.h"
|
#include "SearchPath/SearchPaths.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "LinkerArgs.h"
|
|
||||||
|
|
||||||
class LinkerSearchPaths
|
class LinkerSearchPaths
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "Utils/ClassUtils.h"
|
#include "Utils/ClassUtils.h"
|
||||||
#include "ZoneCreationContext.h"
|
|
||||||
#include "Zone/Zone.h"
|
#include "Zone/Zone.h"
|
||||||
|
#include "ZoneCreationContext.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class IZoneCreator
|
class IZoneCreator
|
||||||
{
|
{
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include "SearchPath/ISearchPath.h"
|
|
||||||
#include "Obj/Gdt/Gdt.h"
|
#include "Obj/Gdt/Gdt.h"
|
||||||
|
#include "SearchPath/ISearchPath.h"
|
||||||
#include "Zone/AssetList/AssetList.h"
|
#include "Zone/AssetList/AssetList.h"
|
||||||
#include "Zone/Definition/ZoneDefinition.h"
|
#include "Zone/Definition/ZoneDefinition.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class ZoneCreationContext
|
class ZoneCreationContext
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -1,43 +1,16 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <type_traits>
|
|
||||||
|
|
||||||
#include "Game/IW3/IW3.h"
|
#include "Game/IW3/IW3.h"
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace IW3
|
namespace IW3
|
||||||
{
|
{
|
||||||
inline const char* surfaceTypeNames[]
|
inline const char* surfaceTypeNames[]{
|
||||||
{
|
"default", "bark", "brick", "carpet", "cloth", "concrete", "dirt", "flesh", "foliage", "glass",
|
||||||
"default",
|
"grass", "gravel", "ice", "metal", "mud", "paper", "plaster", "rock", "sand", "snow",
|
||||||
"bark",
|
"water", "wood", "asphalt", "ceramic", "plastic", "rubber", "cushion", "fruit", "paintedmetal",
|
||||||
"brick",
|
|
||||||
"carpet",
|
|
||||||
"cloth",
|
|
||||||
"concrete",
|
|
||||||
"dirt",
|
|
||||||
"flesh",
|
|
||||||
"foliage",
|
|
||||||
"glass",
|
|
||||||
"grass",
|
|
||||||
"gravel",
|
|
||||||
"ice",
|
|
||||||
"metal",
|
|
||||||
"mud",
|
|
||||||
"paper",
|
|
||||||
"plaster",
|
|
||||||
"rock",
|
|
||||||
"sand",
|
|
||||||
"snow",
|
|
||||||
"water",
|
|
||||||
"wood",
|
|
||||||
"asphalt",
|
|
||||||
"ceramic",
|
|
||||||
"plastic",
|
|
||||||
"rubber",
|
|
||||||
"cushion",
|
|
||||||
"fruit",
|
|
||||||
"paintedmetal"
|
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(surfaceTypeNames)> == SURF_TYPE_NUM);
|
static_assert(std::extent_v<decltype(surfaceTypeNames)> == SURF_TYPE_NUM);
|
||||||
}
|
} // namespace IW3
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <type_traits>
|
|
||||||
|
|
||||||
#include "Game/IW3/CommonIW3.h"
|
#include "Game/IW3/CommonIW3.h"
|
||||||
#include "Game/IW3/IW3.h"
|
#include "Game/IW3/IW3.h"
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace IW3
|
namespace IW3
|
||||||
{
|
{
|
||||||
inline const char* techniqueTypeNames[]
|
inline const char* techniqueTypeNames[]{
|
||||||
{
|
|
||||||
"depth prepass",
|
"depth prepass",
|
||||||
"build floatz",
|
"build floatz",
|
||||||
"build shadowmap depth",
|
"build shadowmap depth",
|
||||||
@ -47,8 +46,7 @@ namespace IW3
|
|||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(techniqueTypeNames)> == TECHNIQUE_COUNT);
|
static_assert(std::extent_v<decltype(techniqueTypeNames)> == TECHNIQUE_COUNT);
|
||||||
|
|
||||||
static const char* materialStreamDestinationNames[]
|
static const char* materialStreamDestinationNames[]{
|
||||||
{
|
|
||||||
"position",
|
"position",
|
||||||
"normal",
|
"normal",
|
||||||
"color[0]",
|
"color[0]",
|
||||||
@ -64,8 +62,7 @@ namespace IW3
|
|||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(materialStreamDestinationNames)> == STREAM_DST_COUNT);
|
static_assert(std::extent_v<decltype(materialStreamDestinationNames)> == STREAM_DST_COUNT);
|
||||||
|
|
||||||
static const char* materialStreamSourceNames[]
|
static const char* materialStreamSourceNames[]{
|
||||||
{
|
|
||||||
"position",
|
"position",
|
||||||
"color",
|
"color",
|
||||||
"texcoord[0]",
|
"texcoord[0]",
|
||||||
@ -74,7 +71,7 @@ namespace IW3
|
|||||||
"texcoord[1]",
|
"texcoord[1]",
|
||||||
"texcoord[2]",
|
"texcoord[2]",
|
||||||
"normalTransform[0]",
|
"normalTransform[0]",
|
||||||
"normalTransform[1]"
|
"normalTransform[1]",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(materialStreamSourceNames)> == STREAM_SRC_COUNT);
|
static_assert(std::extent_v<decltype(materialStreamSourceNames)> == STREAM_SRC_COUNT);
|
||||||
|
|
||||||
@ -83,56 +80,23 @@ namespace IW3
|
|||||||
return std::make_pair(Common::R_HashString(name, 0u), name);
|
return std::make_pair(Common::R_HashString(name, 0u), name);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::unordered_map knownMaterialSourceNames
|
inline std::unordered_map knownMaterialSourceNames{
|
||||||
{
|
KnownMaterialSource("colorMap"), KnownMaterialSource("colorMap0"), KnownMaterialSource("colorMap1"),
|
||||||
KnownMaterialSource("colorMap"),
|
KnownMaterialSource("colorMap2"), KnownMaterialSource("colorMap3"), KnownMaterialSource("colorMap4"),
|
||||||
KnownMaterialSource("colorMap0"),
|
KnownMaterialSource("colorMap5"), KnownMaterialSource("colorMap6"), KnownMaterialSource("colorMap7"),
|
||||||
KnownMaterialSource("colorMap1"),
|
KnownMaterialSource("normalMap"), KnownMaterialSource("normalMap0"), KnownMaterialSource("normalMap1"),
|
||||||
KnownMaterialSource("colorMap2"),
|
KnownMaterialSource("normalMap2"), KnownMaterialSource("normalMap3"), KnownMaterialSource("normalMap4"),
|
||||||
KnownMaterialSource("colorMap3"),
|
KnownMaterialSource("normalMap5"), KnownMaterialSource("normalMap6"), KnownMaterialSource("normalMap7"),
|
||||||
KnownMaterialSource("colorMap4"),
|
KnownMaterialSource("specularMap"), KnownMaterialSource("specularMap0"), KnownMaterialSource("specularMap1"),
|
||||||
KnownMaterialSource("colorMap5"),
|
KnownMaterialSource("specularMap2"), KnownMaterialSource("specularMap3"), KnownMaterialSource("specularMap4"),
|
||||||
KnownMaterialSource("colorMap6"),
|
KnownMaterialSource("specularMap5"), KnownMaterialSource("specularMap6"), KnownMaterialSource("specularMap7"),
|
||||||
KnownMaterialSource("colorMap7"),
|
KnownMaterialSource("detailMap"), KnownMaterialSource("detailMap0"), KnownMaterialSource("detailMap1"),
|
||||||
KnownMaterialSource("normalMap"),
|
KnownMaterialSource("detailMap2"), KnownMaterialSource("detailMap3"), KnownMaterialSource("detailMap4"),
|
||||||
KnownMaterialSource("normalMap0"),
|
KnownMaterialSource("detailMap5"), KnownMaterialSource("detailMap6"), KnownMaterialSource("detailMap7"),
|
||||||
KnownMaterialSource("normalMap1"),
|
KnownMaterialSource("attenuationMap"), KnownMaterialSource("attenuationMap0"), KnownMaterialSource("attenuationMap1"),
|
||||||
KnownMaterialSource("normalMap2"),
|
KnownMaterialSource("attenuationMap2"), KnownMaterialSource("attenuationMap3"), KnownMaterialSource("attenuationMap4"),
|
||||||
KnownMaterialSource("normalMap3"),
|
KnownMaterialSource("attenuationMap5"), KnownMaterialSource("attenuationMap6"), KnownMaterialSource("attenuationMap7"),
|
||||||
KnownMaterialSource("normalMap4"),
|
KnownMaterialSource("distortionScale"), KnownMaterialSource("eyeOffsetParms"), KnownMaterialSource("falloffBeginColor"),
|
||||||
KnownMaterialSource("normalMap5"),
|
|
||||||
KnownMaterialSource("normalMap6"),
|
|
||||||
KnownMaterialSource("normalMap7"),
|
|
||||||
KnownMaterialSource("specularMap"),
|
|
||||||
KnownMaterialSource("specularMap0"),
|
|
||||||
KnownMaterialSource("specularMap1"),
|
|
||||||
KnownMaterialSource("specularMap2"),
|
|
||||||
KnownMaterialSource("specularMap3"),
|
|
||||||
KnownMaterialSource("specularMap4"),
|
|
||||||
KnownMaterialSource("specularMap5"),
|
|
||||||
KnownMaterialSource("specularMap6"),
|
|
||||||
KnownMaterialSource("specularMap7"),
|
|
||||||
KnownMaterialSource("detailMap"),
|
|
||||||
KnownMaterialSource("detailMap0"),
|
|
||||||
KnownMaterialSource("detailMap1"),
|
|
||||||
KnownMaterialSource("detailMap2"),
|
|
||||||
KnownMaterialSource("detailMap3"),
|
|
||||||
KnownMaterialSource("detailMap4"),
|
|
||||||
KnownMaterialSource("detailMap5"),
|
|
||||||
KnownMaterialSource("detailMap6"),
|
|
||||||
KnownMaterialSource("detailMap7"),
|
|
||||||
KnownMaterialSource("attenuationMap"),
|
|
||||||
KnownMaterialSource("attenuationMap0"),
|
|
||||||
KnownMaterialSource("attenuationMap1"),
|
|
||||||
KnownMaterialSource("attenuationMap2"),
|
|
||||||
KnownMaterialSource("attenuationMap3"),
|
|
||||||
KnownMaterialSource("attenuationMap4"),
|
|
||||||
KnownMaterialSource("attenuationMap5"),
|
|
||||||
KnownMaterialSource("attenuationMap6"),
|
|
||||||
KnownMaterialSource("attenuationMap7"),
|
|
||||||
KnownMaterialSource("distortionScale"),
|
|
||||||
KnownMaterialSource("eyeOffsetParms"),
|
|
||||||
KnownMaterialSource("falloffBeginColor"),
|
|
||||||
KnownMaterialSource("falloffEndColor"),
|
KnownMaterialSource("falloffEndColor"),
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW3
|
||||||
|
@ -2,16 +2,14 @@
|
|||||||
|
|
||||||
namespace IW4
|
namespace IW4
|
||||||
{
|
{
|
||||||
inline const char* szWeapTypeNames[]
|
inline const char* szWeapTypeNames[]{
|
||||||
{
|
|
||||||
"bullet",
|
"bullet",
|
||||||
"grenade",
|
"grenade",
|
||||||
"projectile",
|
"projectile",
|
||||||
"riotshield",
|
"riotshield",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szWeapClassNames[]
|
inline const char* szWeapClassNames[]{
|
||||||
{
|
|
||||||
"rifle",
|
"rifle",
|
||||||
"sniper",
|
"sniper",
|
||||||
"mg",
|
"mg",
|
||||||
@ -26,14 +24,12 @@ namespace IW4
|
|||||||
"item",
|
"item",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szWeapOverlayReticleNames[]
|
inline const char* szWeapOverlayReticleNames[]{
|
||||||
{
|
|
||||||
"none",
|
"none",
|
||||||
"crosshair",
|
"crosshair",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szWeapInventoryTypeNames[]
|
inline const char* szWeapInventoryTypeNames[]{
|
||||||
{
|
|
||||||
"primary",
|
"primary",
|
||||||
"offhand",
|
"offhand",
|
||||||
"item",
|
"item",
|
||||||
@ -42,8 +38,7 @@ namespace IW4
|
|||||||
"scavenger",
|
"scavenger",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szWeapFireTypeNames[]
|
inline const char* szWeapFireTypeNames[]{
|
||||||
{
|
|
||||||
"Full Auto",
|
"Full Auto",
|
||||||
"Single Shot",
|
"Single Shot",
|
||||||
"2-Round Burst",
|
"2-Round Burst",
|
||||||
@ -52,16 +47,14 @@ namespace IW4
|
|||||||
"Double Barrel",
|
"Double Barrel",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* penetrateTypeNames[]
|
inline const char* penetrateTypeNames[]{
|
||||||
{
|
|
||||||
"none",
|
"none",
|
||||||
"small",
|
"small",
|
||||||
"medium",
|
"medium",
|
||||||
"large",
|
"large",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* impactTypeNames[]
|
inline const char* impactTypeNames[]{
|
||||||
{
|
|
||||||
"none",
|
"none",
|
||||||
"bullet_small",
|
"bullet_small",
|
||||||
"bullet_large",
|
"bullet_large",
|
||||||
@ -75,15 +68,13 @@ namespace IW4
|
|||||||
"projectile_dud",
|
"projectile_dud",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szWeapStanceNames[]
|
inline const char* szWeapStanceNames[]{
|
||||||
{
|
|
||||||
"stand",
|
"stand",
|
||||||
"duck",
|
"duck",
|
||||||
"prone",
|
"prone",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szProjectileExplosionNames[]
|
inline const char* szProjectileExplosionNames[]{
|
||||||
{
|
|
||||||
"grenade",
|
"grenade",
|
||||||
"rocket",
|
"rocket",
|
||||||
"flashbang",
|
"flashbang",
|
||||||
@ -93,8 +84,7 @@ namespace IW4
|
|||||||
"heavy explosive",
|
"heavy explosive",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* offhandClassNames[]
|
inline const char* offhandClassNames[]{
|
||||||
{
|
|
||||||
"None",
|
"None",
|
||||||
"Frag Grenade",
|
"Frag Grenade",
|
||||||
"Smoke Grenade",
|
"Smoke Grenade",
|
||||||
@ -103,8 +93,7 @@ namespace IW4
|
|||||||
"Other",
|
"Other",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* playerAnimTypeNames[]
|
inline const char* playerAnimTypeNames[]{
|
||||||
{
|
|
||||||
"none",
|
"none",
|
||||||
"other",
|
"other",
|
||||||
"pistol",
|
"pistol",
|
||||||
@ -125,23 +114,20 @@ namespace IW4
|
|||||||
"throwingknife",
|
"throwingknife",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* activeReticleNames[]
|
inline const char* activeReticleNames[]{
|
||||||
{
|
|
||||||
"None",
|
"None",
|
||||||
"Pip-On-A-Stick",
|
"Pip-On-A-Stick",
|
||||||
"Bouncing diamond",
|
"Bouncing diamond",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* guidedMissileNames[]
|
inline const char* guidedMissileNames[]{
|
||||||
{
|
|
||||||
"None",
|
"None",
|
||||||
"Sidewinder",
|
"Sidewinder",
|
||||||
"Hellfire",
|
"Hellfire",
|
||||||
"Javelin",
|
"Javelin",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* stickinessNames[]
|
inline const char* stickinessNames[]{
|
||||||
{
|
|
||||||
"Don't stick",
|
"Don't stick",
|
||||||
"Stick to all",
|
"Stick to all",
|
||||||
"Stick to all, orient to surface",
|
"Stick to all, orient to surface",
|
||||||
@ -150,15 +136,13 @@ namespace IW4
|
|||||||
"Knife",
|
"Knife",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* overlayInterfaceNames[]
|
inline const char* overlayInterfaceNames[]{
|
||||||
{
|
|
||||||
"None",
|
"None",
|
||||||
"Javelin",
|
"Javelin",
|
||||||
"Turret Scope",
|
"Turret Scope",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* ammoCounterClipNames[]
|
inline const char* ammoCounterClipNames[]{
|
||||||
{
|
|
||||||
"None",
|
"None",
|
||||||
"Magazine",
|
"Magazine",
|
||||||
"ShortMagazine",
|
"ShortMagazine",
|
||||||
@ -168,15 +152,13 @@ namespace IW4
|
|||||||
"AltWeapon",
|
"AltWeapon",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* weapIconRatioNames[]
|
inline const char* weapIconRatioNames[]{
|
||||||
{
|
|
||||||
"1:1",
|
"1:1",
|
||||||
"2:1",
|
"2:1",
|
||||||
"4:1",
|
"4:1",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* s_vehicleClassNames[]
|
inline const char* s_vehicleClassNames[]{
|
||||||
{
|
|
||||||
"4 wheel",
|
"4 wheel",
|
||||||
"tank",
|
"tank",
|
||||||
"plane",
|
"plane",
|
||||||
@ -186,10 +168,9 @@ namespace IW4
|
|||||||
"snowmobile",
|
"snowmobile",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* s_vehicleAxleTypeNames[]
|
inline const char* s_vehicleAxleTypeNames[]{
|
||||||
{
|
|
||||||
"front",
|
"front",
|
||||||
"rear",
|
"rear",
|
||||||
"all",
|
"all",
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW4
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace IW4
|
namespace IW4
|
||||||
{
|
{
|
||||||
inline cspField_t phys_preset_fields[]
|
inline cspField_t phys_preset_fields[]{
|
||||||
{
|
|
||||||
{"mass", offsetof(PhysPresetInfo, mass), CSPFT_FLOAT },
|
{"mass", offsetof(PhysPresetInfo, mass), CSPFT_FLOAT },
|
||||||
{"bounce", offsetof(PhysPresetInfo, bounce), CSPFT_FLOAT },
|
{"bounce", offsetof(PhysPresetInfo, bounce), CSPFT_FLOAT },
|
||||||
{"friction", offsetof(PhysPresetInfo, friction), CSPFT_FLOAT },
|
{"friction", offsetof(PhysPresetInfo, friction), CSPFT_FLOAT },
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace IW4
|
namespace IW4
|
||||||
{
|
{
|
||||||
inline cspField_t tracer_fields[]
|
inline cspField_t tracer_fields[]{
|
||||||
{
|
|
||||||
{"material", offsetof(TracerDef, material), CSPFT_MATERIAL},
|
{"material", offsetof(TracerDef, material), CSPFT_MATERIAL},
|
||||||
{"drawInterval", offsetof(TracerDef, drawInterval), CSPFT_INT },
|
{"drawInterval", offsetof(TracerDef, drawInterval), CSPFT_INT },
|
||||||
{"speed", offsetof(TracerDef, speed), CSPFT_FLOAT },
|
{"speed", offsetof(TracerDef, speed), CSPFT_FLOAT },
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace IW4
|
namespace IW4
|
||||||
{
|
{
|
||||||
inline cspField_t vehicle_fields[]
|
inline cspField_t vehicle_fields[]{
|
||||||
{
|
|
||||||
{"type", offsetof(VehicleDef, type), VFT_TYPE },
|
{"type", offsetof(VehicleDef, type), VFT_TYPE },
|
||||||
{"useHintString", offsetof(VehicleDef, useHintString), CSPFT_STRING },
|
{"useHintString", offsetof(VehicleDef, useHintString), CSPFT_STRING },
|
||||||
{"health", offsetof(VehicleDef, health), CSPFT_INT },
|
{"health", offsetof(VehicleDef, health), CSPFT_INT },
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace IW4
|
namespace IW4
|
||||||
{
|
{
|
||||||
inline cspField_t weapon_fields[]
|
inline cspField_t weapon_fields[]{
|
||||||
{
|
|
||||||
{"displayName", offsetof(WeaponFullDef, weapCompleteDef.szDisplayName), CSPFT_STRING },
|
{"displayName", offsetof(WeaponFullDef, weapCompleteDef.szDisplayName), CSPFT_STRING },
|
||||||
{"AIOverlayDescription", offsetof(WeaponFullDef, weapDef.szOverlayName), CSPFT_STRING },
|
{"AIOverlayDescription", offsetof(WeaponFullDef, weapDef.szOverlayName), CSPFT_STRING },
|
||||||
{"modeName", offsetof(WeaponFullDef, weapDef.szModeName), CSPFT_STRING },
|
{"modeName", offsetof(WeaponFullDef, weapDef.szModeName), CSPFT_STRING },
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
namespace IW4
|
namespace IW4
|
||||||
{
|
{
|
||||||
inline infoParm_t infoParms[]
|
inline infoParm_t infoParms[]{
|
||||||
{
|
|
||||||
{"bark", 0x0, 0x100000, 0x0, 0x0 },
|
{"bark", 0x0, 0x100000, 0x0, 0x0 },
|
||||||
{"brick", 0x0, 0x200000, 0x0, 0x0 },
|
{"brick", 0x0, 0x200000, 0x0, 0x0 },
|
||||||
{"carpet", 0x0, 0x300000, 0x0, 0x0 },
|
{"carpet", 0x0, 0x300000, 0x0, 0x0 },
|
||||||
@ -70,46 +69,16 @@ namespace IW4
|
|||||||
{"nosteps", 0x0, 0x2000, 0x0, 0x0 },
|
{"nosteps", 0x0, 0x2000, 0x0, 0x0 },
|
||||||
{"nodraw", 0x0, 0x80, 0x0, 0x0 },
|
{"nodraw", 0x0, 0x80, 0x0, 0x0 },
|
||||||
{"nolightmap", 0x0, 0x400, 0x0, 0x0 },
|
{"nolightmap", 0x0, 0x400, 0x0, 0x0 },
|
||||||
{"nodlight", 0x0, 0x20000, 0x0, 0x0}
|
{"nodlight", 0x0, 0x20000, 0x0, 0x0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* surfaceTypeNames[]
|
inline const char* surfaceTypeNames[]{
|
||||||
{
|
"default", "bark", "brick", "carpet", "cloth", "concrete", "dirt", "flesh", "foliage", "glass", "grass",
|
||||||
"default",
|
"gravel", "ice", "metal", "mud", "paper", "plaster", "rock", "sand", "snow", "water", "wood",
|
||||||
"bark",
|
"asphalt", "ceramic", "plastic", "rubber", "cushion", "fruit", "paintedmetal", "riotshield", "slush",
|
||||||
"brick",
|
|
||||||
"carpet",
|
|
||||||
"cloth",
|
|
||||||
"concrete",
|
|
||||||
"dirt",
|
|
||||||
"flesh",
|
|
||||||
"foliage",
|
|
||||||
"glass",
|
|
||||||
"grass",
|
|
||||||
"gravel",
|
|
||||||
"ice",
|
|
||||||
"metal",
|
|
||||||
"mud",
|
|
||||||
"paper",
|
|
||||||
"plaster",
|
|
||||||
"rock",
|
|
||||||
"sand",
|
|
||||||
"snow",
|
|
||||||
"water",
|
|
||||||
"wood",
|
|
||||||
"asphalt",
|
|
||||||
"ceramic",
|
|
||||||
"plastic",
|
|
||||||
"rubber",
|
|
||||||
"cushion",
|
|
||||||
"fruit",
|
|
||||||
"paintedmetal",
|
|
||||||
"riotshield",
|
|
||||||
"slush"
|
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(surfaceTypeNames)> == SURF_TYPE_NUM);
|
static_assert(std::extent_v<decltype(surfaceTypeNames)> == SURF_TYPE_NUM);
|
||||||
|
|
||||||
|
|
||||||
enum class BlendFunc_e
|
enum class BlendFunc_e
|
||||||
{
|
{
|
||||||
UNKNOWN,
|
UNKNOWN,
|
||||||
@ -131,15 +100,14 @@ namespace IW4
|
|||||||
constexpr auto GDT_BLEND_FUNC_MULTIPLY = "Multiply";
|
constexpr auto GDT_BLEND_FUNC_MULTIPLY = "Multiply";
|
||||||
constexpr auto GDT_BLEND_FUNC_SCREEN_ADD = "Screen Add";
|
constexpr auto GDT_BLEND_FUNC_SCREEN_ADD = "Screen Add";
|
||||||
|
|
||||||
inline const char* GdtBlendFuncNames[]
|
inline const char* GdtBlendFuncNames[]{
|
||||||
{
|
|
||||||
GDT_BLEND_FUNC_UNKNOWN,
|
GDT_BLEND_FUNC_UNKNOWN,
|
||||||
GDT_BLEND_FUNC_CUSTOM,
|
GDT_BLEND_FUNC_CUSTOM,
|
||||||
GDT_BLEND_FUNC_REPLACE,
|
GDT_BLEND_FUNC_REPLACE,
|
||||||
GDT_BLEND_FUNC_BLEND,
|
GDT_BLEND_FUNC_BLEND,
|
||||||
GDT_BLEND_FUNC_ADD,
|
GDT_BLEND_FUNC_ADD,
|
||||||
GDT_BLEND_FUNC_MULTIPLY,
|
GDT_BLEND_FUNC_MULTIPLY,
|
||||||
GDT_BLEND_FUNC_SCREEN_ADD
|
GDT_BLEND_FUNC_SCREEN_ADD,
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtBlendFuncNames)> == static_cast<size_t>(BlendFunc_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtBlendFuncNames)> == static_cast<size_t>(BlendFunc_e::COUNT));
|
||||||
|
|
||||||
@ -164,15 +132,14 @@ namespace IW4
|
|||||||
constexpr auto GDT_BLEND_OP_MIN = "Min";
|
constexpr auto GDT_BLEND_OP_MIN = "Min";
|
||||||
constexpr auto GDT_BLEND_OP_MAX = "Max";
|
constexpr auto GDT_BLEND_OP_MAX = "Max";
|
||||||
|
|
||||||
inline const char* GdtBlendOpNames[]
|
inline const char* GdtBlendOpNames[]{
|
||||||
{
|
|
||||||
GDT_BLEND_OP_UNKNOWN,
|
GDT_BLEND_OP_UNKNOWN,
|
||||||
GDT_BLEND_OP_DISABLE,
|
GDT_BLEND_OP_DISABLE,
|
||||||
GDT_BLEND_OP_ADD,
|
GDT_BLEND_OP_ADD,
|
||||||
GDT_BLEND_OP_SUBTRACT,
|
GDT_BLEND_OP_SUBTRACT,
|
||||||
GDT_BLEND_OP_REV_SUBTRACT,
|
GDT_BLEND_OP_REV_SUBTRACT,
|
||||||
GDT_BLEND_OP_MIN,
|
GDT_BLEND_OP_MIN,
|
||||||
GDT_BLEND_OP_MAX
|
GDT_BLEND_OP_MAX,
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtBlendOpNames)> == static_cast<size_t>(BlendOp_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtBlendOpNames)> == static_cast<size_t>(BlendOp_e::COUNT));
|
||||||
|
|
||||||
@ -194,8 +161,7 @@ namespace IW4
|
|||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* GdtCustomBlendFuncNames[]
|
inline const char* GdtCustomBlendFuncNames[]{
|
||||||
{
|
|
||||||
"",
|
"",
|
||||||
"Disable",
|
"Disable",
|
||||||
"Zero",
|
"Zero",
|
||||||
@ -207,7 +173,7 @@ namespace IW4
|
|||||||
"DestAlpha",
|
"DestAlpha",
|
||||||
"InvDestAlpha",
|
"InvDestAlpha",
|
||||||
"DestColor",
|
"DestColor",
|
||||||
"InvDestColor"
|
"InvDestColor",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtCustomBlendFuncNames)> == static_cast<size_t>(CustomBlendFunc_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtCustomBlendFuncNames)> == static_cast<size_t>(CustomBlendFunc_e::COUNT));
|
||||||
|
|
||||||
@ -228,13 +194,12 @@ namespace IW4
|
|||||||
constexpr auto GDT_ALPHA_TEST_LT128 = "LT128";
|
constexpr auto GDT_ALPHA_TEST_LT128 = "LT128";
|
||||||
constexpr auto GDT_ALPHA_TEST_GE128 = "GE128";
|
constexpr auto GDT_ALPHA_TEST_GE128 = "GE128";
|
||||||
|
|
||||||
inline const char* GdtAlphaTestNames[]
|
inline const char* GdtAlphaTestNames[]{
|
||||||
{
|
|
||||||
GDT_ALPHA_TEST_UNKNOWN,
|
GDT_ALPHA_TEST_UNKNOWN,
|
||||||
GDT_ALPHA_TEST_ALWAYS,
|
GDT_ALPHA_TEST_ALWAYS,
|
||||||
GDT_ALPHA_TEST_GT0,
|
GDT_ALPHA_TEST_GT0,
|
||||||
GDT_ALPHA_TEST_LT128,
|
GDT_ALPHA_TEST_LT128,
|
||||||
GDT_ALPHA_TEST_GE128
|
GDT_ALPHA_TEST_GE128,
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtAlphaTestNames)> == static_cast<size_t>(AlphaTest_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtAlphaTestNames)> == static_cast<size_t>(AlphaTest_e::COUNT));
|
||||||
|
|
||||||
@ -250,14 +215,13 @@ namespace IW4
|
|||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* GdtDepthTestNames[]
|
inline const char* GdtDepthTestNames[]{
|
||||||
{
|
|
||||||
"",
|
"",
|
||||||
"LessEqual*",
|
"LessEqual*",
|
||||||
"Less",
|
"Less",
|
||||||
"Equal",
|
"Equal",
|
||||||
"Always",
|
"Always",
|
||||||
"Disable"
|
"Disable",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtDepthTestNames)> == static_cast<size_t>(DepthTest_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtDepthTestNames)> == static_cast<size_t>(DepthTest_e::COUNT));
|
||||||
|
|
||||||
@ -270,19 +234,17 @@ namespace IW4
|
|||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* GdtStateBitsEnabledStatusNames[]
|
inline const char* GdtStateBitsEnabledStatusNames[]{
|
||||||
{
|
|
||||||
"",
|
"",
|
||||||
"Enable",
|
"Enable",
|
||||||
"Disable"
|
"Disable",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtStateBitsEnabledStatusNames)> == static_cast<size_t>(StateBitsEnabledStatus_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtStateBitsEnabledStatusNames)> == static_cast<size_t>(StateBitsEnabledStatus_e::COUNT));
|
||||||
|
|
||||||
inline const char* GdtStateBitsOnOffStatusNames[]
|
inline const char* GdtStateBitsOnOffStatusNames[]{
|
||||||
{
|
|
||||||
"",
|
"",
|
||||||
"On",
|
"On",
|
||||||
"Off"
|
"Off",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtStateBitsOnOffStatusNames)> == static_cast<size_t>(StateBitsEnabledStatus_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtStateBitsOnOffStatusNames)> == static_cast<size_t>(StateBitsEnabledStatus_e::COUNT));
|
||||||
|
|
||||||
@ -296,12 +258,11 @@ namespace IW4
|
|||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* GdtCullFaceNames[]
|
inline const char* GdtCullFaceNames[]{
|
||||||
{
|
|
||||||
"",
|
"",
|
||||||
"None",
|
"None",
|
||||||
"Back*",
|
"Back*",
|
||||||
"Front"
|
"Front",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtCullFaceNames)> == static_cast<size_t>(CullFace_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtCullFaceNames)> == static_cast<size_t>(CullFace_e::COUNT));
|
||||||
|
|
||||||
@ -316,13 +277,12 @@ namespace IW4
|
|||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* GdtPolygonOffsetNames[]
|
inline const char* GdtPolygonOffsetNames[]{
|
||||||
{
|
|
||||||
"",
|
"",
|
||||||
"0",
|
"0",
|
||||||
"1",
|
"1",
|
||||||
"2",
|
"2",
|
||||||
"shadowMap"
|
"shadowMap",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtPolygonOffsetNames)> == static_cast<size_t>(PolygonOffset_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtPolygonOffsetNames)> == static_cast<size_t>(PolygonOffset_e::COUNT));
|
||||||
|
|
||||||
@ -342,12 +302,11 @@ namespace IW4
|
|||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* GdtStencilModeNames[]
|
inline const char* GdtStencilModeNames[]{
|
||||||
{
|
|
||||||
"",
|
"",
|
||||||
"Disable",
|
"Disable",
|
||||||
"One-sided",
|
"One-sided",
|
||||||
"Two-sided"
|
"Two-sided",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtStencilModeNames)> == static_cast<size_t>(StencilMode_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtStencilModeNames)> == static_cast<size_t>(StencilMode_e::COUNT));
|
||||||
|
|
||||||
@ -366,8 +325,7 @@ namespace IW4
|
|||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* GdtStencilFuncNames[]
|
inline const char* GdtStencilFuncNames[]{
|
||||||
{
|
|
||||||
"",
|
"",
|
||||||
"Never",
|
"Never",
|
||||||
"Less",
|
"Less",
|
||||||
@ -376,7 +334,7 @@ namespace IW4
|
|||||||
"Greater",
|
"Greater",
|
||||||
"NotEqual",
|
"NotEqual",
|
||||||
"GreaterEqual",
|
"GreaterEqual",
|
||||||
"Always"
|
"Always",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtStencilFuncNames)> == static_cast<size_t>(StencilFunc_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtStencilFuncNames)> == static_cast<size_t>(StencilFunc_e::COUNT));
|
||||||
|
|
||||||
@ -395,8 +353,7 @@ namespace IW4
|
|||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* GdtStencilOpNames[]
|
inline const char* GdtStencilOpNames[]{
|
||||||
{
|
|
||||||
"",
|
"",
|
||||||
"Keep",
|
"Keep",
|
||||||
"Zero",
|
"Zero",
|
||||||
@ -405,7 +362,7 @@ namespace IW4
|
|||||||
"DecrSat",
|
"DecrSat",
|
||||||
"Invert",
|
"Invert",
|
||||||
"Incr",
|
"Incr",
|
||||||
"Decr"
|
"Decr",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtStencilOpNames)> == static_cast<size_t>(StencilOp_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtStencilOpNames)> == static_cast<size_t>(StencilOp_e::COUNT));
|
||||||
|
|
||||||
@ -420,13 +377,12 @@ namespace IW4
|
|||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* GdtTileModeNames[]
|
inline const char* GdtTileModeNames[]{
|
||||||
{
|
|
||||||
"",
|
"",
|
||||||
"tile both*",
|
"tile both*",
|
||||||
"tile horizontal",
|
"tile horizontal",
|
||||||
"tile vertical",
|
"tile vertical",
|
||||||
"no tile"
|
"no tile",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtTileModeNames)> == static_cast<size_t>(TileMode_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtTileModeNames)> == static_cast<size_t>(TileMode_e::COUNT));
|
||||||
|
|
||||||
@ -443,15 +399,14 @@ namespace IW4
|
|||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char* GdtSamplerFilterNames[]
|
static const char* GdtSamplerFilterNames[]{
|
||||||
{
|
|
||||||
"",
|
"",
|
||||||
"mip standard (2x bilinear)*",
|
"mip standard (2x bilinear)*",
|
||||||
"mip expensive (4x bilinear)",
|
"mip expensive (4x bilinear)",
|
||||||
"mip more expensive (2x trilinear)",
|
"mip more expensive (2x trilinear)",
|
||||||
"mip most expensive (4x trilinear)",
|
"mip most expensive (4x trilinear)",
|
||||||
"nomip nearest",
|
"nomip nearest",
|
||||||
"nomip bilinear"
|
"nomip bilinear",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtSamplerFilterNames)> == static_cast<size_t>(GdtFilter_e::COUNT));
|
static_assert(std::extent_v<decltype(GdtSamplerFilterNames)> == static_cast<size_t>(GdtFilter_e::COUNT));
|
||||||
|
|
||||||
@ -496,8 +451,7 @@ namespace IW4
|
|||||||
constexpr auto GDT_MATERIAL_TYPE_WORLD_PHONG = "world phong";
|
constexpr auto GDT_MATERIAL_TYPE_WORLD_PHONG = "world phong";
|
||||||
constexpr auto GDT_MATERIAL_TYPE_WORLD_UNLIT = "world unlit";
|
constexpr auto GDT_MATERIAL_TYPE_WORLD_UNLIT = "world unlit";
|
||||||
|
|
||||||
inline const char* GdtMaterialTypeNames[]
|
inline const char* GdtMaterialTypeNames[]{
|
||||||
{
|
|
||||||
GDT_MATERIAL_TYPE_UNKNOWN,
|
GDT_MATERIAL_TYPE_UNKNOWN,
|
||||||
GDT_MATERIAL_TYPE_2D,
|
GDT_MATERIAL_TYPE_2D,
|
||||||
GDT_MATERIAL_TYPE_CUSTOM,
|
GDT_MATERIAL_TYPE_CUSTOM,
|
||||||
@ -514,7 +468,7 @@ namespace IW4
|
|||||||
GDT_MATERIAL_TYPE_UNLIT,
|
GDT_MATERIAL_TYPE_UNLIT,
|
||||||
GDT_MATERIAL_TYPE_WATER,
|
GDT_MATERIAL_TYPE_WATER,
|
||||||
GDT_MATERIAL_TYPE_WORLD_PHONG,
|
GDT_MATERIAL_TYPE_WORLD_PHONG,
|
||||||
GDT_MATERIAL_TYPE_WORLD_UNLIT
|
GDT_MATERIAL_TYPE_WORLD_UNLIT,
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtMaterialTypeNames)> == static_cast<size_t>(MATERIAL_TYPE_COUNT));
|
static_assert(std::extent_v<decltype(GdtMaterialTypeNames)> == static_cast<size_t>(MATERIAL_TYPE_COUNT));
|
||||||
|
|
||||||
@ -541,8 +495,7 @@ namespace IW4
|
|||||||
constexpr auto GDT_SORTKEY_AFTER_EFFECT_TOP = "after effects - top";
|
constexpr auto GDT_SORTKEY_AFTER_EFFECT_TOP = "after effects - top";
|
||||||
constexpr auto GDT_SORTKEY_VIEWMODEL_EFFECT = "viewmodel effect";
|
constexpr auto GDT_SORTKEY_VIEWMODEL_EFFECT = "viewmodel effect";
|
||||||
|
|
||||||
inline const char* SortKeyNames[]
|
inline const char* SortKeyNames[]{
|
||||||
{
|
|
||||||
GDT_SORTKEY_OPAQUE_AMBIENT, // 0
|
GDT_SORTKEY_OPAQUE_AMBIENT, // 0
|
||||||
GDT_SORTKEY_OPAQUE, // 1
|
GDT_SORTKEY_OPAQUE, // 1
|
||||||
GDT_SORTKEY_SKY, // 2
|
GDT_SORTKEY_SKY, // 2
|
||||||
@ -628,8 +581,7 @@ namespace IW4
|
|||||||
constexpr auto GDT_CUSTOM_MATERIAL_TYPE_SHADOWOVERLAY = "mtl_shadowoverlay";
|
constexpr auto GDT_CUSTOM_MATERIAL_TYPE_SHADOWOVERLAY = "mtl_shadowoverlay";
|
||||||
constexpr auto GDT_CUSTOM_MATERIAL_TYPE_SPLATTER = "mtl_splatter";
|
constexpr auto GDT_CUSTOM_MATERIAL_TYPE_SPLATTER = "mtl_splatter";
|
||||||
|
|
||||||
inline const char* GdtCustomMaterialTypeNames[]
|
inline const char* GdtCustomMaterialTypeNames[]{
|
||||||
{
|
|
||||||
GDT_CUSTOM_MATERIAL_TYPE_NONE,
|
GDT_CUSTOM_MATERIAL_TYPE_NONE,
|
||||||
GDT_CUSTOM_MATERIAL_TYPE_CUSTOM,
|
GDT_CUSTOM_MATERIAL_TYPE_CUSTOM,
|
||||||
GDT_CUSTOM_MATERIAL_TYPE_PHONG_FLAG,
|
GDT_CUSTOM_MATERIAL_TYPE_PHONG_FLAG,
|
||||||
@ -638,7 +590,7 @@ namespace IW4
|
|||||||
GDT_CUSTOM_MATERIAL_TYPE_REFLEXSIGHT,
|
GDT_CUSTOM_MATERIAL_TYPE_REFLEXSIGHT,
|
||||||
GDT_CUSTOM_MATERIAL_TYPE_SHADOWCLEAR,
|
GDT_CUSTOM_MATERIAL_TYPE_SHADOWCLEAR,
|
||||||
GDT_CUSTOM_MATERIAL_TYPE_SHADOWOVERLAY,
|
GDT_CUSTOM_MATERIAL_TYPE_SHADOWOVERLAY,
|
||||||
GDT_CUSTOM_MATERIAL_TYPE_SPLATTER
|
GDT_CUSTOM_MATERIAL_TYPE_SPLATTER,
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(GdtCustomMaterialTypeNames)> == static_cast<size_t>(CUSTOM_MATERIAL_TYPE_COUNT));
|
static_assert(std::extent_v<decltype(GdtCustomMaterialTypeNames)> == static_cast<size_t>(CUSTOM_MATERIAL_TYPE_COUNT));
|
||||||
}
|
} // namespace IW4
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
namespace IW4
|
namespace IW4
|
||||||
{
|
{
|
||||||
inline const char* g_expFunctionNames[]
|
inline const char* g_expFunctionNames[]{
|
||||||
{
|
|
||||||
"NOOP",
|
"NOOP",
|
||||||
")",
|
")",
|
||||||
"*",
|
"*",
|
||||||
@ -194,8 +193,7 @@ namespace IW4
|
|||||||
"coopready",
|
"coopready",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const ItemExpressionTargetBinding floatExpressionTargetBindings[ITEM_FLOATEXP_TGT_COUNT]
|
inline const ItemExpressionTargetBinding floatExpressionTargetBindings[ITEM_FLOATEXP_TGT_COUNT]{
|
||||||
{
|
|
||||||
{ITEM_FLOATEXP_TGT_RECT_X, "rect", "x" },
|
{ITEM_FLOATEXP_TGT_RECT_X, "rect", "x" },
|
||||||
{ITEM_FLOATEXP_TGT_RECT_Y, "rect", "y" },
|
{ITEM_FLOATEXP_TGT_RECT_Y, "rect", "y" },
|
||||||
{ITEM_FLOATEXP_TGT_RECT_W, "rect", "w" },
|
{ITEM_FLOATEXP_TGT_RECT_W, "rect", "w" },
|
||||||
@ -216,4 +214,4 @@ namespace IW4
|
|||||||
{ITEM_FLOATEXP_TGT_BACKCOLOR_RGB, "backcolor", "rgb"},
|
{ITEM_FLOATEXP_TGT_BACKCOLOR_RGB, "backcolor", "rgb"},
|
||||||
{ITEM_FLOATEXP_TGT_BACKCOLOR_A, "backcolor", "a" },
|
{ITEM_FLOATEXP_TGT_BACKCOLOR_A, "backcolor", "a" },
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW4
|
||||||
|
@ -18,4 +18,4 @@ namespace IW4
|
|||||||
static constexpr const char* GDF_FILENAME_VEHICLE = "vehicle.gdf";
|
static constexpr const char* GDF_FILENAME_VEHICLE = "vehicle.gdf";
|
||||||
static constexpr const char* GDF_FILENAME_WEAPON = "weapon.gdf";
|
static constexpr const char* GDF_FILENAME_WEAPON = "weapon.gdf";
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW4
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <type_traits>
|
|
||||||
|
|
||||||
#include "Game/IW4/CommonIW4.h"
|
#include "Game/IW4/CommonIW4.h"
|
||||||
#include "Game/IW4/IW4.h"
|
#include "Game/IW4/IW4.h"
|
||||||
#include "StateMap/StateMapLayout.h"
|
#include "StateMap/StateMapLayout.h"
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace IW4
|
namespace IW4
|
||||||
{
|
{
|
||||||
inline const char* techniqueTypeNames[]
|
inline const char* techniqueTypeNames[]{
|
||||||
{
|
|
||||||
"depth prepass",
|
"depth prepass",
|
||||||
"build floatz",
|
"build floatz",
|
||||||
"build shadowmap depth",
|
"build shadowmap depth",
|
||||||
@ -62,8 +61,7 @@ namespace IW4
|
|||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(techniqueTypeNames)> == TECHNIQUE_COUNT);
|
static_assert(std::extent_v<decltype(techniqueTypeNames)> == TECHNIQUE_COUNT);
|
||||||
|
|
||||||
static const char* materialStreamDestinationNames[]
|
static const char* materialStreamDestinationNames[]{
|
||||||
{
|
|
||||||
"position",
|
"position",
|
||||||
"normal",
|
"normal",
|
||||||
"color[0]",
|
"color[0]",
|
||||||
@ -79,8 +77,7 @@ namespace IW4
|
|||||||
"texcoord[7]",
|
"texcoord[7]",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(materialStreamDestinationNames)> == STREAM_DST_COUNT);
|
static_assert(std::extent_v<decltype(materialStreamDestinationNames)> == STREAM_DST_COUNT);
|
||||||
static const char* materialStreamDestinationAbbreviation[]
|
static const char* materialStreamDestinationAbbreviation[]{
|
||||||
{
|
|
||||||
"p",
|
"p",
|
||||||
"n",
|
"n",
|
||||||
"c0",
|
"c0",
|
||||||
@ -97,8 +94,7 @@ namespace IW4
|
|||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(materialStreamDestinationAbbreviation)> == STREAM_DST_COUNT);
|
static_assert(std::extent_v<decltype(materialStreamDestinationAbbreviation)> == STREAM_DST_COUNT);
|
||||||
|
|
||||||
static const char* materialStreamSourceNames[]
|
static const char* materialStreamSourceNames[]{
|
||||||
{
|
|
||||||
"position",
|
"position",
|
||||||
"color",
|
"color",
|
||||||
"texcoord[0]",
|
"texcoord[0]",
|
||||||
@ -107,11 +103,10 @@ namespace IW4
|
|||||||
"texcoord[1]",
|
"texcoord[1]",
|
||||||
"texcoord[2]",
|
"texcoord[2]",
|
||||||
"normalTransform[0]",
|
"normalTransform[0]",
|
||||||
"normalTransform[1]"
|
"normalTransform[1]",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(materialStreamSourceNames)> == STREAM_SRC_COUNT);
|
static_assert(std::extent_v<decltype(materialStreamSourceNames)> == STREAM_SRC_COUNT);
|
||||||
static const char* materialStreamSourceAbbreviation[]
|
static const char* materialStreamSourceAbbreviation[]{
|
||||||
{
|
|
||||||
"p",
|
"p",
|
||||||
"c",
|
"c",
|
||||||
"t0",
|
"t0",
|
||||||
@ -120,25 +115,22 @@ namespace IW4
|
|||||||
"t1",
|
"t1",
|
||||||
"t2",
|
"t2",
|
||||||
"n0",
|
"n0",
|
||||||
"n1"
|
"n1",
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(materialStreamSourceAbbreviation)> == STREAM_SRC_COUNT);
|
static_assert(std::extent_v<decltype(materialStreamSourceAbbreviation)> == STREAM_SRC_COUNT);
|
||||||
|
|
||||||
inline CodeSamplerSource s_lightmapSamplers[]
|
inline CodeSamplerSource s_lightmapSamplers[]{
|
||||||
{
|
|
||||||
{"primary", TEXTURE_SRC_CODE_LIGHTMAP_PRIMARY, nullptr, 0, 0},
|
{"primary", TEXTURE_SRC_CODE_LIGHTMAP_PRIMARY, nullptr, 0, 0},
|
||||||
{"secondary", TEXTURE_SRC_CODE_LIGHTMAP_SECONDARY, nullptr, 0, 0},
|
{"secondary", TEXTURE_SRC_CODE_LIGHTMAP_SECONDARY, nullptr, 0, 0},
|
||||||
{}
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
inline CodeSamplerSource s_lightSamplers[]
|
inline CodeSamplerSource s_lightSamplers[]{
|
||||||
{
|
|
||||||
{"attenuation", TEXTURE_SRC_CODE_LIGHT_ATTENUATION, nullptr, 0, 0},
|
{"attenuation", TEXTURE_SRC_CODE_LIGHT_ATTENUATION, nullptr, 0, 0},
|
||||||
{}
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
inline CodeSamplerSource s_codeSamplers[]
|
inline CodeSamplerSource s_codeSamplers[]{
|
||||||
{
|
|
||||||
{"white", TEXTURE_SRC_CODE_WHITE, nullptr, 0, 0},
|
{"white", TEXTURE_SRC_CODE_WHITE, nullptr, 0, 0},
|
||||||
{"black", TEXTURE_SRC_CODE_BLACK, nullptr, 0, 0},
|
{"black", TEXTURE_SRC_CODE_BLACK, nullptr, 0, 0},
|
||||||
{"identityNormalMap", TEXTURE_SRC_CODE_IDENTITY_NORMAL_MAP, nullptr, 0, 0},
|
{"identityNormalMap", TEXTURE_SRC_CODE_IDENTITY_NORMAL_MAP, nullptr, 0, 0},
|
||||||
@ -158,11 +150,10 @@ namespace IW4
|
|||||||
{"halfParticleColorSampler", TEXTURE_SRC_CODE_HALF_PARTICLES, nullptr, 0, 0},
|
{"halfParticleColorSampler", TEXTURE_SRC_CODE_HALF_PARTICLES, nullptr, 0, 0},
|
||||||
{"halfParticleDepthSampler", TEXTURE_SRC_CODE_HALF_PARTICLES_Z, nullptr, 0, 0},
|
{"halfParticleDepthSampler", TEXTURE_SRC_CODE_HALF_PARTICLES_Z, nullptr, 0, 0},
|
||||||
{"alternateScene", TEXTURE_SRC_CODE_ALTERNATE_SCENE, nullptr, 0, 0},
|
{"alternateScene", TEXTURE_SRC_CODE_ALTERNATE_SCENE, nullptr, 0, 0},
|
||||||
{}
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
inline CodeSamplerSource s_defaultCodeSamplers[]
|
inline CodeSamplerSource s_defaultCodeSamplers[]{
|
||||||
{
|
|
||||||
{"shadowmapSamplerSun", TEXTURE_SRC_CODE_SHADOWMAP_SUN, nullptr, 0, 0},
|
{"shadowmapSamplerSun", TEXTURE_SRC_CODE_SHADOWMAP_SUN, nullptr, 0, 0},
|
||||||
{"shadowmapSamplerSpot", TEXTURE_SRC_CODE_SHADOWMAP_SPOT, nullptr, 0, 0},
|
{"shadowmapSamplerSpot", TEXTURE_SRC_CODE_SHADOWMAP_SPOT, nullptr, 0, 0},
|
||||||
{"feedbackSampler", TEXTURE_SRC_CODE_FEEDBACK, nullptr, 0, 0},
|
{"feedbackSampler", TEXTURE_SRC_CODE_FEEDBACK, nullptr, 0, 0},
|
||||||
@ -181,30 +172,27 @@ namespace IW4
|
|||||||
{"cinematicASampler", TEXTURE_SRC_CODE_CINEMATIC_A, nullptr, 0, 0},
|
{"cinematicASampler", TEXTURE_SRC_CODE_CINEMATIC_A, nullptr, 0, 0},
|
||||||
{"reflectionProbeSampler", TEXTURE_SRC_CODE_REFLECTION_PROBE, nullptr, 0, 0},
|
{"reflectionProbeSampler", TEXTURE_SRC_CODE_REFLECTION_PROBE, nullptr, 0, 0},
|
||||||
{"alternateSceneSampler", TEXTURE_SRC_CODE_ALTERNATE_SCENE, nullptr, 0, 0},
|
{"alternateSceneSampler", TEXTURE_SRC_CODE_ALTERNATE_SCENE, nullptr, 0, 0},
|
||||||
{}
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
inline CodeConstantSource s_sunConsts[]
|
inline CodeConstantSource s_sunConsts[]{
|
||||||
{
|
|
||||||
{"position", CONST_SRC_CODE_LIGHT_POSITION, nullptr, 0, 0},
|
{"position", CONST_SRC_CODE_LIGHT_POSITION, nullptr, 0, 0},
|
||||||
{"diffuse", CONST_SRC_CODE_LIGHT_DIFFUSE, nullptr, 0, 0},
|
{"diffuse", CONST_SRC_CODE_LIGHT_DIFFUSE, nullptr, 0, 0},
|
||||||
{"specular", CONST_SRC_CODE_LIGHT_SPECULAR, nullptr, 0, 0},
|
{"specular", CONST_SRC_CODE_LIGHT_SPECULAR, nullptr, 0, 0},
|
||||||
{"spotDir", CONST_SRC_CODE_LIGHT_SPOTDIR, nullptr, 0, 0},
|
{"spotDir", CONST_SRC_CODE_LIGHT_SPOTDIR, nullptr, 0, 0},
|
||||||
{"spotFactors", CONST_SRC_CODE_LIGHT_SPOTFACTORS, nullptr, 0, 0},
|
{"spotFactors", CONST_SRC_CODE_LIGHT_SPOTFACTORS, nullptr, 0, 0},
|
||||||
{"falloffPlacement", CONST_SRC_CODE_LIGHT_FALLOFF_PLACEMENT, nullptr, 0, 0},
|
{"falloffPlacement", CONST_SRC_CODE_LIGHT_FALLOFF_PLACEMENT, nullptr, 0, 0},
|
||||||
{}
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
inline CodeConstantSource s_nearPlaneConsts[]
|
inline CodeConstantSource s_nearPlaneConsts[]{
|
||||||
{
|
|
||||||
{"org", CONST_SRC_CODE_NEARPLANE_ORG, nullptr, 0, 0},
|
{"org", CONST_SRC_CODE_NEARPLANE_ORG, nullptr, 0, 0},
|
||||||
{"dx", CONST_SRC_CODE_NEARPLANE_DX, nullptr, 0, 0},
|
{"dx", CONST_SRC_CODE_NEARPLANE_DX, nullptr, 0, 0},
|
||||||
{"dy", CONST_SRC_CODE_NEARPLANE_DY, nullptr, 0, 0},
|
{"dy", CONST_SRC_CODE_NEARPLANE_DY, nullptr, 0, 0},
|
||||||
{}
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
inline CodeConstantSource s_codeConsts[]
|
inline CodeConstantSource s_codeConsts[]{
|
||||||
{
|
|
||||||
{"nearPlane", CONST_SRC_NONE, s_nearPlaneConsts, 0, 0},
|
{"nearPlane", CONST_SRC_NONE, s_nearPlaneConsts, 0, 0},
|
||||||
{"light", CONST_SRC_NONE, s_sunConsts, 0, 0},
|
{"light", CONST_SRC_NONE, s_sunConsts, 0, 0},
|
||||||
{"baseLightingCoords", CONST_SRC_CODE_BASE_LIGHTING_COORDS, nullptr, 0, 0},
|
{"baseLightingCoords", CONST_SRC_CODE_BASE_LIGHTING_COORDS, nullptr, 0, 0},
|
||||||
@ -320,11 +308,10 @@ namespace IW4
|
|||||||
{"inverseWorldViewProjectionMatrix2", CONST_SRC_CODE_INVERSE_WORLD_VIEW_PROJECTION_MATRIX2, nullptr, 0, 0},
|
{"inverseWorldViewProjectionMatrix2", CONST_SRC_CODE_INVERSE_WORLD_VIEW_PROJECTION_MATRIX2, nullptr, 0, 0},
|
||||||
{"transposeWorldViewProjectionMatrix2", CONST_SRC_CODE_TRANSPOSE_WORLD_VIEW_PROJECTION_MATRIX2, nullptr, 0, 0},
|
{"transposeWorldViewProjectionMatrix2", CONST_SRC_CODE_TRANSPOSE_WORLD_VIEW_PROJECTION_MATRIX2, nullptr, 0, 0},
|
||||||
{"inverseTransposeWorldViewProjectionMatrix2", CONST_SRC_CODE_INVERSE_TRANSPOSE_WORLD_VIEW_PROJECTION_MATRIX2, nullptr, 0, 0},
|
{"inverseTransposeWorldViewProjectionMatrix2", CONST_SRC_CODE_INVERSE_TRANSPOSE_WORLD_VIEW_PROJECTION_MATRIX2, nullptr, 0, 0},
|
||||||
{}
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
inline CodeConstantSource s_defaultCodeConsts[]
|
inline CodeConstantSource s_defaultCodeConsts[]{
|
||||||
{
|
|
||||||
{"nearPlaneOrg", CONST_SRC_CODE_NEARPLANE_ORG, nullptr, 0, 0},
|
{"nearPlaneOrg", CONST_SRC_CODE_NEARPLANE_ORG, nullptr, 0, 0},
|
||||||
{"nearPlaneDx", CONST_SRC_CODE_NEARPLANE_DX, nullptr, 0, 0},
|
{"nearPlaneDx", CONST_SRC_CODE_NEARPLANE_DX, nullptr, 0, 0},
|
||||||
{"nearPlaneDy", CONST_SRC_CODE_NEARPLANE_DY, nullptr, 0, 0},
|
{"nearPlaneDy", CONST_SRC_CODE_NEARPLANE_DY, nullptr, 0, 0},
|
||||||
@ -336,11 +323,10 @@ namespace IW4
|
|||||||
{"lightFalloffPlacement", CONST_SRC_CODE_LIGHT_FALLOFF_PLACEMENT, nullptr, 0, 0},
|
{"lightFalloffPlacement", CONST_SRC_CODE_LIGHT_FALLOFF_PLACEMENT, nullptr, 0, 0},
|
||||||
{"sunShadowmapPixelAdjust", CONST_SRC_CODE_SUN_SHADOWMAP_PIXEL_ADJUST, nullptr, 0, 0},
|
{"sunShadowmapPixelAdjust", CONST_SRC_CODE_SUN_SHADOWMAP_PIXEL_ADJUST, nullptr, 0, 0},
|
||||||
{"spotShadowmapPixelAdjust", CONST_SRC_CODE_SPOT_SHADOWMAP_PIXEL_ADJUST, nullptr, 0, 0},
|
{"spotShadowmapPixelAdjust", CONST_SRC_CODE_SPOT_SHADOWMAP_PIXEL_ADJUST, nullptr, 0, 0},
|
||||||
{}
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
inline MaterialUpdateFrequency s_codeConstUpdateFreq[]
|
inline MaterialUpdateFrequency s_codeConstUpdateFreq[]{
|
||||||
{
|
|
||||||
MTL_UPDATE_RARELY, // LIGHT_POSITION
|
MTL_UPDATE_RARELY, // LIGHT_POSITION
|
||||||
MTL_UPDATE_RARELY, // LIGHT_DIFFUSE
|
MTL_UPDATE_RARELY, // LIGHT_DIFFUSE
|
||||||
MTL_UPDATE_RARELY, // LIGHT_SPECULAR
|
MTL_UPDATE_RARELY, // LIGHT_SPECULAR
|
||||||
@ -476,8 +462,7 @@ namespace IW4
|
|||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(s_codeConstUpdateFreq)> == CONST_SRC_TOTAL_COUNT);
|
static_assert(std::extent_v<decltype(s_codeConstUpdateFreq)> == CONST_SRC_TOTAL_COUNT);
|
||||||
|
|
||||||
inline MaterialUpdateFrequency s_codeSamplerUpdateFreq[]
|
inline MaterialUpdateFrequency s_codeSamplerUpdateFreq[]{
|
||||||
{
|
|
||||||
MTL_UPDATE_RARELY, // BLACK
|
MTL_UPDATE_RARELY, // BLACK
|
||||||
MTL_UPDATE_RARELY, // WHITE
|
MTL_UPDATE_RARELY, // WHITE
|
||||||
MTL_UPDATE_RARELY, // IDENTITY_NORMAL_MAP
|
MTL_UPDATE_RARELY, // IDENTITY_NORMAL_MAP
|
||||||
@ -508,22 +493,20 @@ namespace IW4
|
|||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(s_codeSamplerUpdateFreq)> == TEXTURE_SRC_CODE_COUNT);
|
static_assert(std::extent_v<decltype(s_codeSamplerUpdateFreq)> == TEXTURE_SRC_CODE_COUNT);
|
||||||
|
|
||||||
inline MaterialTextureSource g_customSamplerSrc[]
|
inline MaterialTextureSource g_customSamplerSrc[]{
|
||||||
{
|
|
||||||
TEXTURE_SRC_CODE_REFLECTION_PROBE, // CUSTOM_SAMPLER_REFLECTION_PROBE
|
TEXTURE_SRC_CODE_REFLECTION_PROBE, // CUSTOM_SAMPLER_REFLECTION_PROBE
|
||||||
TEXTURE_SRC_CODE_LIGHTMAP_PRIMARY, // CUSTOM_SAMPLER_LIGHTMAP_PRIMARY
|
TEXTURE_SRC_CODE_LIGHTMAP_PRIMARY, // CUSTOM_SAMPLER_LIGHTMAP_PRIMARY
|
||||||
TEXTURE_SRC_CODE_LIGHTMAP_SECONDARY // CUSTOM_SAMPLER_LIGHTMAP_SECONDARY
|
TEXTURE_SRC_CODE_LIGHTMAP_SECONDARY, // CUSTOM_SAMPLER_LIGHTMAP_SECONDARY
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(g_customSamplerSrc)> == CUSTOM_SAMPLER_COUNT);
|
static_assert(std::extent_v<decltype(g_customSamplerSrc)> == CUSTOM_SAMPLER_COUNT);
|
||||||
|
|
||||||
inline MaterialTypeInfo g_materialTypeInfo[]
|
inline MaterialTypeInfo g_materialTypeInfo[]{
|
||||||
{
|
|
||||||
{"", "" },
|
{"", "" },
|
||||||
{"m/", "m_" },
|
{"m/", "m_" },
|
||||||
{"mc/", "mc_"},
|
{"mc/", "mc_"},
|
||||||
{"mg/", "mg_"},
|
{"mg/", "mg_"},
|
||||||
{"w/", "w_" },
|
{"w/", "w_" },
|
||||||
{"wc/", "wc_"}
|
{"wc/", "wc_"},
|
||||||
};
|
};
|
||||||
static_assert(std::extent_v<decltype(g_materialTypeInfo)> == MTL_TYPE_COUNT);
|
static_assert(std::extent_v<decltype(g_materialTypeInfo)> == MTL_TYPE_COUNT);
|
||||||
|
|
||||||
@ -538,8 +521,7 @@ namespace IW4
|
|||||||
return std::make_pair(Common::R_HashString(name, 0u), KnownMaterialTextureMap{name, additionalPropertySuffix});
|
return std::make_pair(Common::R_HashString(name, 0u), KnownMaterialTextureMap{name, additionalPropertySuffix});
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::unordered_map knownTextureMaps
|
inline std::unordered_map knownTextureMaps{
|
||||||
{
|
|
||||||
MakeKnownTextureMap("colorMap", "Color"),
|
MakeKnownTextureMap("colorMap", "Color"),
|
||||||
MakeKnownTextureMap("colorMap0", "Color00"),
|
MakeKnownTextureMap("colorMap0", "Color00"),
|
||||||
MakeKnownTextureMap("colorMap1", "Color01"),
|
MakeKnownTextureMap("colorMap1", "Color01"),
|
||||||
@ -554,8 +536,7 @@ namespace IW4
|
|||||||
return std::make_pair(Common::R_HashString(name, 0u), name);
|
return std::make_pair(Common::R_HashString(name, 0u), name);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::unordered_map knownConstantNames
|
inline std::unordered_map knownConstantNames{
|
||||||
{
|
|
||||||
MakeKnownConstantName("distortionScale"),
|
MakeKnownConstantName("distortionScale"),
|
||||||
MakeKnownConstantName("eyeOffsetParms"),
|
MakeKnownConstantName("eyeOffsetParms"),
|
||||||
MakeKnownConstantName("falloffBeginColor"),
|
MakeKnownConstantName("falloffBeginColor"),
|
||||||
@ -577,60 +558,27 @@ namespace IW4
|
|||||||
WIREFRAME
|
WIREFRAME
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline state_map::StateMapLayoutEntries stateMapEntryLayout({
|
inline state_map::StateMapLayoutEntries stateMapEntryLayout({
|
||||||
|
{"alphaTest", 0, GFXS0_ATEST_MASK | GFXS0_ATEST_DISABLE, {"mtlAlphaTest"} },
|
||||||
|
{"blendFunc", 0, GFXS0_BLEND_RGB_MASK, {"mtlBlendOp", "mtlSrcBlend", "mtlDestBlend"} },
|
||||||
|
{"separateAlphaBlendFunc", 0, GFXS0_BLEND_ALPHA_MASK, {"mtlBlendOpAlpha", "mtlSrcBlendAlpha", "mtlDestBlendAlpha"}},
|
||||||
|
{"cullFace", 0, GFXS0_CULL_MASK, {"mtlCullFace"} },
|
||||||
|
{"depthTest", 1, GFXS1_DEPTHTEST_MASK | GFXS1_DEPTHTEST_DISABLE, {"mtlDepthTest"} },
|
||||||
|
{"depthWrite", 1, GFXS1_DEPTHWRITE, {"mtlDepthWrite"} },
|
||||||
|
{"colorWrite", 0, GFXS0_COLORWRITE_MASK, {"mtlColorWriteRgb", "mtlColorWriteAlpha"} },
|
||||||
|
{"gammaWrite",
|
||||||
|
0, GFXS0_GAMMAWRITE,
|
||||||
{
|
{
|
||||||
"alphaTest", 0, GFXS0_ATEST_MASK | GFXS0_ATEST_DISABLE, {
|
|
||||||
"mtlAlphaTest"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blendFunc", 0, GFXS0_BLEND_RGB_MASK, {
|
|
||||||
"mtlBlendOp",
|
|
||||||
"mtlSrcBlend",
|
|
||||||
"mtlDestBlend"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"separateAlphaBlendFunc", 0, GFXS0_BLEND_ALPHA_MASK, {
|
|
||||||
"mtlBlendOpAlpha",
|
|
||||||
"mtlSrcBlendAlpha",
|
|
||||||
"mtlDestBlendAlpha"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cullFace", 0, GFXS0_CULL_MASK, {
|
|
||||||
"mtlCullFace"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"depthTest", 1, GFXS1_DEPTHTEST_MASK | GFXS1_DEPTHTEST_DISABLE, {
|
|
||||||
"mtlDepthTest"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"depthWrite", 1, GFXS1_DEPTHWRITE, {
|
|
||||||
"mtlDepthWrite"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"colorWrite", 0, GFXS0_COLORWRITE_MASK, {
|
|
||||||
"mtlColorWriteRgb",
|
|
||||||
"mtlColorWriteAlpha"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"gammaWrite", 0, GFXS0_GAMMAWRITE, {
|
|
||||||
"mtlGammaWrite",
|
"mtlGammaWrite",
|
||||||
}
|
} },
|
||||||
},
|
{"polygonOffset",
|
||||||
|
1, GFXS1_POLYGON_OFFSET_MASK,
|
||||||
{
|
{
|
||||||
"polygonOffset", 1, GFXS1_POLYGON_OFFSET_MASK, {
|
|
||||||
"mtlPolygonOffset",
|
"mtlPolygonOffset",
|
||||||
}
|
} },
|
||||||
},
|
{"stencil",
|
||||||
|
1, GFXS1_STENCILFUNC_FRONTBACK_MASK | GFXS1_STENCILOP_FRONTBACK_MASK,
|
||||||
{
|
{
|
||||||
"stencil", 1, GFXS1_STENCILFUNC_FRONTBACK_MASK | GFXS1_STENCILOP_FRONTBACK_MASK, {
|
|
||||||
"mtlStencil",
|
"mtlStencil",
|
||||||
"mtlStencilFuncFront",
|
"mtlStencilFuncFront",
|
||||||
"mtlStencilOpFrontPass",
|
"mtlStencilOpFrontPass",
|
||||||
@ -640,36 +588,33 @@ namespace IW4
|
|||||||
"mtlStencilOpBackPass",
|
"mtlStencilOpBackPass",
|
||||||
"mtlStencilOpBackFail",
|
"mtlStencilOpBackFail",
|
||||||
"mtlStencilOpBackZFail",
|
"mtlStencilOpBackZFail",
|
||||||
}
|
} },
|
||||||
},
|
{"wireframe",
|
||||||
|
0, GFXS0_POLYMODE_LINE,
|
||||||
{
|
{
|
||||||
"wireframe", 0, GFXS0_POLYMODE_LINE, {
|
|
||||||
"mtlWireframe",
|
"mtlWireframe",
|
||||||
}
|
} }
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
inline state_map::StateMapLayoutVars stateMapVarLayout({
|
inline state_map::StateMapLayoutVars stateMapVarLayout({
|
||||||
{
|
{"mtlAlphaTest",
|
||||||
"mtlAlphaTest", 0, {
|
0, {
|
||||||
{"Always", GFXS0_ATEST_DISABLE},
|
{"Always", GFXS0_ATEST_DISABLE},
|
||||||
{"GE128", GFXS0_ATEST_GE_128},
|
{"GE128", GFXS0_ATEST_GE_128},
|
||||||
{"GT0", GFXS0_ATEST_GT_0},
|
{"GT0", GFXS0_ATEST_GT_0},
|
||||||
{"LT128", GFXS0_ATEST_LT_128},
|
{"LT128", GFXS0_ATEST_LT_128},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlBlendOp",
|
||||||
{
|
0, {
|
||||||
"mtlBlendOp", 0, {
|
|
||||||
{"Add", GFXS_BLENDOP_ADD << GFXS0_BLENDOP_RGB_SHIFT},
|
{"Add", GFXS_BLENDOP_ADD << GFXS0_BLENDOP_RGB_SHIFT},
|
||||||
{"Subtract", GFXS_BLENDOP_SUBTRACT << GFXS0_BLENDOP_RGB_SHIFT},
|
{"Subtract", GFXS_BLENDOP_SUBTRACT << GFXS0_BLENDOP_RGB_SHIFT},
|
||||||
{"RevSubtract", GFXS_BLENDOP_REVSUBTRACT << GFXS0_BLENDOP_RGB_SHIFT},
|
{"RevSubtract", GFXS_BLENDOP_REVSUBTRACT << GFXS0_BLENDOP_RGB_SHIFT},
|
||||||
{"Min", GFXS_BLENDOP_MIN << GFXS0_BLENDOP_RGB_SHIFT},
|
{"Min", GFXS_BLENDOP_MIN << GFXS0_BLENDOP_RGB_SHIFT},
|
||||||
{"Max", GFXS_BLENDOP_MAX << GFXS0_BLENDOP_RGB_SHIFT},
|
{"Max", GFXS_BLENDOP_MAX << GFXS0_BLENDOP_RGB_SHIFT},
|
||||||
{"Disable", GFXS_BLENDOP_DISABLED << GFXS0_BLENDOP_RGB_SHIFT},
|
{"Disable", GFXS_BLENDOP_DISABLED << GFXS0_BLENDOP_RGB_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlSrcBlend",
|
||||||
{
|
0, {
|
||||||
"mtlSrcBlend", 0, {
|
|
||||||
{"Zero", GFXS_BLEND_ZERO << GFXS0_SRCBLEND_RGB_SHIFT},
|
{"Zero", GFXS_BLEND_ZERO << GFXS0_SRCBLEND_RGB_SHIFT},
|
||||||
{"One", GFXS_BLEND_ONE << GFXS0_SRCBLEND_RGB_SHIFT},
|
{"One", GFXS_BLEND_ONE << GFXS0_SRCBLEND_RGB_SHIFT},
|
||||||
{"SrcColor", GFXS_BLEND_SRCCOLOR << GFXS0_SRCBLEND_RGB_SHIFT},
|
{"SrcColor", GFXS_BLEND_SRCCOLOR << GFXS0_SRCBLEND_RGB_SHIFT},
|
||||||
@ -680,10 +625,9 @@ namespace IW4
|
|||||||
{"InvDestAlpha", GFXS_BLEND_INVDESTALPHA << GFXS0_SRCBLEND_RGB_SHIFT},
|
{"InvDestAlpha", GFXS_BLEND_INVDESTALPHA << GFXS0_SRCBLEND_RGB_SHIFT},
|
||||||
{"DestColor", GFXS_BLEND_DESTCOLOR << GFXS0_SRCBLEND_RGB_SHIFT},
|
{"DestColor", GFXS_BLEND_DESTCOLOR << GFXS0_SRCBLEND_RGB_SHIFT},
|
||||||
{"InvDestColor", GFXS_BLEND_INVDESTCOLOR << GFXS0_SRCBLEND_RGB_SHIFT},
|
{"InvDestColor", GFXS_BLEND_INVDESTCOLOR << GFXS0_SRCBLEND_RGB_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlDestBlend",
|
||||||
{
|
0, {
|
||||||
"mtlDestBlend", 0, {
|
|
||||||
{"Zero", GFXS_BLEND_ZERO << GFXS0_DSTBLEND_RGB_SHIFT},
|
{"Zero", GFXS_BLEND_ZERO << GFXS0_DSTBLEND_RGB_SHIFT},
|
||||||
{"One", GFXS_BLEND_ONE << GFXS0_DSTBLEND_RGB_SHIFT},
|
{"One", GFXS_BLEND_ONE << GFXS0_DSTBLEND_RGB_SHIFT},
|
||||||
{"SrcColor", GFXS_BLEND_SRCCOLOR << GFXS0_DSTBLEND_RGB_SHIFT},
|
{"SrcColor", GFXS_BLEND_SRCCOLOR << GFXS0_DSTBLEND_RGB_SHIFT},
|
||||||
@ -694,20 +638,18 @@ namespace IW4
|
|||||||
{"InvDestAlpha", GFXS_BLEND_INVDESTALPHA << GFXS0_DSTBLEND_RGB_SHIFT},
|
{"InvDestAlpha", GFXS_BLEND_INVDESTALPHA << GFXS0_DSTBLEND_RGB_SHIFT},
|
||||||
{"DestColor", GFXS_BLEND_DESTCOLOR << GFXS0_DSTBLEND_RGB_SHIFT},
|
{"DestColor", GFXS_BLEND_DESTCOLOR << GFXS0_DSTBLEND_RGB_SHIFT},
|
||||||
{"InvDestColor", GFXS_BLEND_INVDESTCOLOR << GFXS0_DSTBLEND_RGB_SHIFT},
|
{"InvDestColor", GFXS_BLEND_INVDESTCOLOR << GFXS0_DSTBLEND_RGB_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlBlendOpAlpha",
|
||||||
{
|
0, {
|
||||||
"mtlBlendOpAlpha", 0, {
|
|
||||||
{"Add", GFXS_BLENDOP_ADD << GFXS0_BLENDOP_ALPHA_SHIFT},
|
{"Add", GFXS_BLENDOP_ADD << GFXS0_BLENDOP_ALPHA_SHIFT},
|
||||||
{"Subtract", GFXS_BLENDOP_SUBTRACT << GFXS0_BLENDOP_ALPHA_SHIFT},
|
{"Subtract", GFXS_BLENDOP_SUBTRACT << GFXS0_BLENDOP_ALPHA_SHIFT},
|
||||||
{"RevSubtract", GFXS_BLENDOP_REVSUBTRACT << GFXS0_BLENDOP_ALPHA_SHIFT},
|
{"RevSubtract", GFXS_BLENDOP_REVSUBTRACT << GFXS0_BLENDOP_ALPHA_SHIFT},
|
||||||
{"Min", GFXS_BLENDOP_MIN << GFXS0_BLENDOP_ALPHA_SHIFT},
|
{"Min", GFXS_BLENDOP_MIN << GFXS0_BLENDOP_ALPHA_SHIFT},
|
||||||
{"Max", GFXS_BLENDOP_MAX << GFXS0_BLENDOP_ALPHA_SHIFT},
|
{"Max", GFXS_BLENDOP_MAX << GFXS0_BLENDOP_ALPHA_SHIFT},
|
||||||
{"Disable", GFXS_BLENDOP_DISABLED << GFXS0_BLENDOP_ALPHA_SHIFT},
|
{"Disable", GFXS_BLENDOP_DISABLED << GFXS0_BLENDOP_ALPHA_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlSrcBlendAlpha",
|
||||||
{
|
0, {
|
||||||
"mtlSrcBlendAlpha", 0, {
|
|
||||||
{"Zero", GFXS_BLEND_ZERO << GFXS0_SRCBLEND_ALPHA_SHIFT},
|
{"Zero", GFXS_BLEND_ZERO << GFXS0_SRCBLEND_ALPHA_SHIFT},
|
||||||
{"One", GFXS_BLEND_ONE << GFXS0_SRCBLEND_ALPHA_SHIFT},
|
{"One", GFXS_BLEND_ONE << GFXS0_SRCBLEND_ALPHA_SHIFT},
|
||||||
{"SrcColor", GFXS_BLEND_SRCCOLOR << GFXS0_SRCBLEND_ALPHA_SHIFT},
|
{"SrcColor", GFXS_BLEND_SRCCOLOR << GFXS0_SRCBLEND_ALPHA_SHIFT},
|
||||||
@ -718,10 +660,9 @@ namespace IW4
|
|||||||
{"InvDestAlpha", GFXS_BLEND_INVDESTALPHA << GFXS0_SRCBLEND_ALPHA_SHIFT},
|
{"InvDestAlpha", GFXS_BLEND_INVDESTALPHA << GFXS0_SRCBLEND_ALPHA_SHIFT},
|
||||||
{"DestColor", GFXS_BLEND_DESTCOLOR << GFXS0_SRCBLEND_ALPHA_SHIFT},
|
{"DestColor", GFXS_BLEND_DESTCOLOR << GFXS0_SRCBLEND_ALPHA_SHIFT},
|
||||||
{"InvDestColor", GFXS_BLEND_INVDESTCOLOR << GFXS0_SRCBLEND_ALPHA_SHIFT},
|
{"InvDestColor", GFXS_BLEND_INVDESTCOLOR << GFXS0_SRCBLEND_ALPHA_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlDestBlendAlpha",
|
||||||
{
|
0, {
|
||||||
"mtlDestBlendAlpha", 0, {
|
|
||||||
{"Zero", GFXS_BLEND_ZERO << GFXS0_DSTBLEND_ALPHA_SHIFT},
|
{"Zero", GFXS_BLEND_ZERO << GFXS0_DSTBLEND_ALPHA_SHIFT},
|
||||||
{"One", GFXS_BLEND_ONE << GFXS0_DSTBLEND_ALPHA_SHIFT},
|
{"One", GFXS_BLEND_ONE << GFXS0_DSTBLEND_ALPHA_SHIFT},
|
||||||
{"SrcColor", GFXS_BLEND_SRCCOLOR << GFXS0_DSTBLEND_ALPHA_SHIFT},
|
{"SrcColor", GFXS_BLEND_SRCCOLOR << GFXS0_DSTBLEND_ALPHA_SHIFT},
|
||||||
@ -732,71 +673,61 @@ namespace IW4
|
|||||||
{"InvDestAlpha", GFXS_BLEND_INVDESTALPHA << GFXS0_DSTBLEND_ALPHA_SHIFT},
|
{"InvDestAlpha", GFXS_BLEND_INVDESTALPHA << GFXS0_DSTBLEND_ALPHA_SHIFT},
|
||||||
{"DestColor", GFXS_BLEND_DESTCOLOR << GFXS0_DSTBLEND_ALPHA_SHIFT},
|
{"DestColor", GFXS_BLEND_DESTCOLOR << GFXS0_DSTBLEND_ALPHA_SHIFT},
|
||||||
{"InvDestColor", GFXS_BLEND_INVDESTCOLOR << GFXS0_DSTBLEND_ALPHA_SHIFT},
|
{"InvDestColor", GFXS_BLEND_INVDESTCOLOR << GFXS0_DSTBLEND_ALPHA_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlCullFace",
|
||||||
{
|
0, {
|
||||||
"mtlCullFace", 0, {
|
|
||||||
{"None", GFXS0_CULL_NONE},
|
{"None", GFXS0_CULL_NONE},
|
||||||
{"Back", GFXS0_CULL_BACK},
|
{"Back", GFXS0_CULL_BACK},
|
||||||
{"Front", GFXS0_CULL_FRONT},
|
{"Front", GFXS0_CULL_FRONT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlColorWriteRgb",
|
||||||
{
|
0, {
|
||||||
"mtlColorWriteRgb", 0, {
|
|
||||||
{"Enable", GFXS0_COLORWRITE_RGB},
|
{"Enable", GFXS0_COLORWRITE_RGB},
|
||||||
{"Disable", 0},
|
{"Disable", 0},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlColorWriteAlpha",
|
||||||
{
|
0, {
|
||||||
"mtlColorWriteAlpha", 0, {
|
|
||||||
{"Enable", GFXS0_COLORWRITE_ALPHA},
|
{"Enable", GFXS0_COLORWRITE_ALPHA},
|
||||||
{"Disable", 0},
|
{"Disable", 0},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlGammaWrite",
|
||||||
{
|
0, {
|
||||||
"mtlGammaWrite", 0, {
|
|
||||||
{"Enable", GFXS0_GAMMAWRITE},
|
{"Enable", GFXS0_GAMMAWRITE},
|
||||||
{"Disable", 0},
|
{"Disable", 0},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlWireframe",
|
||||||
{
|
0, {
|
||||||
"mtlWireframe", 0, {
|
|
||||||
{"Enable", GFXS0_POLYMODE_LINE},
|
{"Enable", GFXS0_POLYMODE_LINE},
|
||||||
{"Disable", 0},
|
{"Disable", 0},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlDepthTest",
|
||||||
{
|
1, {
|
||||||
"mtlDepthTest", 1, {
|
|
||||||
{"Disable", GFXS1_DEPTHTEST_DISABLE},
|
{"Disable", GFXS1_DEPTHTEST_DISABLE},
|
||||||
{"Less", GFXS1_DEPTHTEST_LESS},
|
{"Less", GFXS1_DEPTHTEST_LESS},
|
||||||
{"LessEqual", GFXS1_DEPTHTEST_LESSEQUAL},
|
{"LessEqual", GFXS1_DEPTHTEST_LESSEQUAL},
|
||||||
{"Equal", GFXS1_DEPTHTEST_EQUAL},
|
{"Equal", GFXS1_DEPTHTEST_EQUAL},
|
||||||
{"Always", GFXS1_DEPTHTEST_ALWAYS},
|
{"Always", GFXS1_DEPTHTEST_ALWAYS},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlDepthWrite",
|
||||||
{
|
1, {
|
||||||
"mtlDepthWrite", 1, {
|
|
||||||
{"Enable", GFXS1_DEPTHWRITE},
|
{"Enable", GFXS1_DEPTHWRITE},
|
||||||
{"Disable", 0},
|
{"Disable", 0},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlPolygonOffset",
|
||||||
{
|
1, {
|
||||||
"mtlPolygonOffset", 1, {
|
|
||||||
{"1", GFXS1_POLYGON_OFFSET_1},
|
{"1", GFXS1_POLYGON_OFFSET_1},
|
||||||
{"2", GFXS1_POLYGON_OFFSET_2},
|
{"2", GFXS1_POLYGON_OFFSET_2},
|
||||||
{"shadowmap", GFXS1_POLYGON_OFFSET_SHADOWMAP},
|
{"shadowmap", GFXS1_POLYGON_OFFSET_SHADOWMAP},
|
||||||
{"0", GFXS1_POLYGON_OFFSET_0},
|
{"0", GFXS1_POLYGON_OFFSET_0},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlStencil",
|
||||||
{
|
1, {
|
||||||
"mtlStencil", 1, {
|
|
||||||
{"OneSided", GFXS1_STENCIL_FRONT_ENABLE},
|
{"OneSided", GFXS1_STENCIL_FRONT_ENABLE},
|
||||||
{"TwoSided", GFXS1_STENCIL_FRONT_ENABLE | GFXS1_STENCIL_BACK_ENABLE},
|
{"TwoSided", GFXS1_STENCIL_FRONT_ENABLE | GFXS1_STENCIL_BACK_ENABLE},
|
||||||
{"Disable", 0},
|
{"Disable", 0},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlStencilFuncFront",
|
||||||
{
|
1, {
|
||||||
"mtlStencilFuncFront", 1, {
|
|
||||||
{"Less", GFXS_STENCILFUNC_LESS << GFXS1_STENCIL_FRONT_FUNC_SHIFT},
|
{"Less", GFXS_STENCILFUNC_LESS << GFXS1_STENCIL_FRONT_FUNC_SHIFT},
|
||||||
{"Equal", GFXS_STENCILFUNC_EQUAL << GFXS1_STENCIL_FRONT_FUNC_SHIFT},
|
{"Equal", GFXS_STENCILFUNC_EQUAL << GFXS1_STENCIL_FRONT_FUNC_SHIFT},
|
||||||
{"LessEqual", GFXS_STENCILFUNC_LESSEQUAL << GFXS1_STENCIL_FRONT_FUNC_SHIFT},
|
{"LessEqual", GFXS_STENCILFUNC_LESSEQUAL << GFXS1_STENCIL_FRONT_FUNC_SHIFT},
|
||||||
@ -805,10 +736,9 @@ namespace IW4
|
|||||||
{"GreaterEqual", GFXS_STENCILFUNC_GREATEREQUAL << GFXS1_STENCIL_FRONT_FUNC_SHIFT},
|
{"GreaterEqual", GFXS_STENCILFUNC_GREATEREQUAL << GFXS1_STENCIL_FRONT_FUNC_SHIFT},
|
||||||
{"Always", GFXS_STENCILFUNC_ALWAYS << GFXS1_STENCIL_FRONT_FUNC_SHIFT},
|
{"Always", GFXS_STENCILFUNC_ALWAYS << GFXS1_STENCIL_FRONT_FUNC_SHIFT},
|
||||||
{"Never", GFXS_STENCILFUNC_NEVER << GFXS1_STENCIL_FRONT_FUNC_SHIFT},
|
{"Never", GFXS_STENCILFUNC_NEVER << GFXS1_STENCIL_FRONT_FUNC_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlStencilOpFrontPass",
|
||||||
{
|
1, {
|
||||||
"mtlStencilOpFrontPass", 1, {
|
|
||||||
{"Zero", GFXS_STENCILOP_ZERO << GFXS1_STENCIL_FRONT_PASS_SHIFT},
|
{"Zero", GFXS_STENCILOP_ZERO << GFXS1_STENCIL_FRONT_PASS_SHIFT},
|
||||||
{"Replace", GFXS_STENCILOP_REPLACE << GFXS1_STENCIL_FRONT_PASS_SHIFT},
|
{"Replace", GFXS_STENCILOP_REPLACE << GFXS1_STENCIL_FRONT_PASS_SHIFT},
|
||||||
{"IncrSat", GFXS_STENCILOP_INCRSAT << GFXS1_STENCIL_FRONT_PASS_SHIFT},
|
{"IncrSat", GFXS_STENCILOP_INCRSAT << GFXS1_STENCIL_FRONT_PASS_SHIFT},
|
||||||
@ -817,10 +747,9 @@ namespace IW4
|
|||||||
{"Incr", GFXS_STENCILOP_INCR << GFXS1_STENCIL_FRONT_PASS_SHIFT},
|
{"Incr", GFXS_STENCILOP_INCR << GFXS1_STENCIL_FRONT_PASS_SHIFT},
|
||||||
{"Decr", GFXS_STENCILOP_DECR << GFXS1_STENCIL_FRONT_PASS_SHIFT},
|
{"Decr", GFXS_STENCILOP_DECR << GFXS1_STENCIL_FRONT_PASS_SHIFT},
|
||||||
{"Keep", GFXS_STENCILOP_KEEP << GFXS1_STENCIL_FRONT_PASS_SHIFT},
|
{"Keep", GFXS_STENCILOP_KEEP << GFXS1_STENCIL_FRONT_PASS_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlStencilOpFrontFail",
|
||||||
{
|
1, {
|
||||||
"mtlStencilOpFrontFail", 1, {
|
|
||||||
{"Zero", GFXS_STENCILOP_ZERO << GFXS1_STENCIL_FRONT_FAIL_SHIFT},
|
{"Zero", GFXS_STENCILOP_ZERO << GFXS1_STENCIL_FRONT_FAIL_SHIFT},
|
||||||
{"Replace", GFXS_STENCILOP_REPLACE << GFXS1_STENCIL_FRONT_FAIL_SHIFT},
|
{"Replace", GFXS_STENCILOP_REPLACE << GFXS1_STENCIL_FRONT_FAIL_SHIFT},
|
||||||
{"IncrSat", GFXS_STENCILOP_INCRSAT << GFXS1_STENCIL_FRONT_FAIL_SHIFT},
|
{"IncrSat", GFXS_STENCILOP_INCRSAT << GFXS1_STENCIL_FRONT_FAIL_SHIFT},
|
||||||
@ -829,10 +758,9 @@ namespace IW4
|
|||||||
{"Incr", GFXS_STENCILOP_INCR << GFXS1_STENCIL_FRONT_FAIL_SHIFT},
|
{"Incr", GFXS_STENCILOP_INCR << GFXS1_STENCIL_FRONT_FAIL_SHIFT},
|
||||||
{"Decr", GFXS_STENCILOP_DECR << GFXS1_STENCIL_FRONT_FAIL_SHIFT},
|
{"Decr", GFXS_STENCILOP_DECR << GFXS1_STENCIL_FRONT_FAIL_SHIFT},
|
||||||
{"Keep", GFXS_STENCILOP_KEEP << GFXS1_STENCIL_FRONT_FAIL_SHIFT},
|
{"Keep", GFXS_STENCILOP_KEEP << GFXS1_STENCIL_FRONT_FAIL_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlStencilOpFrontZFail",
|
||||||
{
|
1, {
|
||||||
"mtlStencilOpFrontZFail", 1, {
|
|
||||||
{"Zero", GFXS_STENCILOP_ZERO << GFXS1_STENCIL_FRONT_ZFAIL_SHIFT},
|
{"Zero", GFXS_STENCILOP_ZERO << GFXS1_STENCIL_FRONT_ZFAIL_SHIFT},
|
||||||
{"Replace", GFXS_STENCILOP_REPLACE << GFXS1_STENCIL_FRONT_ZFAIL_SHIFT},
|
{"Replace", GFXS_STENCILOP_REPLACE << GFXS1_STENCIL_FRONT_ZFAIL_SHIFT},
|
||||||
{"IncrSat", GFXS_STENCILOP_INCRSAT << GFXS1_STENCIL_FRONT_ZFAIL_SHIFT},
|
{"IncrSat", GFXS_STENCILOP_INCRSAT << GFXS1_STENCIL_FRONT_ZFAIL_SHIFT},
|
||||||
@ -841,10 +769,9 @@ namespace IW4
|
|||||||
{"Incr", GFXS_STENCILOP_INCR << GFXS1_STENCIL_FRONT_ZFAIL_SHIFT},
|
{"Incr", GFXS_STENCILOP_INCR << GFXS1_STENCIL_FRONT_ZFAIL_SHIFT},
|
||||||
{"Decr", GFXS_STENCILOP_DECR << GFXS1_STENCIL_FRONT_ZFAIL_SHIFT},
|
{"Decr", GFXS_STENCILOP_DECR << GFXS1_STENCIL_FRONT_ZFAIL_SHIFT},
|
||||||
{"Keep", GFXS_STENCILOP_KEEP << GFXS1_STENCIL_FRONT_ZFAIL_SHIFT},
|
{"Keep", GFXS_STENCILOP_KEEP << GFXS1_STENCIL_FRONT_ZFAIL_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlStencilFuncBack",
|
||||||
{
|
1, {
|
||||||
"mtlStencilFuncBack", 1, {
|
|
||||||
{"Less", GFXS_STENCILFUNC_LESS << GFXS1_STENCIL_BACK_FUNC_SHIFT},
|
{"Less", GFXS_STENCILFUNC_LESS << GFXS1_STENCIL_BACK_FUNC_SHIFT},
|
||||||
{"Equal", GFXS_STENCILFUNC_EQUAL << GFXS1_STENCIL_BACK_FUNC_SHIFT},
|
{"Equal", GFXS_STENCILFUNC_EQUAL << GFXS1_STENCIL_BACK_FUNC_SHIFT},
|
||||||
{"LessEqual", GFXS_STENCILFUNC_LESSEQUAL << GFXS1_STENCIL_BACK_FUNC_SHIFT},
|
{"LessEqual", GFXS_STENCILFUNC_LESSEQUAL << GFXS1_STENCIL_BACK_FUNC_SHIFT},
|
||||||
@ -853,10 +780,9 @@ namespace IW4
|
|||||||
{"GreaterEqual", GFXS_STENCILFUNC_GREATEREQUAL << GFXS1_STENCIL_BACK_FUNC_SHIFT},
|
{"GreaterEqual", GFXS_STENCILFUNC_GREATEREQUAL << GFXS1_STENCIL_BACK_FUNC_SHIFT},
|
||||||
{"Always", GFXS_STENCILFUNC_ALWAYS << GFXS1_STENCIL_BACK_FUNC_SHIFT},
|
{"Always", GFXS_STENCILFUNC_ALWAYS << GFXS1_STENCIL_BACK_FUNC_SHIFT},
|
||||||
{"Never", GFXS_STENCILFUNC_NEVER << GFXS1_STENCIL_BACK_FUNC_SHIFT},
|
{"Never", GFXS_STENCILFUNC_NEVER << GFXS1_STENCIL_BACK_FUNC_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlStencilOpBackPass",
|
||||||
{
|
1, {
|
||||||
"mtlStencilOpBackPass", 1, {
|
|
||||||
{"Zero", GFXS_STENCILOP_ZERO << GFXS1_STENCIL_BACK_PASS_SHIFT},
|
{"Zero", GFXS_STENCILOP_ZERO << GFXS1_STENCIL_BACK_PASS_SHIFT},
|
||||||
{"Replace", GFXS_STENCILOP_REPLACE << GFXS1_STENCIL_BACK_PASS_SHIFT},
|
{"Replace", GFXS_STENCILOP_REPLACE << GFXS1_STENCIL_BACK_PASS_SHIFT},
|
||||||
{"IncrSat", GFXS_STENCILOP_INCRSAT << GFXS1_STENCIL_BACK_PASS_SHIFT},
|
{"IncrSat", GFXS_STENCILOP_INCRSAT << GFXS1_STENCIL_BACK_PASS_SHIFT},
|
||||||
@ -865,10 +791,9 @@ namespace IW4
|
|||||||
{"Incr", GFXS_STENCILOP_INCR << GFXS1_STENCIL_BACK_PASS_SHIFT},
|
{"Incr", GFXS_STENCILOP_INCR << GFXS1_STENCIL_BACK_PASS_SHIFT},
|
||||||
{"Decr", GFXS_STENCILOP_DECR << GFXS1_STENCIL_BACK_PASS_SHIFT},
|
{"Decr", GFXS_STENCILOP_DECR << GFXS1_STENCIL_BACK_PASS_SHIFT},
|
||||||
{"Keep", GFXS_STENCILOP_KEEP << GFXS1_STENCIL_BACK_PASS_SHIFT},
|
{"Keep", GFXS_STENCILOP_KEEP << GFXS1_STENCIL_BACK_PASS_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlStencilOpBackFail",
|
||||||
{
|
1, {
|
||||||
"mtlStencilOpBackFail", 1, {
|
|
||||||
{"Zero", GFXS_STENCILOP_ZERO << GFXS1_STENCIL_BACK_FAIL_SHIFT},
|
{"Zero", GFXS_STENCILOP_ZERO << GFXS1_STENCIL_BACK_FAIL_SHIFT},
|
||||||
{"Replace", GFXS_STENCILOP_REPLACE << GFXS1_STENCIL_BACK_FAIL_SHIFT},
|
{"Replace", GFXS_STENCILOP_REPLACE << GFXS1_STENCIL_BACK_FAIL_SHIFT},
|
||||||
{"IncrSat", GFXS_STENCILOP_INCRSAT << GFXS1_STENCIL_BACK_FAIL_SHIFT},
|
{"IncrSat", GFXS_STENCILOP_INCRSAT << GFXS1_STENCIL_BACK_FAIL_SHIFT},
|
||||||
@ -877,10 +802,9 @@ namespace IW4
|
|||||||
{"Incr", GFXS_STENCILOP_INCR << GFXS1_STENCIL_BACK_FAIL_SHIFT},
|
{"Incr", GFXS_STENCILOP_INCR << GFXS1_STENCIL_BACK_FAIL_SHIFT},
|
||||||
{"Decr", GFXS_STENCILOP_DECR << GFXS1_STENCIL_BACK_FAIL_SHIFT},
|
{"Decr", GFXS_STENCILOP_DECR << GFXS1_STENCIL_BACK_FAIL_SHIFT},
|
||||||
{"Keep", GFXS_STENCILOP_KEEP << GFXS1_STENCIL_BACK_FAIL_SHIFT},
|
{"Keep", GFXS_STENCILOP_KEEP << GFXS1_STENCIL_BACK_FAIL_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
{"mtlStencilOpBackZFail",
|
||||||
{
|
1, {
|
||||||
"mtlStencilOpBackZFail", 1, {
|
|
||||||
{"Zero", GFXS_STENCILOP_ZERO << GFXS1_STENCIL_BACK_ZFAIL_SHIFT},
|
{"Zero", GFXS_STENCILOP_ZERO << GFXS1_STENCIL_BACK_ZFAIL_SHIFT},
|
||||||
{"Replace", GFXS_STENCILOP_REPLACE << GFXS1_STENCIL_BACK_ZFAIL_SHIFT},
|
{"Replace", GFXS_STENCILOP_REPLACE << GFXS1_STENCIL_BACK_ZFAIL_SHIFT},
|
||||||
{"IncrSat", GFXS_STENCILOP_INCRSAT << GFXS1_STENCIL_BACK_ZFAIL_SHIFT},
|
{"IncrSat", GFXS_STENCILOP_INCRSAT << GFXS1_STENCIL_BACK_ZFAIL_SHIFT},
|
||||||
@ -889,9 +813,8 @@ namespace IW4
|
|||||||
{"Incr", GFXS_STENCILOP_INCR << GFXS1_STENCIL_BACK_ZFAIL_SHIFT},
|
{"Incr", GFXS_STENCILOP_INCR << GFXS1_STENCIL_BACK_ZFAIL_SHIFT},
|
||||||
{"Decr", GFXS_STENCILOP_DECR << GFXS1_STENCIL_BACK_ZFAIL_SHIFT},
|
{"Decr", GFXS_STENCILOP_DECR << GFXS1_STENCIL_BACK_ZFAIL_SHIFT},
|
||||||
{"Keep", GFXS_STENCILOP_KEEP << GFXS1_STENCIL_BACK_ZFAIL_SHIFT},
|
{"Keep", GFXS_STENCILOP_KEEP << GFXS1_STENCIL_BACK_ZFAIL_SHIFT},
|
||||||
}
|
}},
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
inline state_map::StateMapLayout stateMapLayout(std::extent_v<decltype(GfxStateBits::loadBits)>, stateMapEntryLayout, stateMapVarLayout);
|
inline state_map::StateMapLayout stateMapLayout(std::extent_v<decltype(GfxStateBits::loadBits)>, stateMapEntryLayout, stateMapVarLayout);
|
||||||
}
|
} // namespace IW4
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
namespace IW5
|
namespace IW5
|
||||||
{
|
{
|
||||||
inline const char* g_expFunctionNames[]
|
inline const char* g_expFunctionNames[]{
|
||||||
{
|
|
||||||
"NOOP",
|
"NOOP",
|
||||||
")",
|
")",
|
||||||
"*",
|
"*",
|
||||||
@ -361,8 +360,7 @@ namespace IW5
|
|||||||
"doWeHaveMissingOwnedContent",
|
"doWeHaveMissingOwnedContent",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const ItemExpressionTargetBinding floatExpressionTargetBindings[ITEM_FLOATEXP_TGT_COUNT]
|
inline const ItemExpressionTargetBinding floatExpressionTargetBindings[ITEM_FLOATEXP_TGT_COUNT]{
|
||||||
{
|
|
||||||
{ITEM_FLOATEXP_TGT_RECT_X, "rect", "x" },
|
{ITEM_FLOATEXP_TGT_RECT_X, "rect", "x" },
|
||||||
{ITEM_FLOATEXP_TGT_RECT_Y, "rect", "y" },
|
{ITEM_FLOATEXP_TGT_RECT_Y, "rect", "y" },
|
||||||
{ITEM_FLOATEXP_TGT_RECT_W, "rect", "w" },
|
{ITEM_FLOATEXP_TGT_RECT_W, "rect", "w" },
|
||||||
@ -383,4 +381,4 @@ namespace IW5
|
|||||||
{ITEM_FLOATEXP_TGT_BACKCOLOR_RGB, "backcolor", "rgb"},
|
{ITEM_FLOATEXP_TGT_BACKCOLOR_RGB, "backcolor", "rgb"},
|
||||||
{ITEM_FLOATEXP_TGT_BACKCOLOR_A, "backcolor", "a" },
|
{ITEM_FLOATEXP_TGT_BACKCOLOR_A, "backcolor", "a" },
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW5
|
||||||
|
@ -17,4 +17,4 @@ namespace IW5
|
|||||||
static constexpr const char* GDF_FILENAME_VEHICLE = "vehicle.gdf";
|
static constexpr const char* GDF_FILENAME_VEHICLE = "vehicle.gdf";
|
||||||
static constexpr const char* GDF_FILENAME_WEAPON = "weapon.gdf";
|
static constexpr const char* GDF_FILENAME_WEAPON = "weapon.gdf";
|
||||||
};
|
};
|
||||||
}
|
} // namespace IW5
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
namespace T6
|
namespace T6
|
||||||
{
|
{
|
||||||
inline const char* szWeapTypeNames[]
|
inline const char* szWeapTypeNames[]{
|
||||||
{
|
|
||||||
"bullet",
|
"bullet",
|
||||||
"grenade",
|
"grenade",
|
||||||
"projectile",
|
"projectile",
|
||||||
@ -12,11 +11,10 @@ namespace T6
|
|||||||
"bomb",
|
"bomb",
|
||||||
"mine",
|
"mine",
|
||||||
"melee",
|
"melee",
|
||||||
"riotshield"
|
"riotshield",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szWeapClassNames[]
|
inline const char* szWeapClassNames[]{
|
||||||
{
|
|
||||||
"rifle",
|
"rifle",
|
||||||
"mg",
|
"mg",
|
||||||
"smg",
|
"smg",
|
||||||
@ -30,47 +28,42 @@ namespace T6
|
|||||||
"item",
|
"item",
|
||||||
"melee",
|
"melee",
|
||||||
"Killstreak Alt Stored Weapon",
|
"Killstreak Alt Stored Weapon",
|
||||||
"pistol spread"
|
"pistol spread",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szWeapOverlayReticleNames[]
|
inline const char* szWeapOverlayReticleNames[]{
|
||||||
{
|
|
||||||
"none",
|
"none",
|
||||||
"crosshair"
|
"crosshair",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szWeapInventoryTypeNames[]
|
inline const char* szWeapInventoryTypeNames[]{
|
||||||
{
|
|
||||||
"primary",
|
"primary",
|
||||||
"offhand",
|
"offhand",
|
||||||
"item",
|
"item",
|
||||||
"altmode",
|
"altmode",
|
||||||
"melee",
|
"melee",
|
||||||
"dwlefthand"
|
"dwlefthand",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szWeapClipTypeNames[]
|
inline const char* szWeapClipTypeNames[]{
|
||||||
{
|
|
||||||
"bottom",
|
"bottom",
|
||||||
"top",
|
"top",
|
||||||
"left",
|
"left",
|
||||||
"dp28",
|
"dp28",
|
||||||
"ptrs",
|
"ptrs",
|
||||||
"lmg"
|
"lmg",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* barrelTypeNames[]
|
inline const char* barrelTypeNames[]{
|
||||||
{
|
|
||||||
"Single",
|
"Single",
|
||||||
"Dual Barrel",
|
"Dual Barrel",
|
||||||
"Dual Barrel Alternate",
|
"Dual Barrel Alternate",
|
||||||
"Quad Barrel",
|
"Quad Barrel",
|
||||||
"Quad Barrel Alternate",
|
"Quad Barrel Alternate",
|
||||||
"Quad Barrel Double Alternate"
|
"Quad Barrel Double Alternate",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* impactTypeNames[]
|
inline const char* impactTypeNames[]{
|
||||||
{
|
|
||||||
"none",
|
"none",
|
||||||
"bullet_small",
|
"bullet_small",
|
||||||
"bullet_large",
|
"bullet_large",
|
||||||
@ -86,18 +79,16 @@ namespace T6
|
|||||||
"mortar_shell",
|
"mortar_shell",
|
||||||
"tank_shell",
|
"tank_shell",
|
||||||
"bolt",
|
"bolt",
|
||||||
"blade"
|
"blade",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szWeapStanceNames[]
|
inline const char* szWeapStanceNames[]{
|
||||||
{
|
|
||||||
"stand",
|
"stand",
|
||||||
"duck",
|
"duck",
|
||||||
"prone"
|
"prone",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szProjectileExplosionNames[]
|
inline const char* szProjectileExplosionNames[]{
|
||||||
{
|
|
||||||
"grenade",
|
"grenade",
|
||||||
"rocket",
|
"rocket",
|
||||||
"flashbang",
|
"flashbang",
|
||||||
@ -108,71 +99,40 @@ namespace T6
|
|||||||
"fire",
|
"fire",
|
||||||
"napalmblob",
|
"napalmblob",
|
||||||
"bolt",
|
"bolt",
|
||||||
"shrapnel span"
|
"shrapnel span",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* offhandClassNames[]
|
inline const char* offhandClassNames[]{
|
||||||
{
|
|
||||||
"None",
|
"None",
|
||||||
"Frag Grenade",
|
"Frag Grenade",
|
||||||
"Smoke Grenade",
|
"Smoke Grenade",
|
||||||
"Flash Grenade",
|
"Flash Grenade",
|
||||||
"Gear",
|
"Gear",
|
||||||
"Supply Drop Marker"
|
"Supply Drop Marker",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* offhandSlotNames[]
|
inline const char* offhandSlotNames[]{
|
||||||
{
|
|
||||||
"None",
|
"None",
|
||||||
"Lethal grenade",
|
"Lethal grenade",
|
||||||
"Tactical grenade",
|
"Tactical grenade",
|
||||||
"Equipment",
|
"Equipment",
|
||||||
"Specific use"
|
"Specific use",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* playerAnimTypeNames[]
|
inline const char* playerAnimTypeNames[]{
|
||||||
{
|
"none", "default", "other", "sniper", "m203", "hold", "briefcase", "reviver", "radio", "dualwield",
|
||||||
"none",
|
"remotecontrol", "crossbow", "minigun", "beltfed", "g11", "rearclip", "handleclip", "rearclipsniper", "ballisticknife", "singleknife",
|
||||||
"default",
|
"nopump", "hatchet", "grimreaper", "zipline", "riotshield", "tablet", "turned", "screecher", "staff",
|
||||||
"other",
|
|
||||||
"sniper",
|
|
||||||
"m203",
|
|
||||||
"hold",
|
|
||||||
"briefcase",
|
|
||||||
"reviver",
|
|
||||||
"radio",
|
|
||||||
"dualwield",
|
|
||||||
"remotecontrol",
|
|
||||||
"crossbow",
|
|
||||||
"minigun",
|
|
||||||
"beltfed",
|
|
||||||
"g11",
|
|
||||||
"rearclip",
|
|
||||||
"handleclip",
|
|
||||||
"rearclipsniper",
|
|
||||||
"ballisticknife",
|
|
||||||
"singleknife",
|
|
||||||
"nopump",
|
|
||||||
"hatchet",
|
|
||||||
"grimreaper",
|
|
||||||
"zipline",
|
|
||||||
"riotshield",
|
|
||||||
"tablet",
|
|
||||||
"turned",
|
|
||||||
"screecher",
|
|
||||||
"staff"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* activeReticleNames[]
|
inline const char* activeReticleNames[]{
|
||||||
{
|
|
||||||
"None",
|
"None",
|
||||||
"Pip-On-A-Stick",
|
"Pip-On-A-Stick",
|
||||||
"Bouncing Diamond",
|
"Bouncing Diamond",
|
||||||
"Missile Lock"
|
"Missile Lock",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* guidedMissileNames[]
|
inline const char* guidedMissileNames[]{
|
||||||
{
|
|
||||||
"None",
|
"None",
|
||||||
"Sidewinder",
|
"Sidewinder",
|
||||||
"Hellfire",
|
"Hellfire",
|
||||||
@ -181,87 +141,53 @@ namespace T6
|
|||||||
"WireGuided",
|
"WireGuided",
|
||||||
"TVGuided",
|
"TVGuided",
|
||||||
"Drone",
|
"Drone",
|
||||||
"HeatSeeking"
|
"HeatSeeking",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* stickinessNames[]
|
inline const char* stickinessNames[]{
|
||||||
{
|
|
||||||
"Don't stick",
|
"Don't stick",
|
||||||
"Stick to all",
|
"Stick to all",
|
||||||
"Stick to all, except ai and clients",
|
"Stick to all, except ai and clients",
|
||||||
"Stick to ground",
|
"Stick to ground",
|
||||||
"Stick to ground, maintain yaw",
|
"Stick to ground, maintain yaw",
|
||||||
"Stick to flesh"
|
"Stick to flesh",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* rotateTypeNames[]
|
inline const char* rotateTypeNames[]{
|
||||||
{
|
|
||||||
"Rotate both axis, grenade style",
|
"Rotate both axis, grenade style",
|
||||||
"Rotate one axis, blade style",
|
"Rotate one axis, blade style",
|
||||||
"Rotate like a cylinder"
|
"Rotate like a cylinder",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* overlayInterfaceNames[]
|
inline const char* overlayInterfaceNames[]{
|
||||||
{
|
|
||||||
"None",
|
"None",
|
||||||
"Javelin",
|
"Javelin",
|
||||||
"Turret Scope"
|
"Turret Scope",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* ammoCounterClipNames[]
|
inline const char* ammoCounterClipNames[]{
|
||||||
{
|
|
||||||
"None",
|
"None",
|
||||||
"Magazine",
|
"Magazine",
|
||||||
"ShortMagazine",
|
"ShortMagazine",
|
||||||
"Shotgun",
|
"Shotgun",
|
||||||
"Rocket",
|
"Rocket",
|
||||||
"Beltfed",
|
"Beltfed",
|
||||||
"AltWeapon"
|
"AltWeapon",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* weapIconRatioNames[]
|
inline const char* weapIconRatioNames[]{
|
||||||
{
|
|
||||||
"1:1",
|
"1:1",
|
||||||
"2:1",
|
"2:1",
|
||||||
"4:1"
|
"4:1",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szAttachmentTypeNames[]
|
inline const char* szAttachmentTypeNames[]{
|
||||||
{
|
"none", "acog", "dualclip", "dualoptic", "dw", "extbarrel", "extclip", "extramags", "fastads", "fastreload",
|
||||||
"none",
|
"fmj", "gl", "grip", "holo", "ir", "is", "longbreath", "mk", "mms", "rangefinder",
|
||||||
"acog",
|
"reflex", "rf", "sf", "silencer", "stackfire", "stalker", "steadyaim", "swayreduc", "tacknife", "vzoom",
|
||||||
"dualclip",
|
|
||||||
"dualoptic",
|
|
||||||
"dw",
|
|
||||||
"extbarrel",
|
|
||||||
"extclip",
|
|
||||||
"extramags",
|
|
||||||
"fastads",
|
|
||||||
"fastreload",
|
|
||||||
"fmj",
|
|
||||||
"gl",
|
|
||||||
"grip",
|
|
||||||
"holo",
|
|
||||||
"ir",
|
|
||||||
"is",
|
|
||||||
"longbreath",
|
|
||||||
"mk",
|
|
||||||
"mms",
|
|
||||||
"rangefinder",
|
|
||||||
"reflex",
|
|
||||||
"rf",
|
|
||||||
"sf",
|
|
||||||
"silencer",
|
|
||||||
"stackfire",
|
|
||||||
"stalker",
|
|
||||||
"steadyaim",
|
|
||||||
"swayreduc",
|
|
||||||
"tacknife",
|
|
||||||
"vzoom"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* szWeapFireTypeNames[]
|
inline const char* szWeapFireTypeNames[]{
|
||||||
{
|
|
||||||
"Full Auto",
|
"Full Auto",
|
||||||
"Single Shot",
|
"Single Shot",
|
||||||
"2-Round Burst",
|
"2-Round Burst",
|
||||||
@ -271,19 +197,17 @@ namespace T6
|
|||||||
"Stacked Fire",
|
"Stacked Fire",
|
||||||
"Minigun",
|
"Minigun",
|
||||||
"Charge Shot",
|
"Charge Shot",
|
||||||
"Jetgun"
|
"Jetgun",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* penetrateTypeNames[]
|
inline const char* penetrateTypeNames[]{
|
||||||
{
|
|
||||||
"none",
|
"none",
|
||||||
"small",
|
"small",
|
||||||
"medium",
|
"medium",
|
||||||
"large"
|
"large",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* s_constraintTypeNames[]
|
inline const char* s_constraintTypeNames[]{
|
||||||
{
|
|
||||||
"none",
|
"none",
|
||||||
"point",
|
"point",
|
||||||
"distance",
|
"distance",
|
||||||
@ -296,8 +220,7 @@ namespace T6
|
|||||||
"light",
|
"light",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* s_vehicleClassNames[]
|
inline const char* s_vehicleClassNames[]{
|
||||||
{
|
|
||||||
"4 wheel",
|
"4 wheel",
|
||||||
"motorcycle",
|
"motorcycle",
|
||||||
"tank",
|
"tank",
|
||||||
@ -307,8 +230,7 @@ namespace T6
|
|||||||
"helicopter",
|
"helicopter",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* s_vehicleCameraModes[]
|
inline const char* s_vehicleCameraModes[]{
|
||||||
{
|
|
||||||
"first",
|
"first",
|
||||||
"chase",
|
"chase",
|
||||||
"view",
|
"view",
|
||||||
@ -319,52 +241,20 @@ namespace T6
|
|||||||
"vtol",
|
"vtol",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* s_tractionTypeNames[]
|
inline const char* s_tractionTypeNames[]{
|
||||||
{
|
|
||||||
"TRACTION_TYPE_FRONT",
|
"TRACTION_TYPE_FRONT",
|
||||||
"TRACTION_TYPE_BACK",
|
"TRACTION_TYPE_BACK",
|
||||||
"TRACTION_TYPE_ALL_WD",
|
"TRACTION_TYPE_ALL_WD",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* tracerTypeNames[]
|
inline const char* tracerTypeNames[]{
|
||||||
{
|
|
||||||
"Laser",
|
"Laser",
|
||||||
"Smoke"
|
"Smoke",
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const char* bounceSoundSuffixes[]
|
inline const char* bounceSoundSuffixes[]{
|
||||||
{
|
"_default", "_bark", "_brick", "_carpet", "_cloth", "_concrete", "_dirt", "_flesh", "_foliage", "_glass", "_grass",
|
||||||
"_default",
|
"_gravel", "_ice", "_metal", "_mud", "_paper", "_plaster", "_rock", "_sand", "_snow", "_water", "_wood",
|
||||||
"_bark",
|
"_asphalt", "_ceramic", "_plastic", "_rubber", "_cushion", "_fruit", "_paintedmetal", "_player", "_tallgrass", "_riotshield",
|
||||||
"_brick",
|
|
||||||
"_carpet",
|
|
||||||
"_cloth",
|
|
||||||
"_concrete",
|
|
||||||
"_dirt",
|
|
||||||
"_flesh",
|
|
||||||
"_foliage",
|
|
||||||
"_glass",
|
|
||||||
"_grass",
|
|
||||||
"_gravel",
|
|
||||||
"_ice",
|
|
||||||
"_metal",
|
|
||||||
"_mud",
|
|
||||||
"_paper",
|
|
||||||
"_plaster",
|
|
||||||
"_rock",
|
|
||||||
"_sand",
|
|
||||||
"_snow",
|
|
||||||
"_water",
|
|
||||||
"_wood",
|
|
||||||
"_asphalt",
|
|
||||||
"_ceramic",
|
|
||||||
"_plastic",
|
|
||||||
"_rubber",
|
|
||||||
"_cushion",
|
|
||||||
"_fruit",
|
|
||||||
"_paintedmetal",
|
|
||||||
"_player",
|
|
||||||
"_tallgrass",
|
|
||||||
"_riotshield"
|
|
||||||
};
|
};
|
||||||
}
|
} // namespace T6
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace T6
|
namespace T6
|
||||||
{
|
{
|
||||||
inline cspField_t phys_constraints_fields[]
|
inline cspField_t phys_constraints_fields[]{
|
||||||
{
|
|
||||||
{"c1_type", offsetof(PhysConstraints, data[0].type), CFT_TYPE },
|
{"c1_type", offsetof(PhysConstraints, data[0].type), CFT_TYPE },
|
||||||
{"c1_bone1_name", offsetof(PhysConstraints, data[0].target_bone1), CSPFT_STRING},
|
{"c1_bone1_name", offsetof(PhysConstraints, data[0].target_bone1), CSPFT_STRING},
|
||||||
{"c1_bone2_name", offsetof(PhysConstraints, data[0].target_bone2), CSPFT_STRING},
|
{"c1_bone2_name", offsetof(PhysConstraints, data[0].target_bone2), CSPFT_STRING},
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace T6
|
namespace T6
|
||||||
{
|
{
|
||||||
inline cspField_t phys_preset_fields[]
|
inline cspField_t phys_preset_fields[]{
|
||||||
{
|
|
||||||
{"mass", offsetof(PhysPresetInfo, mass), CSPFT_FLOAT },
|
{"mass", offsetof(PhysPresetInfo, mass), CSPFT_FLOAT },
|
||||||
{"bounce", offsetof(PhysPresetInfo, bounce), CSPFT_FLOAT },
|
{"bounce", offsetof(PhysPresetInfo, bounce), CSPFT_FLOAT },
|
||||||
{"friction", offsetof(PhysPresetInfo, friction), CSPFT_FLOAT },
|
{"friction", offsetof(PhysPresetInfo, friction), CSPFT_FLOAT },
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace T6
|
namespace T6
|
||||||
{
|
{
|
||||||
inline cspField_t tracer_fields[]
|
inline cspField_t tracer_fields[]{
|
||||||
{
|
|
||||||
{"type", offsetof(TracerDef, type), TFT_TRACERTYPE},
|
{"type", offsetof(TracerDef, type), TFT_TRACERTYPE},
|
||||||
{"material", offsetof(TracerDef, material), CSPFT_MATERIAL},
|
{"material", offsetof(TracerDef, material), CSPFT_MATERIAL},
|
||||||
{"drawInterval", offsetof(TracerDef, drawInterval), CSPFT_INT },
|
{"drawInterval", offsetof(TracerDef, drawInterval), CSPFT_INT },
|
||||||
@ -35,6 +34,6 @@ namespace T6
|
|||||||
{"colorR4", offsetof(TracerDef, colors[4].r), CSPFT_FLOAT },
|
{"colorR4", offsetof(TracerDef, colors[4].r), CSPFT_FLOAT },
|
||||||
{"colorG4", offsetof(TracerDef, colors[4].g), CSPFT_FLOAT },
|
{"colorG4", offsetof(TracerDef, colors[4].g), CSPFT_FLOAT },
|
||||||
{"colorB4", offsetof(TracerDef, colors[4].b), CSPFT_FLOAT },
|
{"colorB4", offsetof(TracerDef, colors[4].b), CSPFT_FLOAT },
|
||||||
{"colorA4", offsetof(TracerDef, colors[4].a), CSPFT_FLOAT}
|
{"colorA4", offsetof(TracerDef, colors[4].a), CSPFT_FLOAT },
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace T6
|
namespace T6
|
||||||
{
|
{
|
||||||
inline cspField_t vehicle_fields[]
|
inline cspField_t vehicle_fields[]{
|
||||||
{
|
|
||||||
{"type", offsetof(VehicleDef, type), VFT_TYPE },
|
{"type", offsetof(VehicleDef, type), VFT_TYPE },
|
||||||
{"remoteControl", offsetof(VehicleDef, remoteControl), CSPFT_QBOOLEAN },
|
{"remoteControl", offsetof(VehicleDef, remoteControl), CSPFT_QBOOLEAN },
|
||||||
{"bulletDamage", offsetof(VehicleDef, bulletDamage), CSPFT_QBOOLEAN },
|
{"bulletDamage", offsetof(VehicleDef, bulletDamage), CSPFT_QBOOLEAN },
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace T6
|
namespace T6
|
||||||
{
|
{
|
||||||
inline cspField_t attachment_fields[]
|
inline cspField_t attachment_fields[]{
|
||||||
{
|
|
||||||
{"displayName", offsetof(WeaponAttachment, szDisplayName), CSPFT_STRING },
|
{"displayName", offsetof(WeaponAttachment, szDisplayName), CSPFT_STRING },
|
||||||
{"attachmentType", offsetof(WeaponAttachment, attachmentType), AFT_ATTACHMENTTYPE},
|
{"attachmentType", offsetof(WeaponAttachment, attachmentType), AFT_ATTACHMENTTYPE},
|
||||||
{"penetrateType", offsetof(WeaponAttachment, penetrateType), AFT_PENETRATE_TYPE},
|
{"penetrateType", offsetof(WeaponAttachment, penetrateType), AFT_PENETRATE_TYPE},
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace T6
|
namespace T6
|
||||||
{
|
{
|
||||||
inline cspField_t attachment_unique_fields[]
|
inline cspField_t attachment_unique_fields[]{
|
||||||
{
|
|
||||||
{"attachmentType", offsetof(WeaponAttachmentUniqueFull, attachment.attachmentType), AUFT_ATTACHMENTTYPE },
|
{"attachmentType", offsetof(WeaponAttachmentUniqueFull, attachment.attachmentType), AUFT_ATTACHMENTTYPE },
|
||||||
{"locNone", offsetof(WeaponAttachmentUniqueFull, locationDamageMultipliers[HITLOC_NONE]), CSPFT_FLOAT },
|
{"locNone", offsetof(WeaponAttachmentUniqueFull, locationDamageMultipliers[HITLOC_NONE]), CSPFT_FLOAT },
|
||||||
{"locHelmet", offsetof(WeaponAttachmentUniqueFull, locationDamageMultipliers[HITLOC_HELMET]), CSPFT_FLOAT },
|
{"locHelmet", offsetof(WeaponAttachmentUniqueFull, locationDamageMultipliers[HITLOC_HELMET]), CSPFT_FLOAT },
|
||||||
@ -205,6 +204,6 @@ namespace T6
|
|||||||
{"customFloat2", offsetof(WeaponAttachmentUniqueFull, attachment.customFloat2), CSPFT_FLOAT },
|
{"customFloat2", offsetof(WeaponAttachmentUniqueFull, attachment.customFloat2), CSPFT_FLOAT },
|
||||||
{"customBool0", offsetof(WeaponAttachmentUniqueFull, attachment.customBool0), CSPFT_BOOL },
|
{"customBool0", offsetof(WeaponAttachmentUniqueFull, attachment.customBool0), CSPFT_BOOL },
|
||||||
{"customBool1", offsetof(WeaponAttachmentUniqueFull, attachment.customBool1), CSPFT_BOOL },
|
{"customBool1", offsetof(WeaponAttachmentUniqueFull, attachment.customBool1), CSPFT_BOOL },
|
||||||
{"customBool2", offsetof(WeaponAttachmentUniqueFull, attachment.customBool2), CSPFT_BOOL}
|
{"customBool2", offsetof(WeaponAttachmentUniqueFull, attachment.customBool2), CSPFT_BOOL },
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace T6
|
namespace T6
|
||||||
{
|
{
|
||||||
inline cspField_t weapon_fields[]
|
inline cspField_t weapon_fields[]{
|
||||||
{
|
|
||||||
{"displayName", offsetof(WeaponFullDef, weapVariantDef.szDisplayName), CSPFT_STRING },
|
{"displayName", offsetof(WeaponFullDef, weapVariantDef.szDisplayName), CSPFT_STRING },
|
||||||
{"AIOverlayDescription", offsetof(WeaponFullDef, weapDef.szOverlayName), CSPFT_STRING },
|
{"AIOverlayDescription", offsetof(WeaponFullDef, weapDef.szOverlayName), CSPFT_STRING },
|
||||||
{"modeName", offsetof(WeaponFullDef, weapDef.szModeName), CSPFT_STRING },
|
{"modeName", offsetof(WeaponFullDef, weapDef.szModeName), CSPFT_STRING },
|
||||||
@ -1032,6 +1031,6 @@ namespace T6
|
|||||||
{"customBool1", offsetof(WeaponFullDef, weapDef.customBool1), CSPFT_BOOL },
|
{"customBool1", offsetof(WeaponFullDef, weapDef.customBool1), CSPFT_BOOL },
|
||||||
{"customBool2", offsetof(WeaponFullDef, weapDef.customBool2), CSPFT_BOOL },
|
{"customBool2", offsetof(WeaponFullDef, weapDef.customBool2), CSPFT_BOOL },
|
||||||
{"attachments", offsetof(WeaponFullDef, attachments), WFT_ATTACHMENTS },
|
{"attachments", offsetof(WeaponFullDef, attachments), WFT_ATTACHMENTS },
|
||||||
{"attachmentUniques", offsetof(WeaponFullDef, attachmentUniques), WFT_ATTACHMENT_UNIQUES}
|
{"attachmentUniques", offsetof(WeaponFullDef, attachmentUniques), WFT_ATTACHMENT_UNIQUES },
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace T6
|
namespace T6
|
||||||
{
|
{
|
||||||
inline cspField_t zbarrier_fields[]
|
inline cspField_t zbarrier_fields[]{
|
||||||
{
|
|
||||||
{"delayBetweenGeneralRepSounds", offsetof(ZBarrierDef, delayBetweenRepSoundsDuration), CSPFT_FLOAT },
|
{"delayBetweenGeneralRepSounds", offsetof(ZBarrierDef, delayBetweenRepSoundsDuration), CSPFT_FLOAT },
|
||||||
{"earthquakeMaxDuration", offsetof(ZBarrierDef, earthquakeMaxDuration), CSPFT_FLOAT },
|
{"earthquakeMaxDuration", offsetof(ZBarrierDef, earthquakeMaxDuration), CSPFT_FLOAT },
|
||||||
{"earthquakeMaxScale", offsetof(ZBarrierDef, earthquakeMaxScale), CSPFT_FLOAT },
|
{"earthquakeMaxScale", offsetof(ZBarrierDef, earthquakeMaxScale), CSPFT_FLOAT },
|
||||||
|
@ -25,4 +25,4 @@ namespace T6
|
|||||||
static constexpr const char* GDF_FILENAME_WEAPON_ATTACHMENT_UNIQUE = "attachmentunique.gdf";
|
static constexpr const char* GDF_FILENAME_WEAPON_ATTACHMENT_UNIQUE = "attachmentunique.gdf";
|
||||||
static constexpr const char* GDF_FILENAME_ZBARRIER = "zbarrier.gdf";
|
static constexpr const char* GDF_FILENAME_ZBARRIER = "zbarrier.gdf";
|
||||||
};
|
};
|
||||||
}
|
} // namespace T6
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "InfoString.h"
|
#include "InfoString.h"
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <sstream>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
|
||||||
const std::string InfoString::EMPTY_VALUE;
|
const std::string InfoString::EMPTY_VALUE;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <istream>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include "Utils/ClassUtils.h"
|
|
||||||
#include "Obj/Gdt/GdtEntry.h"
|
#include "Obj/Gdt/GdtEntry.h"
|
||||||
|
#include "Utils/ClassUtils.h"
|
||||||
|
|
||||||
|
#include <istream>
|
||||||
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class InfoString
|
class InfoString
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "Game/GameLanguage.h"
|
#include "Game/GameLanguage.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class LocalizeCommon
|
class LocalizeCommon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include "LocalizeFile.h"
|
#include "LocalizeFile.h"
|
||||||
|
|
||||||
LocalizeFileEntry::LocalizeFileEntry()
|
LocalizeFileEntry::LocalizeFileEntry() = default;
|
||||||
= default;
|
|
||||||
|
|
||||||
LocalizeFileEntry::LocalizeFileEntry(std::string key, std::string value)
|
LocalizeFileEntry::LocalizeFileEntry(std::string key, std::string value)
|
||||||
: m_key(std::move(key)),
|
: m_key(std::move(key)),
|
||||||
|
@ -40,8 +40,7 @@ bool operator<(const ObjNormal& lhs, const ObjNormal& rhs)
|
|||||||
|
|
||||||
bool operator==(const ObjUv& lhs, const ObjUv& rhs)
|
bool operator==(const ObjUv& lhs, const ObjUv& rhs)
|
||||||
{
|
{
|
||||||
return std::fabs(lhs.uv[0] - rhs.uv[0]) < std::numeric_limits<float>::epsilon()
|
return std::fabs(lhs.uv[0] - rhs.uv[0]) < std::numeric_limits<float>::epsilon() && std::fabs(lhs.uv[1] - rhs.uv[1]) < std::numeric_limits<float>::epsilon();
|
||||||
&& std::fabs(lhs.uv[1] - rhs.uv[1]) < std::numeric_limits<float>::epsilon();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const ObjUv& lhs, const ObjUv& rhs)
|
bool operator!=(const ObjUv& lhs, const ObjUv& rhs)
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include "Utils/DistinctMapper.h"
|
|
||||||
#include "Math/Quaternion.h"
|
#include "Math/Quaternion.h"
|
||||||
|
#include "Utils/DistinctMapper.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
struct XModelObject
|
struct XModelObject
|
||||||
{
|
{
|
||||||
@ -64,22 +64,28 @@ struct XModelMaterial
|
|||||||
float ambientColor[4];
|
float ambientColor[4];
|
||||||
float incandescence[4];
|
float incandescence[4];
|
||||||
float coeffs[2];
|
float coeffs[2];
|
||||||
struct {
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
float x;
|
float x;
|
||||||
int y;
|
int y;
|
||||||
} glow;
|
} glow;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
float y;
|
float y;
|
||||||
} refractive;
|
} refractive;
|
||||||
|
|
||||||
float specularColor[4];
|
float specularColor[4];
|
||||||
float reflectiveColor[4];
|
float reflectiveColor[4];
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
float y;
|
float y;
|
||||||
} reflective;
|
} reflective;
|
||||||
|
|
||||||
float blinn[2];
|
float blinn[2];
|
||||||
float phong;
|
float phong;
|
||||||
std::string colorMapName;
|
std::string colorMapName;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include "Gdt.h"
|
#include "Gdt.h"
|
||||||
|
|
||||||
Gdt::Gdt()
|
Gdt::Gdt() = default;
|
||||||
= default;
|
|
||||||
|
|
||||||
Gdt::Gdt(GdtVersion version)
|
Gdt::Gdt(GdtVersion version)
|
||||||
: m_version(std::move(version))
|
: m_version(std::move(version))
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include "GdtEntry.h"
|
#include "GdtEntry.h"
|
||||||
#include "GdtVersion.h"
|
#include "GdtVersion.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class Gdt
|
class Gdt
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -26,8 +26,7 @@ int GdtReader::PeekChar()
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
c = m_stream.get();
|
c = m_stream.get();
|
||||||
}
|
} while (isspace(c));
|
||||||
while (isspace(c));
|
|
||||||
|
|
||||||
m_peeked = true;
|
m_peeked = true;
|
||||||
m_char = c;
|
m_char = c;
|
||||||
@ -46,8 +45,7 @@ int GdtReader::NextChar()
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
c = m_stream.get();
|
c = m_stream.get();
|
||||||
}
|
} while (isspace(c));
|
||||||
while (isspace(c));
|
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
@ -135,7 +133,6 @@ bool GdtReader::ReadProperties(GdtEntry& entry)
|
|||||||
entry.m_properties.emplace(std::move(propertyKey), std::move(propertyValue));
|
entry.m_properties.emplace(std::move(propertyKey), std::move(propertyValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (NextChar() != '}')
|
if (NextChar() != '}')
|
||||||
{
|
{
|
||||||
PrintError("Expected closing tags");
|
PrintError("Expected closing tags");
|
||||||
@ -147,8 +144,7 @@ bool GdtReader::ReadProperties(GdtEntry& entry)
|
|||||||
|
|
||||||
bool GdtReader::AddEntry(Gdt& gdt, GdtEntry& entry) const
|
bool GdtReader::AddEntry(Gdt& gdt, GdtEntry& entry) const
|
||||||
{
|
{
|
||||||
if (entry.m_name == GdtConst::VERSION_ENTRY_NAME
|
if (entry.m_name == GdtConst::VERSION_ENTRY_NAME && entry.m_gdf_name == GdtConst::VERSION_ENTRY_GDF)
|
||||||
&& entry.m_gdf_name == GdtConst::VERSION_ENTRY_GDF)
|
|
||||||
{
|
{
|
||||||
auto foundEntry = entry.m_properties.find(GdtConst::VERSION_KEY_GAME);
|
auto foundEntry = entry.m_properties.find(GdtConst::VERSION_KEY_GAME);
|
||||||
if (foundEntry == entry.m_properties.end())
|
if (foundEntry == entry.m_properties.end())
|
||||||
@ -258,7 +254,6 @@ bool GdtReader::Read(Gdt& gdt)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (NextChar() != '}')
|
if (NextChar() != '}')
|
||||||
{
|
{
|
||||||
PrintError("Expected closing tags");
|
PrintError("Expected closing tags");
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "Gdt.h"
|
#include "Gdt.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
class GdtReader
|
class GdtReader
|
||||||
{
|
{
|
||||||
std::istream& m_stream;
|
std::istream& m_stream;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
#include "Utils/FileUtils.h"
|
#include "Utils/FileUtils.h"
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
namespace ipak_consts
|
namespace ipak_consts
|
||||||
{
|
{
|
||||||
static constexpr uint32_t IPAK_MAGIC = FileUtils::MakeMagic32('K', 'A', 'P', 'I');
|
static constexpr uint32_t IPAK_MAGIC = FileUtils::MakeMagic32('K', 'A', 'P', 'I');
|
||||||
@ -22,7 +22,7 @@ namespace ipak_consts
|
|||||||
static constexpr uint32_t IPAK_COMMAND_SKIP = 0xCF;
|
static constexpr uint32_t IPAK_COMMAND_SKIP = 0xCF;
|
||||||
|
|
||||||
static_assert(IPAK_COMMAND_DEFAULT_SIZE <= IPAK_CHUNK_SIZE);
|
static_assert(IPAK_COMMAND_DEFAULT_SIZE <= IPAK_CHUNK_SIZE);
|
||||||
}
|
} // namespace ipak_consts
|
||||||
|
|
||||||
typedef uint32_t IPakHash;
|
typedef uint32_t IPakHash;
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include "D3D9ShaderAnalyser.h"
|
#include "D3D9ShaderAnalyser.h"
|
||||||
|
|
||||||
|
#include "Utils/FileUtils.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "Utils/FileUtils.h"
|
|
||||||
|
|
||||||
using namespace d3d9;
|
using namespace d3d9;
|
||||||
|
|
||||||
namespace d3d9
|
namespace d3d9
|
||||||
@ -131,7 +131,10 @@ namespace d3d9
|
|||||||
return str[strLen] == '\0';
|
return str[strLen] == '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PopulateShaderConstantFromConstantInfo(ShaderConstant& shaderConstant, const char* commentStart, const size_t commentSize, const ConstantInfo& constantInfo)
|
bool PopulateShaderConstantFromConstantInfo(ShaderConstant& shaderConstant,
|
||||||
|
const char* commentStart,
|
||||||
|
const size_t commentSize,
|
||||||
|
const ConstantInfo& constantInfo)
|
||||||
{
|
{
|
||||||
if (constantInfo.Name)
|
if (constantInfo.Name)
|
||||||
{
|
{
|
||||||
@ -231,7 +234,7 @@ namespace d3d9
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
} // namespace d3d9
|
||||||
|
|
||||||
std::unique_ptr<ShaderInfo> ShaderAnalyser::GetShaderInfo(const uint32_t* shaderByteCode, const size_t shaderByteCodeSize)
|
std::unique_ptr<ShaderInfo> ShaderAnalyser::GetShaderInfo(const uint32_t* shaderByteCode, const size_t shaderByteCodeSize)
|
||||||
{
|
{
|
||||||
|
@ -97,4 +97,4 @@ namespace d3d9
|
|||||||
public:
|
public:
|
||||||
static std::unique_ptr<ShaderInfo> GetShaderInfo(const uint32_t* shaderByteCode, size_t shaderByteCodeSize);
|
static std::unique_ptr<ShaderInfo> GetShaderInfo(const uint32_t* shaderByteCode, size_t shaderByteCodeSize);
|
||||||
};
|
};
|
||||||
}
|
} // namespace d3d9
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user