Maintenance: Add mandatory field offset markers /* XXXX */ and assertions to Contents headers (part 1: Actors, Effects, Ground, Hotke

Batch #1066 by ragnarok-clanker: no function's compiled code changes; checked with 70 compiled unit(s), including every includer of Source/Contents/Actors/RenderObject.h, Source/Contents/CashEmotionMgr.h, Source/Contents/Effects/AttachedEffect.h, Source/Contents/Effects/Effect.h, Source/Contents/Effects/EffectActor.h, Source/Contents/Effects/EffectParticle.h, Source/Contents/Effects/EffectPrimitiveState.h, Source/Contents/Emblems/GuildEmblemReqBundle.h, Source/Contents/Ground/GroundGeometry.h, Source/Contents/Ground/GroundSpatial.h, Source/Contents/Ground/GroundWaterState.h, Source/Contents/Ground/TerrainHeight.h, Source/Contents/Hotkeys/EmotionHotkeys.h, Source/Contents/Hotkeys/HotkeyInfo.h, Source/Contents/Hotkeys/UserHotkeyMgr.h, Source/Contents/InstantVar.h.
This commit is contained in:
ragnarok-clanker 2026-10-27 13:57:41 +00:00
commit 02df811b36
16 changed files with 112 additions and 66 deletions

View file

@ -4,6 +4,8 @@
#include "Contents/Actors/GameObject.h"
#include "Contents/Actors/RenderObjectState.h"
#include <cstddef>
class CRenderObject : public CGameObject {
public:
CRenderObject(ResourceMgr& resources, JobNames& names);
@ -33,11 +35,12 @@ public:
unsigned char finishFrame, int timed, std::uint32_t duration, int loop
);
RenderObjectState render;
/* 0010 */ RenderObjectState render;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(CRenderObject) == 0x138);
static_assert(offsetof(CRenderObject, render) == 0x0010);
#endif
#endif

View file

