Skip to content

Commit

Permalink
Some struct updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ineed bots committed Sep 26, 2023
1 parent 069442d commit e6a0913
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 47 deletions.
38 changes: 38 additions & 0 deletions src/game/clientscript/clientscript_public.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,44 @@ namespace game
VAR_ENDON_LIST = 0x18,
};

enum scr_builtin_type_t
{
BUILTIN_ANY = 0x0,
BUILTIN_DEVELOPER_ONLY = 0x1,
};

enum Scr_SourceType_t
{
SOURCE_TYPE_NONE = 0x0,
SOURCE_TYPE_BREAKPOINT = 0x1,
SOURCE_TYPE_CALL = 0x2,
};

enum scr_abort_t
{
SCR_ABORT_NONE = 0x0,
SCR_ABORT_CONTINUE = 0x1,
SCR_ABORT_BREAK = 0x2,
SCR_ABORT_RETURN = 0x3,
SCR_ABORT_MAX = 0x3,
};

enum scr_call_type_t
{
CALL_NONE = 0x0,
CALL_BUILTIN = 0x1,
CALL_THREAD = 0x2,
CALL_FUNCTION = 0x3,
};

enum sl_user_type_e
{
SL_USER_GAME = 0x1,
SL_USER_TEMP = 0x2,
SL_USER_XZONE = 0x4,
SL_USER_XZONE_TEMP = 0x8,
};

#pragma endregion

#pragma region "structs"
Expand Down
57 changes: 48 additions & 9 deletions src/game/enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3763,6 +3763,9 @@ namespace game
CRITSECT_SCRIPT_STRING = 0xB,
CRITSECT_MEMORY_TREE = 0xC,
CRITSECT_SYS_EVENT_QUEUE = 0xE,
CRITSECT_DXDEVICE = 0x11,
CRITSECT_DXDEVICE_GLOB = 0x12,
CRITSECT_MISSING_ASSET = 0x13,
CRITSECT_PHYSICS_UPDATE = 0x15,
CRITSECT_CINEMATIC = 0x19,
CRITSECT_CINEMATIC_TARGET_CHANGE = 0x1A,
Expand Down Expand Up @@ -3897,15 +3900,6 @@ namespace game
HUDELEM_UPDATE_ARCHIVAL_AND_CURRENT = 0x3,
};

enum sourceType_e
{
SOURCE_TYPE_BREAKPOINT = 0x1,
SOURCE_TYPE_CALL = 0x2,
SOURCE_TYPE_THREAD_START = 0x4,
SOURCE_TYPE_BUILTIN_CALL = 0x8,
SOURCE_TYPE_NOTIFY = 0x10,
};

enum animBodyPart_t
{
ANIM_BP_UNUSED = 0x0,
Expand All @@ -3915,6 +3909,51 @@ namespace game
NUM_ANIM_BODYPARTS = 0x4,
};

enum zone_flags_e
{
ZONE_FLAG_none = 0x0,
DB_ZONE_COMMON_LOC = 0x1,
DB_ZONE_LEVEL_LOC = 0x2,
DB_ZONE_CODE = 0x4,
DB_ZONE_COMMON = 0x8,
DB_ZONE_LEVEL = 0x10,
DB_ZONE_LOAD = 0x20,
DB_ZONE_MYCHANGES = 0x40,
ZONE_FLAG_unk3 = 0x80,
DB_ZONE_LEVELOVERLAY = 0x100, // patch, not 'so'
DB_ZONE_PATCH = 0x200,
ZONE_FLAG_unk5 = 0x400,
DB_ZONE_MOD = 0x800,
};

enum xfile_block_type_e
{
XFILE_BLOCK_TEMP = 0x0,
XFILE_BLOCK_RUNTIME = 0x1,
XFILE_BLOCK_RUNTIME_BEGIN = 0x1,
XFILE_BLOCK_LARGE_RUNTIME = 0x2,
XFILE_BLOCK_PHYSICAL_RUNTIME = 0x3,
XFILE_BLOCK_VIRTUAL = 0x4,
XFILE_BLOCK_RUNTIME_END = 0x4,
XFILE_BLOCK_LARGE = 0x5,
XFILE_BLOCK_PHYSICAL = 0x6,
MAX_XFILE_COUNT = 0x7,
};

