-
Notifications
You must be signed in to change notification settings - Fork 4
/
sdk.h
161 lines (145 loc) · 2.76 KB
/
sdk.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
typedef struct {
float x, y, z;
} Vector;
enum {
IN_ATTACK = (1 << 0),
IN_JUMP = (1 << 1),
IN_DUCK = (1 << 2),
IN_FORWARD = (1 << 3),
IN_BACK = (1 << 4),
IN_USE = (1 << 5),
IN_CANCEL = (1 << 6),
IN_LEFT = (1 << 7),
IN_RIGHT = (1 << 8),
IN_MOVELEFT = (1 << 9),
IN_MOVERIGHT = (1 << 10),
IN_ATTACK2 = (1 << 11),
IN_RUN = (1 << 12),
IN_RELOAD = (1 << 13),
IN_ALT1 = (1 << 14),
IN_SCORE = (1 << 15)
};
typedef struct {
PAD(0x3)
Vector viewangles;
float forwardmove;
float sidemove;
float upmove;
PAD(0x1)
unsigned short buttons;
PAD(0x12)
} UserCmd;
typedef struct UserMsg UserMsg;
struct UserMsg {
int msg;
int size;
char name[0x10];
UserMsg *next;
int (*fn)(char *name, int size, void *buf);
};
enum {
MOVETYPE_NONE,
MOVETYPE_WALK = 3,
MOVETYPE_STEP,
MOVETYPE_FLY,
MOVETYPE_TOSS,
MOVETYPE_PUSH,
MOVETYPE_NOCLIP,
MOVETYPE_FLYMISSILE,
MOVETYPE_BOUNCE,
MOVETYPE_BOUNCEMISSILE,
MOVETYPE_FOLLOW,
MOVETYPE_PUSHSTEP
};
typedef struct {
PAD(12)
int msgnum;
PAD(72)
int movetype;
PAD(248)
} EntityState;
typedef struct {
int i;
int player;
PAD(2 * sizeof(EntityState))
EntityState curstate;
PAD(1860)
Vector origin;
} Entity;
typedef struct {
PAD(0x18)
void (*localplayerviewheight)(Vector *);
PAD(0x40)
} EventAPI;
typedef struct {
PAD(0x8C)
void (*setviewangles)(Vector *angles);
int (*getmaxclients)(void);
PAD(0xC)
void (*con_printf)(char *fmt, ...);
PAD(0x28)
Entity *(*getlocalplayer)(void);
PAD(0x4)
Entity *(*getentitybyindex)(int i);
PAD(0x78)
EventAPI *eventapi;
} Engine;
typedef float Matrix3x4[3][4];
typedef Matrix3x4 BoneMatrix[128];
typedef struct {
PAD(0x18)
Entity *(*getcurrententity)(void);
PAD(36)
BoneMatrix *(*getbonetransform)(void);
} EngineStudio;
typedef struct {
PAD(0x4C)
void (*rendermodel)(void *this);
void (*renderfinal)(void *this);
} StudioModelRenderer;
typedef struct {
Vector vieworigin;
Vector viewangles;
Vector forward;
Vector right;
Vector up;
PAD(0x64)
Vector punchangle;
} RefParams;
typedef struct {
PAD(0xC)
int (*hudredraw)(float time, int intermission);
PAD(0x28)
void (*createmove)(float frametime, UserCmd *cmd, int active);
int (*is3rdperson)(void);
void (*cameraoffset)(Vector *offset);
PAD(0x8)
void (*calcrefdef)(RefParams *params);
} Client;
enum {
FL_FLY = (1 << 0),
FL_SWIM = (1 << 1),
FL_CONVEYOR = (1 << 2),
FL_CLIENT = (1 << 3),
FL_INWATER = (1 << 4),
FL_MONSTER = (1 << 5),
FL_GODMODE = (1 << 6),
FL_NOTARGET = (1 << 7),
FL_SKIPLOCALHOST = (1 << 8),
FL_ONGROUND = (1 << 9),
FL_PARTIALGROUND = (1 << 10),
FL_WATERJUMP = (1 << 11),
FL_FROZEN = (1 << 12),
FL_FAKECLIENT = (1 << 13),
FL_DUCKING = (1 << 14),
FL_FLOAT = (1 << 15),
FL_GRAPHED = (1 << 16)
};
typedef struct {
PAD(56)
Vector origin;
PAD(24)
Vector velocity;
PAD(80)
int flags;
} PlayerMove;