@ -1,6 +1,7 @@
#ifndef RAGNAROK_SOURCE_CONTENTS_CASHEMOTIONMGR_H
#define RAGNAROK_SOURCE_CONTENTS_CASHEMOTIONMGR_H
#include <cstddef>
#include <cstdint>
#include <string>
#include <unordered_map>
@ -8,7 +9,7 @@
struct CashEmotionData {
int id;
int subId;
std::string name;
/* 0008 */ std::string name;
};
class CCashEmotionMgr {
@ -43,6 +44,7 @@ protected:
extern CCashEmotionMgr* g_cashEmotionMgr;
#if defined(_WIN32) && !defined(_WIN64)
static_assert(offsetof(CashEmotionData, name) == 0x08);
static_assert(sizeof(CCashEmotionMgr) == 472);
#endif

View file

@ -4,15 +4,18 @@
#include "Contents/Effects/RagEffectState.h"
#include "Contents/Actors/RenderObject.h"
#include <cstddef>
struct AttachedEffect : CRenderObject {
AttachedEffect(ResourceMgr& resources, JobNames& names);
~AttachedEffect() override;
RagEffectState state;
/* 0138 */ RagEffectState state;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(AttachedEffect) == 0x11CA8);
static_assert(offsetof(AttachedEffect, state) == 0x138);
#endif
#endif

View file

@ -1,16 +1,17 @@
#ifndef RAGNAROK_SOURCE_CONTENTS_EFFECTS_EFFECT_H
#define RAGNAROK_SOURCE_CONTENTS_EFFECTS_EFFECT_H
#include <cstddef>
#include <cstdint>
#include <list>
#include <string>
#include <vector>
struct EffectEvent {
int kind;
int frame;
int argument;
std::string text;
/* 0000 */ int kind;
/* 0004 */ int frame;
/* 0008 */ int argument;
/* 000C */ std::string text;
};
class CEffect {
@ -30,18 +31,18 @@ public:
/* 002C */ int unknown_002C;
/* 0030 */ int unknown_0030;
/* 0034 */ unsigned char outsideRange;
unsigned char unknown_0035[3];
/* 0035 */ unsigned char unknown_0035[3];
/* 0038 */ int range;
unsigned char unknown_003C[116];
/* 003C */ unsigned char unknown_003C[116];
/* 00B0 */ int unknown_00B0;
/* 00B4 */ std::vector<EffectEvent> events;
/* 00C0 */ unsigned char retained;
unsigned char unknown_00C1;
/* 00C1 */ unsigned char unknown_00C1;
/* 00C2 */ unsigned char forceRender;
unsigned char unknown_00C3;
/* 00C3 */ unsigned char unknown_00C3;
/* 00C4 */ int unknown_00C4;
/* 00C8 */ unsigned char unknown_00C8;
unsigned char unknown_00C9[3];
/* 00C9 */ unsigned char unknown_00C9[3];
};
struct EffectRetirement {
@ -51,7 +52,10 @@ struct EffectRetirement {
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(EffectEvent) == 36);
static_assert(offsetof(EffectEvent, text) == 0xC);
static_assert(sizeof(CEffect) == 204);
static_assert(offsetof(CEffect, events) == 0xB4);
static_assert(offsetof(CEffect, unknown_00C8) == 0xC8);
#endif
#endif

View file

@ -4,6 +4,8 @@
#include "Contents/Effects/EffectAttachments.h"
#include "Contents/Actors/RenderObject.h"
#include <cstddef>
struct EffectActorState {
EffectActorState();
~EffectActorState();
@ -21,12 +23,13 @@ struct EffectActor : CRenderObject {
EffectActor(ResourceMgr& resources, JobNames& names);
bool EffectVisible() const;
EffectActorState state;
/* 0138 */ EffectActorState state;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(EffectActorState) == 28);
static_assert(sizeof(EffectActor) == 0x158);
static_assert(offsetof(EffectActor, state) == 0x138);
#endif
#endif

View file

@ -13,7 +13,7 @@ struct RagEffectState;
struct EffectParticle : CRenderObject {
EffectParticle(ResourceMgr& resources, JobNames& names);
EffectPrimitiveState state;
/* 0138 */ EffectPrimitiveState state;
};
EffectParticle* CreateEffectParticle(
@ -23,6 +23,7 @@ EffectParticle* CreateEffectParticle(
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(EffectParticle) == 0xFA18);
static_assert(offsetof(EffectParticle, state) == 0x138);
#endif
#endif

View file

@ -3,6 +3,7 @@
#include "Render/Primitives/RenderPrimitive.h"
#include <cstddef>
#include <cstdint>
#include <vector>
@ -11,23 +12,23 @@ struct RagEffectState;
class CTexture;
struct EffectVector3 {
float x;
float y;
float z;
/* 0000 */ float x;
/* 0004 */ float y;
/* 0008 */ float z;
};
struct EffectPrimitiveRecord {
EffectVector3 position;
EffectVector3 corners[4];
std::uint32_t unknown_003C;
float scale;
float angle;
float matrix[12];
std::int32_t red;
std::int32_t green;
std::int32_t blue;
float alpha;
std::uint32_t color;
/* 0000 */ EffectVector3 position;
/* 000C */ EffectVector3 corners[4];
/* 003C */ std::uint32_t unknown_003C;
/* 0040 */ float scale;
/* 0044 */ float angle;
/* 0048 */ float matrix[12];
/* 0078 */ std::int32_t red;
/* 007C */ std::int32_t green;
/* 0080 */ std::int32_t blue;
/* 0084 */ float alpha;
/* 0088 */ std::uint32_t color;
};
struct EffectPrimitiveState {
@ -147,6 +148,10 @@ struct EffectPrimitiveState {
static_assert(sizeof(EffectVector3) == 12);
static_assert(sizeof(EffectPrimitiveRecord) == 140);
#if defined(_WIN32) && !defined(_WIN64)
static_assert(offsetof(EffectVector3, z) == 0x8);
static_assert(offsetof(EffectPrimitiveRecord, corners) == 0xC);
static_assert(offsetof(EffectPrimitiveRecord, matrix) == 0x48);
static_assert(offsetof(EffectPrimitiveRecord, color) == 0x88);
static_assert(sizeof(EffectPrimitiveState) == 0xF8E0);
#endif

View file

@ -21,10 +21,13 @@ public:
protected:
struct Recent {
std::uint32_t guildId;
std::uint32_t version;
std::uint32_t tick;
/* 0000 */ std::uint32_t guildId;
/* 0004 */ std::uint32_t version;
/* 0008 */ std::uint32_t tick;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(Recent) == 0xC);
#endif
/* 0004 */ std::deque<std::pair<std::uint32_t, std::uint32_t>> m_pending;
/* 0018 */ std::deque<Recent> m_recent;
};

View file

@ -4,6 +4,7 @@
#include "Contents/Ground/GroundSpatial.h"
#include "Contents/Ground/GroundWaterState.h"
#include <cstddef>
#include <array>
class CGndRes;
@ -11,10 +12,10 @@ class TextureCache;
struct GroundRenderContext;
struct GroundLightmap {
unsigned char color[4];
CTexture* texture;
float uv[4][2];
std::uint32_t unknown_0028[4];
/* 0000 */ unsigned char color[4];
/* 0004 */ CTexture* texture;
/* 0008 */ float uv[4][2];
/* 0028 */ std::uint32_t unknown_0028[4];
};
class GroundGeometry {
@ -75,6 +76,9 @@ private:
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(GroundLightmap) == 56);
static_assert(offsetof(GroundLightmap, texture) == 0x04);
static_assert(offsetof(GroundLightmap, uv) == 0x08);
static_assert(offsetof(GroundLightmap, unknown_0028) == 0x28);
#endif
#endif

View file

@ -1,6 +1,7 @@
#ifndef RAGNAROK_SOURCE_CONTENTS_GROUND_GROUNDSPATIAL_H
#define RAGNAROK_SOURCE_CONTENTS_GROUND_GROUNDSPATIAL_H
#include <cstddef>
#include <cstdint>
#include <vector>
@ -10,14 +11,14 @@ struct GroundLightmap;
struct GroundQuad {
GroundQuad();
float vertices[4][8];
std::uint32_t unknown_0080;
CTexture* texture;
CTexture* lightmapTexture;
GroundLightmap* lightmap;
std::uint32_t color;
std::uint32_t selected;
std::uint32_t unknown_0098;
/* 0000 */ float vertices[4][8];
/* 0080 */ std::uint32_t unknown_0080;
/* 0084 */ CTexture* texture;
/* 0088 */ CTexture* lightmapTexture;
/* 008C */ GroundLightmap* lightmap;
/* 0090 */ std::uint32_t color;
/* 0094 */ std::uint32_t selected;
/* 0098 */ std::uint32_t unknown_0098;
};
struct GroundCell {
@ -45,6 +46,9 @@ struct GroundSpatial {
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(GroundQuad) == 156);
static_assert(offsetof(GroundQuad, texture) == 0x84);
static_assert(offsetof(GroundQuad, lightmap) == 0x8C);
static_assert(offsetof(GroundQuad, selected) == 0x94);
static_assert(sizeof(GroundCell) == 84);
#endif

View file

@ -1,6 +1,7 @@
#ifndef RAGNAROK_SOURCE_CONTENTS_GROUND_GROUNDWATERSTATE_H
#define RAGNAROK_SOURCE_CONTENTS_GROUND_GROUNDWATERSTATE_H
#include <cstddef>
#include <cstdint>
#include <vector>
@ -9,15 +10,15 @@ class CTexture;
class TextureCache;
struct GroundWaterSurface {
float level;
int type;
float height;
float speed;
float pitch;
int animation;
int frame;
float phase;
CTexture* texture;
/* 0000 */ float level;
/* 0004 */ int type;
/* 0008 */ float height;
/* 000C */ float speed;
/* 0010 */ float pitch;
/* 0014 */ int animation;
/* 0018 */ int frame;
/* 001C */ float phase;
/* 0020 */ CTexture* texture;
};
struct GroundWaterState {
@ -42,6 +43,7 @@ struct GroundWaterState {
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(GroundWaterSurface) == 36);
static_assert(offsetof(GroundWaterSurface, texture) == 0x20);
#endif
#endif

View file

@ -1,11 +1,12 @@
#ifndef RAGNAROK_SOURCE_CONTENTS_GROUND_TERRAINHEIGHT_H
#define RAGNAROK_SOURCE_CONTENTS_GROUND_TERRAINHEIGHT_H
#include <cstddef>
#include <cstdint>
struct TerrainHeightCell {
float heights[4];
std::uint32_t type;
/* 0000 */ float heights[4];
/* 0010 */ std::uint32_t type;
};
struct TerrainHeight {
@ -29,5 +30,8 @@ struct TerrainHeight {
};
static_assert(sizeof(TerrainHeightCell) == 20);
#if defined(_WIN32) && !defined(_WIN64)
static_assert(offsetof(TerrainHeightCell, type) == 0x10);
#endif
#endif

View file

@ -1,6 +1,7 @@
#ifndef RAGNAROK_SOURCE_CONTENTS_HOTKEYS_EMOTIONHOTKEYS_H
#define RAGNAROK_SOURCE_CONTENTS_HOTKEYS_EMOTIONHOTKEYS_H
#include <cstddef>
#include <cstdint>
#include <json/value.h>
#include <string>
@ -9,8 +10,8 @@
class CRenderSystemBase;
struct EmotionHotkeys {
std::vector<std::string> current;
std::vector<std::string> saved;
/* 0FF8 */ std::vector<std::string> current;
/* 1004 */ std::vector<std::string> saved;
void Load(Json::Value& data);
bool HasChanges() const;
@ -21,6 +22,7 @@ struct EmotionHotkeys {
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(EmotionHotkeys) == 24);
static_assert(offsetof(EmotionHotkeys, saved) == 12);
#endif
#endif

View file

@ -1,15 +1,16 @@
#ifndef RAGNAROK_SOURCE_CONTENTS_HOTKEYS_HOTKEYINFO_H
#define RAGNAROK_SOURCE_CONTENTS_HOTKEYS_HOTKEYINFO_H
#include <cstddef>
#include <string>
class LuaScript;
struct HotkeyInfo {
int key1;
int key2;
std::string text;
std::string description;
/* 0000 */ int key1;
/* 0004 */ int key2;
/* 0008 */ std::string text;
/* 0020 */ std::string description;
HotkeyInfo();
~HotkeyInfo();
};
@ -22,6 +23,8 @@ bool SkillUsesPercentSp(int id);
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(HotkeyInfo) == 56);
static_assert(offsetof(HotkeyInfo, text) == 8);
static_assert(offsetof(HotkeyInfo, description) == 0x0020);
#endif
#endif

View file

@ -23,12 +23,15 @@ public:
protected:
friend class CAccountLinkedUserDataMgr;
struct Hotkey {
int tab;
int index;
int key1;
int key2;
std::string description;
/* 0000 */ int tab;
/* 0004 */ int index;
/* 0008 */ int key1;
/* 000C */ int key2;
/* 0010 */ std::string description;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(Hotkey) == 40);
#endif
/* 0004 */ bool m_enabled;
/* 0005 */ bool m_loaded;
/* 0008 */ std::uint32_t m_changes;

View file

@ -13,7 +13,7 @@ public:
void Clear();
private:
std::map<int, std::int64_t> m_values;
/* 0004 */ std::map<int, std::int64_t> m_values;
};
#if defined(_WIN32) && !defined(_WIN64)