enum dm_memory_tyep_e
{
DM_MEMORY_TEMP = 0x0,
DM_MEMORY_VIRTUAL = 0x1,
DM_MEMORY_PHYSICAL = 0x2,
};

enum phys_alloc_type_e
{
PHYS_ALLOC_LOW = 0x0,
PHYS_ALLOC_HIGH = 0x1,
PHYS_ALLOC_COUNT = 0x2,
};

#ifdef __cplusplus
}
#endif
94 changes: 57 additions & 37 deletions src/game/structs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3604,17 +3604,6 @@ namespace game
ASSERT_STRUCT_OFFSET(TLSData_t, field_38, 0x38);
ASSERT_STRUCT_OFFSET(TLSData_t, field_3C, 0x3C);

struct XZoneInfo
{
char * name; //OFS: 0x0 SIZE: 0x4
int allocFlags; //OFS: 0x4 SIZE: 0x4
int freeFlags; //OFS: 0x8 SIZE: 0x4
};
ASSERT_STRUCT_SIZE(XZoneInfo, 0xC);
ASSERT_STRUCT_OFFSET(XZoneInfo, name, 0x0);
ASSERT_STRUCT_OFFSET(XZoneInfo, allocFlags, 0x4);
ASSERT_STRUCT_OFFSET(XZoneInfo, freeFlags, 0x8);

union DvarValue
{
bool enabled; //OFS: 0x0 SIZE: 0x1
Expand Down Expand Up @@ -11407,17 +11396,6 @@ namespace game
ASSERT_STRUCT_OFFSET(LargeLocal, startPos, 0x0);
ASSERT_STRUCT_OFFSET(LargeLocal, size, 0x4);

struct XFile
{
unsigned int size; //OFS: 0x0 SIZE: 0x4
unsigned int externalSize; //OFS: 0x4 SIZE: 0x4
unsigned int blockSize[8]; //OFS: 0x8 SIZE: 0x20
};
ASSERT_STRUCT_SIZE(XFile, 0x28);
ASSERT_STRUCT_OFFSET(XFile, size, 0x0);
ASSERT_STRUCT_OFFSET(XFile, externalSize, 0x4);
ASSERT_STRUCT_OFFSET(XFile, blockSize, 0x8);

union pointtrace_or_moveclip_u
{
pointtrace_t point; //OFS: 0x0 SIZE: 0x40
Expand Down Expand Up @@ -12777,21 +12755,6 @@ namespace game
ASSERT_STRUCT_OFFSET(GfxCmdStretchPicRotateXY, color, 0x28);
ASSERT_STRUCT_OFFSET(GfxCmdStretchPicRotateXY, rotation, 0x2C);

struct XZoneMemory
{
XBlock blocks[9]; //OFS: 0x0 SIZE: 0x48
char * lockedVertexData; //OFS: 0x48 SIZE: 0x4
char * lockedIndexData; //OFS: 0x4C SIZE: 0x4
void * vertexBuffer; //OFS: 0x50 SIZE: 0x4
void * indexBuffer; //OFS: 0x54 SIZE: 0x4
};
ASSERT_STRUCT_SIZE(XZoneMemory, 0x58);
ASSERT_STRUCT_OFFSET(XZoneMemory, blocks, 0x0);
ASSERT_STRUCT_OFFSET(XZoneMemory, lockedVertexData, 0x48);
ASSERT_STRUCT_OFFSET(XZoneMemory, lockedIndexData, 0x4C);
ASSERT_STRUCT_OFFSET(XZoneMemory, vertexBuffer, 0x50);
ASSERT_STRUCT_OFFSET(XZoneMemory, indexBuffer, 0x54);

struct SaveMemoryGlob
{
SaveGame * committedGameSave; //OFS: 0x0 SIZE: 0x4
Expand Down Expand Up @@ -13324,7 +13287,64 @@ namespace game
ASSERT_STRUCT_OFFSET(DynEnt_FadeData, id, 0x0);
ASSERT_STRUCT_OFFSET(DynEnt_FadeData, startTime, 0x4);

struct __declspec(align(2)) GfxMetrics
{
unsigned __int16 cubemapShotRes;
unsigned __int16 cubemapShotPixelBorder;
bool hasAnisotropicMinFilter;
bool hasAnisotropicMagFilter;
int maxAnisotropy;
int maxClipPlanes;
unsigned __int8 shadowmapSamplerState;
bool slopeScaleDepthBias;
bool canMipCubemaps;
};

// cCurve

struct CommonFastFileLoad
{
int code_post_gfx_flags;
int patch_flags;
int ui_flags;
int common_flags;
int flags5;
int localized_common_flags;
const char *code_post_gfx;
const char *patch;
const char *ui;
const char *common;
int filename4;
const char *localized_common;
const char *mod;
};

struct GfxWindowParms
{
HWND__ *hwnd;
int hz;
bool fullscreen;
int x;
int y;
int sceneWidth;
int sceneHeight;
int displayWidth;
int displayHeight;
int aaSamples;
};

struct stream_source_info_t
{
char Stream;
char Offset;
char Type;
};

struct stream_dest_info_t
{
char Usage;
char UsageIndex;
};

#ifdef __cplusplus
}
Expand Down
25 changes: 24 additions & 1 deletion src/game/xasset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5318,7 +5318,8 @@ namespace game
RawFile* rawfile; //OFS: 0x1A SIZE: 0x4
StringTable* stringTable; //OFS: 0x1B SIZE: 0x4
PackIndex* packIndex; //OFS: 0x1C SIZE: 0x4
void* data; //OFS: 0x1D SIZE: 0x4
snd_alias_list_t* sound; //OFS: 0x1D SIZE: 0x4
void* data; //OFS: 0x1E SIZE: 0x4
};

struct XAsset
Expand Down Expand Up @@ -5417,6 +5418,28 @@ namespace game
ASSERT_STRUCT_OFFSET(XZone, allocType, 0x8);
ASSERT_STRUCT_OFFSET(XZone, blocks, 0xC);

struct XFile
{
unsigned int size; //OFS: 0x0 SIZE: 0x4
unsigned int externalSize; //OFS: 0x4 SIZE: 0x4
unsigned int blockSize[7]; //OFS: 0x8 SIZE: 0x1C
};
ASSERT_STRUCT_SIZE(XFile, 0x24);
ASSERT_STRUCT_OFFSET(XFile, size, 0x0);
ASSERT_STRUCT_OFFSET(XFile, externalSize, 0x4);
ASSERT_STRUCT_OFFSET(XFile, blockSize, 0x8);

struct XZoneInfo
{
char * name; //OFS: 0x0 SIZE: 0x4
int allocFlags; //OFS: 0x4 SIZE: 0x4
int freeFlags; //OFS: 0x8 SIZE: 0x4
};
ASSERT_STRUCT_SIZE(XZoneInfo, 0xC);
ASSERT_STRUCT_OFFSET(XZoneInfo, name, 0x0);
ASSERT_STRUCT_OFFSET(XZoneInfo, allocFlags, 0x4);
ASSERT_STRUCT_OFFSET(XZoneInfo, freeFlags, 0x8);

#ifdef __cplusplus
WEAK symbol<XAssetHeader(XAssetType type, const char* name, bool errorIfMissing, int waitTime)>DB_FindXAssetHeader{ 0x0, 0x48DA30 };
}
Expand Down
1 change: 1 addition & 0 deletions src/stdinc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#pragma warning(disable: 4324)
#pragma warning(disable: 4459)
#pragma warning(disable: 4611)
#pragma warning(disable: 4359)
#pragma warning(error: 4409)

#define DLL_EXPORT extern "C" __declspec(dllexport)
Expand Down

0 comments on commit e6a0913

Please sign in to comment.