|
darope@0
|
1 |
// vi: set ts=4 sw=4 : |
|
darope@0
|
2 |
// vim: set tw=75 : |
|
darope@0
|
3 |
|
|
darope@0
|
4 |
// engine_api.cpp - implementation of Half-Life engine functions |
|
darope@0
|
5 |
|
|
darope@0
|
6 |
/* |
|
darope@0
|
7 |
* Copyright (c) 2001-2003 Will Day <[email protected]> |
|
darope@0
|
8 |
* |
|
darope@0
|
9 |
* This file is part of Metamod. |
|
darope@0
|
10 |
* |
|
darope@0
|
11 |
* Metamod is free software; you can redistribute it and/or modify it |
|
darope@0
|
12 |
* under the terms of the GNU General Public License as published by the |
|
darope@0
|
13 |
* Free Software Foundation; either version 2 of the License, or (at |
|
darope@0
|
14 |
* your option) any later version. |
|
darope@0
|
15 |
* |
|
darope@0
|
16 |
* Metamod is distributed in the hope that it will be useful, but |
|
darope@0
|
17 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|
darope@0
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
darope@0
|
19 |
* General Public License for more details. |
|
darope@0
|
20 |
* |
|
darope@0
|
21 |
* You should have received a copy of the GNU General Public License |
|
darope@0
|
22 |
* along with Metamod; if not, write to the Free Software Foundation, |
|
darope@0
|
23 |
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
darope@0
|
24 |
* |
|
darope@0
|
25 |
* In addition, as a special exception, the author gives permission to |
|
darope@0
|
26 |
* link the code of this program with the Half-Life Game Engine ("HL |
|
darope@0
|
27 |
* Engine") and Modified Game Libraries ("MODs") developed by Valve, |
|
darope@0
|
28 |
* L.L.C ("Valve"). You must obey the GNU General Public License in all |
|
darope@0
|
29 |
* respects for all of the code used other than the HL Engine and MODs |
|
darope@0
|
30 |
* from Valve. If you modify this file, you may extend this exception |
|
darope@0
|
31 |
* to your version of the file, but you are not obligated to do so. If |
|
darope@0
|
32 |
* you do not wish to do so, delete this exception statement from your |
|
darope@0
|
33 |
* version. |
|
darope@0
|
34 |
* |
|
darope@0
|
35 |
*/ |
|
darope@0
|
36 |
|
|
darope@0
|
37 |
#include <stdio.h> // vsnprintf, etc |
|
darope@0
|
38 |
#include <stdarg.h> // va_start, etc |
|
darope@0
|
39 |
|
|
darope@0
|
40 |
#include <extdll.h> // always |
|
darope@0
|
41 |
|
|
darope@0
|
42 |
#include "engine_api.h" // me |
|
darope@0
|
43 |
#include "metamod.h" // SETUP_API_CALLS, etc |
|
darope@0
|
44 |
#include "thread_logparse.h" // LogQueue, etc |
|
darope@0
|
45 |
#include "api_info.h" // dllapi_info, etc |
|
darope@0
|
46 |
#include "log_meta.h" // META_ERROR, etc |
|
darope@0
|
47 |
#include "osdep.h" // win32 vsnprintf, etc |
|
darope@0
|
48 |
|
|
darope@0
|
49 |
|
|
darope@0
|
50 |
// Engine routines, functions returning "void". |
|
darope@0
|
51 |
#define META_ENGINE_HANDLE_void(FN_TYPE, pfnName, pfn_args) \ |
|
darope@0
|
52 |
SETUP_API_CALLS_void(FN_TYPE, pfnName, engine_info); \ |
|
darope@0
|
53 |
CALL_PLUGIN_API_void(P_PRE, pfnName, pfn_args, engine_table); \ |
|
darope@0
|
54 |
CALL_ENGINE_API_void(pfnName, pfn_args); \ |
|
darope@0
|
55 |
CALL_PLUGIN_API_void(P_POST, pfnName, pfn_args, engine_post_table); |
|
darope@0
|
56 |
|
|
darope@0
|
57 |
// Engine routines, functions returning an actual value. |
|
darope@0
|
58 |
#define META_ENGINE_HANDLE(ret_t, ret_init, FN_TYPE, pfnName, pfn_args) \ |
|
darope@0
|
59 |
SETUP_API_CALLS(ret_t, ret_init, FN_TYPE, pfnName, engine_info); \ |
|
darope@0
|
60 |
CALL_PLUGIN_API(P_PRE, ret_init, pfnName, pfn_args, MRES_SUPERCEDE, engine_table); \ |
|
darope@0
|
61 |
CALL_ENGINE_API(pfnName, pfn_args); \ |
|
darope@0
|
62 |
CALL_PLUGIN_API(P_POST, ret_init, pfnName, pfn_args, MRES_OVERRIDE, engine_post_table); |
|
darope@0
|
63 |
|
|
darope@0
|
64 |
|
|
darope@0
|
65 |
// Engine routines, printf-style functions returning "void". |
|
darope@0
|
66 |
#define META_ENGINE_HANDLE_void_varargs(FN_TYPE, pfnName, pfn_arg, fmt_arg) \ |
|
darope@0
|
67 |
SETUP_API_CALLS_void(FN_TYPE, pfnName, engine_info); \ |
|
darope@0
|
68 |
char buf[MAX_STRBUF_LEN]; \ |
|
darope@0
|
69 |
va_list ap; \ |
|
darope@0
|
70 |
META_DEBUG(loglevel, ("In %s: fmt=%s", pfn_string, fmt_arg)); \ |
|
darope@0
|
71 |
va_start(ap, fmt_arg); \ |
|
darope@0
|
72 |
vsnprintf(buf, sizeof(buf), fmt_arg, ap); \ |
|
darope@0
|
73 |
va_end(ap); \ |
|
darope@0
|
74 |
CALL_PLUGIN_API_void(P_PRE, pfnName, (pfn_arg, "%s", buf), engine_table); \ |
|
darope@0
|
75 |
CALL_ENGINE_API_void(pfnName, (pfn_arg, "%s", buf)); \ |
|
darope@0
|
76 |
CALL_PLUGIN_API_void(P_POST, pfnName, (pfn_arg, "%s", buf), engine_post_table); |
|
darope@0
|
77 |
|
|
darope@0
|
78 |
// Engine routines, printf-style functions returning an actual value. |
|
darope@0
|
79 |
#define META_ENGINE_HANDLE_varargs(ret_t, ret_init, FN_TYPE, pfnName, pfn_arg, fmt_arg) \ |
|
darope@0
|
80 |
SETUP_API_CALLS(ret_t, ret_init, FN_TYPE, pfnName, engine_info); \ |
|
darope@0
|
81 |
char buf[MAX_STRBUF_LEN]; \ |
|
darope@0
|
82 |
va_list ap; \ |
|
darope@0
|
83 |
META_DEBUG(loglevel, ("In %s: fmt=%s", pfn_string, fmt_arg)); \ |
|
darope@0
|
84 |
va_start(ap, fmt_arg); \ |
|
darope@0
|
85 |
vsnprintf(buf, sizeof(buf), fmt_arg, ap); \ |
|
darope@0
|
86 |
va_end(ap); \ |
|
darope@0
|
87 |
CALL_PLUGIN_API(P_PRE, ret_init, pfnName, (pfn_arg, "%s", buf), MRES_SUPERCEDE, engine_table); \ |
|
darope@0
|
88 |
CALL_ENGINE_API(pfnName, (pfn_arg, "%s", buf)); \ |
|
darope@0
|
89 |
CALL_PLUGIN_API(P_POST, ret_init, pfnName, (pfn_arg, "%s", buf), MRES_OVERRIDE, engine_post_table); |
|
darope@0
|
90 |
|
|
darope@0
|
91 |
|
|
ds@265
|
92 |
int mm_PrecacheModel(const char *s) { |
|
darope@0
|
93 |
META_ENGINE_HANDLE(int, 0, FN_PRECACHEMODEL, pfnPrecacheModel, (s)); |
|
darope@0
|
94 |
RETURN_API() |
|
darope@0
|
95 |
} |
|
ds@265
|
96 |
int mm_PrecacheSound(const char *s) { |
|
darope@0
|
97 |
META_ENGINE_HANDLE(int, 0, FN_PRECACHESOUND, pfnPrecacheSound, (s)); |
|
darope@0
|
98 |
RETURN_API() |
|
darope@0
|
99 |
} |
|
darope@0
|
100 |
void mm_SetModel(edict_t *e, const char *m) { |
|
darope@0
|
101 |
META_ENGINE_HANDLE_void(FN_SETMODEL, pfnSetModel, (e, m)); |
|
darope@0
|
102 |
RETURN_API_void() |
|
darope@0
|
103 |
} |
|
darope@0
|
104 |
int mm_ModelIndex(const char *m) { |
|
darope@0
|
105 |
META_ENGINE_HANDLE(int, 0, FN_MODELINDEX, pfnModelIndex, (m)); |
|
darope@0
|
106 |
RETURN_API() |
|
darope@0
|
107 |
} |
|
darope@0
|
108 |
int mm_ModelFrames(int modelIndex) { |
|
darope@0
|
109 |
META_ENGINE_HANDLE(int, 0, FN_MODELFRAMES, pfnModelFrames, (modelIndex)); |
|
darope@0
|
110 |
RETURN_API() |
|
darope@0
|
111 |
} |
|
darope@0
|
112 |
|
|
darope@0
|
113 |
void mm_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax) { |
|
darope@0
|
114 |
META_ENGINE_HANDLE_void(FN_SETSIZE, pfnSetSize, (e, rgflMin, rgflMax)); |
|
darope@0
|
115 |
RETURN_API_void() |
|
darope@0
|
116 |
} |
|
ds@265
|
117 |
void mm_ChangeLevel(const char *s1, const char *s2) { |
|
darope@0
|
118 |
META_ENGINE_HANDLE_void(FN_CHANGELEVEL, pfnChangeLevel, (s1, s2)); |
|
darope@0
|
119 |
RETURN_API_void() |
|
darope@0
|
120 |
} |
|
darope@0
|
121 |
void mm_GetSpawnParms(edict_t *ent) { |
|
darope@0
|
122 |
META_ENGINE_HANDLE_void(FN_GETSPAWNPARMS, pfnGetSpawnParms, (ent)); |
|
darope@0
|
123 |
RETURN_API_void() |
|
darope@0
|
124 |
} |
|
darope@0
|
125 |
void mm_SaveSpawnParms(edict_t *ent) { |
|
darope@0
|
126 |
META_ENGINE_HANDLE_void(FN_SAVESPAWNPARMS, pfnSaveSpawnParms, (ent)); |
|
darope@0
|
127 |
RETURN_API_void() |
|
darope@0
|
128 |
} |
|
darope@0
|
129 |
|
|
darope@0
|
130 |
float mm_VecToYaw(const float *rgflVector) { |
|
darope@0
|
131 |
META_ENGINE_HANDLE(float, 0.0, FN_VECTOYAW, pfnVecToYaw, (rgflVector)); |
|
darope@0
|
132 |
RETURN_API() |
|
darope@0
|
133 |
} |
|
darope@0
|
134 |
void mm_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut) { |
|
darope@0
|
135 |
META_ENGINE_HANDLE_void(FN_VECTOANGLES, pfnVecToAngles, (rgflVectorIn, rgflVectorOut)); |
|
darope@0
|
136 |
RETURN_API_void() |
|
darope@0
|
137 |
} |
|
darope@0
|
138 |
void mm_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType) { |
|
darope@0
|
139 |
META_ENGINE_HANDLE_void(FN_MOVETOORIGIN, pfnMoveToOrigin, (ent, pflGoal, dist, iMoveType)); |
|
darope@0
|
140 |
RETURN_API_void() |
|
darope@0
|
141 |
} |
|
darope@0
|
142 |
void mm_ChangeYaw(edict_t *ent) { |
|
darope@0
|
143 |
META_ENGINE_HANDLE_void(FN_CHANGEYAW, pfnChangeYaw, (ent)); |
|
darope@0
|
144 |
RETURN_API_void() |
|
darope@0
|
145 |
} |
|
darope@0
|
146 |
void mm_ChangePitch(edict_t *ent) { |
|
darope@0
|
147 |
META_ENGINE_HANDLE_void(FN_CHANGEPITCH, pfnChangePitch, (ent)); |
|
darope@0
|
148 |
RETURN_API_void() |
|
darope@0
|
149 |
} |
|
darope@0
|
150 |
|
|
darope@0
|
151 |
edict_t *mm_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue) { |
|
darope@0
|
152 |
META_ENGINE_HANDLE(edict_t *, NULL, FN_FINDENTITYBYSTRING, pfnFindEntityByString, (pEdictStartSearchAfter, pszField, pszValue)); |
|
darope@0
|
153 |
RETURN_API() |
|
darope@0
|
154 |
} |
|
darope@0
|
155 |
int mm_GetEntityIllum(edict_t *pEnt) { |
|
darope@0
|
156 |
META_ENGINE_HANDLE(int, 0, FN_GETENTITYILLUM, pfnGetEntityIllum, (pEnt)); |
|
darope@0
|
157 |
RETURN_API() |
|
darope@0
|
158 |
} |
|
darope@0
|
159 |
edict_t *mm_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad) { |
|
darope@0
|
160 |
META_ENGINE_HANDLE(edict_t *, NULL, FN_FINDENTITYINSPHERE, pfnFindEntityInSphere, (pEdictStartSearchAfter, org, rad)); |
|
darope@0
|
161 |
RETURN_API() |
|
darope@0
|
162 |
} |
|
darope@0
|
163 |
edict_t *mm_FindClientInPVS(edict_t *pEdict) { |
|
darope@0
|
164 |
META_ENGINE_HANDLE(edict_t *, NULL, FN_FINDCLIENTINPVS, pfnFindClientInPVS, (pEdict)); |
|
darope@0
|
165 |
RETURN_API() |
|
darope@0
|
166 |
} |
|
darope@0
|
167 |
edict_t *mm_EntitiesInPVS(edict_t *pplayer) { |
|
darope@0
|
168 |
META_ENGINE_HANDLE(edict_t *, NULL, FN_ENTITIESINPVS, pfnEntitiesInPVS, (pplayer)); |
|
darope@0
|
169 |
RETURN_API() |
|
darope@0
|
170 |
} |
|
darope@0
|
171 |
|
|
darope@0
|
172 |
void mm_MakeVectors(const float *rgflVector) { |
|
darope@0
|
173 |
META_ENGINE_HANDLE_void(FN_MAKEVECTORS, pfnMakeVectors, (rgflVector)); |
|
darope@0
|
174 |
RETURN_API_void() |
|
darope@0
|
175 |
} |
|
darope@0
|
176 |
void mm_AngleVectors(const float *rgflVector, float *forward, float *right, float *up) { |
|
darope@0
|
177 |
META_ENGINE_HANDLE_void(FN_ANGLEVECTORS, pfnAngleVectors, (rgflVector, forward, right, up)); |
|
darope@0
|
178 |
RETURN_API_void() |
|
darope@0
|
179 |
} |
|
darope@0
|
180 |
|
|
darope@0
|
181 |
edict_t *mm_CreateEntity(void) { |
|
darope@0
|
182 |
META_ENGINE_HANDLE(edict_t *, NULL, FN_CREATEENTITY, pfnCreateEntity, ()); |
|
darope@0
|
183 |
RETURN_API() |
|
darope@0
|
184 |
} |
|
darope@0
|
185 |
void mm_RemoveEntity(edict_t *e) { |
|
darope@0
|
186 |
META_ENGINE_HANDLE_void(FN_REMOVEENTITY, pfnRemoveEntity, (e)); |
|
darope@0
|
187 |
RETURN_API_void() |
|
darope@0
|
188 |
} |
|
darope@0
|
189 |
edict_t *mm_CreateNamedEntity(int className) { |
|
darope@0
|
190 |
META_ENGINE_HANDLE(edict_t *, NULL, FN_CREATENAMEDENTITY, pfnCreateNamedEntity, (className)); |
|
darope@0
|
191 |
RETURN_API() |
|
darope@0
|
192 |
} |
|
darope@0
|
193 |
|
|
darope@0
|
194 |
void mm_MakeStatic(edict_t *ent) { |
|
darope@0
|
195 |
META_ENGINE_HANDLE_void(FN_MAKESTATIC, pfnMakeStatic, (ent)); |
|
darope@0
|
196 |
RETURN_API_void() |
|
darope@0
|
197 |
} |
|
darope@0
|
198 |
int mm_EntIsOnFloor(edict_t *e) { |
|
darope@0
|
199 |
META_ENGINE_HANDLE(int, 0, FN_ENTISONFLOOR, pfnEntIsOnFloor, (e)); |
|
darope@0
|
200 |
RETURN_API() |
|
darope@0
|
201 |
} |
|
darope@0
|
202 |
int mm_DropToFloor(edict_t *e) { |
|
darope@0
|
203 |
META_ENGINE_HANDLE(int, 0, FN_DROPTOFLOOR, pfnDropToFloor, (e)); |
|
darope@0
|
204 |
RETURN_API() |
|
darope@0
|
205 |
} |
|
darope@0
|
206 |
|
|
darope@0
|
207 |
int mm_WalkMove(edict_t *ent, float yaw, float dist, int iMode) { |
|
darope@0
|
208 |
META_ENGINE_HANDLE(int, 0, FN_WALKMOVE, pfnWalkMove, (ent, yaw, dist, iMode)); |
|
darope@0
|
209 |
RETURN_API() |
|
darope@0
|
210 |
} |
|
darope@0
|
211 |
void mm_SetOrigin(edict_t *e, const float *rgflOrigin) { |
|
darope@0
|
212 |
META_ENGINE_HANDLE_void(FN_SETORIGIN, pfnSetOrigin, (e, rgflOrigin)); |
|
darope@0
|
213 |
RETURN_API_void() |
|
darope@0
|
214 |
} |
|
darope@0
|
215 |
|
|
darope@0
|
216 |
void mm_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch) { |
|
darope@0
|
217 |
META_ENGINE_HANDLE_void(FN_EMITSOUND, pfnEmitSound, (entity, channel, sample, volume, attenuation, fFlags, pitch)); |
|
darope@0
|
218 |
RETURN_API_void() |
|
darope@0
|
219 |
} |
|
darope@0
|
220 |
void mm_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch) { |
|
darope@0
|
221 |
META_ENGINE_HANDLE_void(FN_EMITAMBIENTSOUND, pfnEmitAmbientSound, (entity, pos, samp, vol, attenuation, fFlags, pitch)); |
|
darope@0
|
222 |
RETURN_API_void() |
|
darope@0
|
223 |
} |
|
darope@0
|
224 |
|
|
darope@0
|
225 |
void mm_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) { |
|
darope@0
|
226 |
META_ENGINE_HANDLE_void(FN_TRACELINE, pfnTraceLine, (v1, v2, fNoMonsters, pentToSkip, ptr)); |
|
darope@0
|
227 |
RETURN_API_void() |
|
darope@0
|
228 |
} |
|
darope@0
|
229 |
void mm_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr) { |
|
darope@0
|
230 |
META_ENGINE_HANDLE_void(FN_TRACETOSS, pfnTraceToss, (pent, pentToIgnore, ptr)); |
|
darope@0
|
231 |
RETURN_API_void() |
|
darope@0
|
232 |
} |
|
darope@0
|
233 |
int mm_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) { |
|
darope@0
|
234 |
META_ENGINE_HANDLE(int, 0, FN_TRACEMONSTERHULL, pfnTraceMonsterHull, (pEdict, v1, v2, fNoMonsters, pentToSkip, ptr)); |
|
darope@0
|
235 |
RETURN_API() |
|
darope@0
|
236 |
} |
|
darope@0
|
237 |
void mm_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr) { |
|
darope@0
|
238 |
META_ENGINE_HANDLE_void(FN_TRACEHULL, pfnTraceHull, (v1, v2, fNoMonsters, hullNumber, pentToSkip, ptr)); |
|
darope@0
|
239 |
RETURN_API_void() |
|
darope@0
|
240 |
} |
|
darope@0
|
241 |
void mm_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr) { |
|
darope@0
|
242 |
META_ENGINE_HANDLE_void(FN_TRACEMODEL, pfnTraceModel, (v1, v2, hullNumber, pent, ptr)); |
|
darope@0
|
243 |
RETURN_API_void() |
|
darope@0
|
244 |
} |
|
darope@0
|
245 |
const char *mm_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ) { |
|
darope@0
|
246 |
META_ENGINE_HANDLE(const char *, NULL, FN_TRACETEXTURE, pfnTraceTexture, (pTextureEntity, v1, v2)); |
|
darope@0
|
247 |
RETURN_API() |
|
darope@0
|
248 |
} |
|
darope@0
|
249 |
void mm_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr) { |
|
darope@0
|
250 |
META_ENGINE_HANDLE_void(FN_TRACESPHERE, pfnTraceSphere, (v1, v2, fNoMonsters, radius, pentToSkip, ptr)); |
|
darope@0
|
251 |
RETURN_API_void() |
|
darope@0
|
252 |
} |
|
darope@0
|
253 |
void mm_GetAimVector(edict_t *ent, float speed, float *rgflReturn) { |
|
darope@0
|
254 |
META_ENGINE_HANDLE_void(FN_GETAIMVECTOR, pfnGetAimVector, (ent, speed, rgflReturn)); |
|
darope@0
|
255 |
RETURN_API_void() |
|
darope@0
|
256 |
} |
|
darope@0
|
257 |
|
|
ds@265
|
258 |
void mm_ServerCommand(const char *str) { |
|
darope@0
|
259 |
META_ENGINE_HANDLE_void(FN_SERVERCOMMAND, pfnServerCommand, (str)); |
|
darope@0
|
260 |
RETURN_API_void() |
|
darope@0
|
261 |
} |
|
darope@0
|
262 |
void mm_ServerExecute(void) { |
|
darope@0
|
263 |
META_ENGINE_HANDLE_void(FN_SERVEREXECUTE, pfnServerExecute, ()); |
|
darope@0
|
264 |
RETURN_API_void() |
|
darope@0
|
265 |
} |
|
dvander@261
|
266 |
void mm_engClientCommand(edict_t *pEdict, const char *szFmt, ...) { |
|
darope@0
|
267 |
META_ENGINE_HANDLE_void_varargs(FN_CLIENTCOMMAND_ENG, pfnClientCommand, pEdict, szFmt); |
|
darope@0
|
268 |
RETURN_API_void() |
|
darope@0
|
269 |
} |
|
darope@0
|
270 |
|
|
darope@0
|
271 |
void mm_ParticleEffect(const float *org, const float *dir, float color, float count) { |
|
darope@0
|
272 |
META_ENGINE_HANDLE_void(FN_PARTICLEEFFECT, pfnParticleEffect, (org, dir, color, count)); |
|
darope@0
|
273 |
RETURN_API_void() |
|
darope@0
|
274 |
} |
|
ds@277
|
275 |
void mm_LightStyle(int style, const char *val) { |
|
darope@0
|
276 |
META_ENGINE_HANDLE_void(FN_LIGHTSTYLE, pfnLightStyle, (style, val)); |
|
darope@0
|
277 |
RETURN_API_void() |
|
darope@0
|
278 |
} |
|
darope@0
|
279 |
int mm_DecalIndex(const char *name) { |
|
darope@0
|
280 |
META_ENGINE_HANDLE(int, 0, FN_DECALINDEX, pfnDecalIndex, (name)); |
|
darope@0
|
281 |
RETURN_API() |
|
darope@0
|
282 |
} |
|
darope@0
|
283 |
int mm_PointContents(const float *rgflVector) { |
|
darope@0
|
284 |
META_ENGINE_HANDLE(int, 0, FN_POINTCONTENTS, pfnPointContents, (rgflVector)); |
|
darope@0
|
285 |
RETURN_API() |
|
darope@0
|
286 |
} |
|
darope@0
|
287 |
|
|
darope@0
|
288 |
void mm_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) { |
|
darope@0
|
289 |
META_ENGINE_HANDLE_void(FN_MESSAGEBEGIN, pfnMessageBegin, (msg_dest, msg_type, pOrigin, ed)); |
|
darope@0
|
290 |
RETURN_API_void() |
|
darope@0
|
291 |
} |
|
darope@0
|
292 |
void mm_MessageEnd(void) { |
|
darope@0
|
293 |
META_ENGINE_HANDLE_void(FN_MESSAGEEND, pfnMessageEnd, ()); |
|
darope@0
|
294 |
RETURN_API_void() |
|
darope@0
|
295 |
} |
|
darope@0
|
296 |
|
|
darope@0
|
297 |
void mm_WriteByte(int iValue) { |
|
darope@0
|
298 |
META_ENGINE_HANDLE_void(FN_WRITEBYTE, pfnWriteByte, (iValue)); |
|
darope@0
|
299 |
RETURN_API_void() |
|
darope@0
|
300 |
} |
|
darope@0
|
301 |
void mm_WriteChar(int iValue) { |
|
darope@0
|
302 |
META_ENGINE_HANDLE_void(FN_WRITECHAR, pfnWriteChar, (iValue)); |
|
darope@0
|
303 |
RETURN_API_void() |
|
darope@0
|
304 |
} |
|
darope@0
|
305 |
void mm_WriteShort(int iValue) { |
|
darope@0
|
306 |
META_ENGINE_HANDLE_void(FN_WRITESHORT, pfnWriteShort, (iValue)); |
|
darope@0
|
307 |
RETURN_API_void() |
|
darope@0
|
308 |
} |
|
darope@0
|
309 |
void mm_WriteLong(int iValue) { |
|
darope@0
|
310 |
META_ENGINE_HANDLE_void(FN_WRITELONG, pfnWriteLong, (iValue)); |
|
darope@0
|
311 |
RETURN_API_void() |
|
darope@0
|
312 |
} |
|
darope@0
|
313 |
void mm_WriteAngle(float flValue) { |
|
darope@0
|
314 |
META_ENGINE_HANDLE_void(FN_WRITEANGLE, pfnWriteAngle, (flValue)); |
|
darope@0
|
315 |
RETURN_API_void() |
|
darope@0
|
316 |
} |
|
darope@0
|
317 |
void mm_WriteCoord(float flValue) { |
|
darope@0
|
318 |
META_ENGINE_HANDLE_void(FN_WRITECOORD, pfnWriteCoord, (flValue)); |
|
darope@0
|
319 |
RETURN_API_void() |
|
darope@0
|
320 |
} |
|
darope@0
|
321 |
void mm_WriteString(const char *sz) { |
|
darope@0
|
322 |
META_ENGINE_HANDLE_void(FN_WRITESTRING, pfnWriteString, (sz)); |
|
darope@0
|
323 |
RETURN_API_void() |
|
darope@0
|
324 |
} |
|
darope@0
|
325 |
void mm_WriteEntity(int iValue) { |
|
darope@0
|
326 |
META_ENGINE_HANDLE_void(FN_WRITEENTITY, pfnWriteEntity, (iValue)); |
|
darope@0
|
327 |
RETURN_API_void() |
|
darope@0
|
328 |
} |
|
darope@0
|
329 |
|
|
darope@0
|
330 |
void mm_CVarRegister(cvar_t *pCvar) { |
|
darope@0
|
331 |
META_ENGINE_HANDLE_void(FN_CVARREGISTER, pfnCVarRegister, (pCvar)); |
|
darope@0
|
332 |
RETURN_API_void() |
|
darope@0
|
333 |
} |
|
darope@0
|
334 |
float mm_CVarGetFloat(const char *szVarName) { |
|
darope@0
|
335 |
META_ENGINE_HANDLE(float, 0.0, FN_CVARGETFLOAT, pfnCVarGetFloat, (szVarName)); |
|
darope@0
|
336 |
RETURN_API() |
|
darope@0
|
337 |
} |
|
darope@0
|
338 |
const char *mm_CVarGetString(const char *szVarName) { |
|
darope@0
|
339 |
META_ENGINE_HANDLE(const char *, NULL, FN_CVARGETSTRING, pfnCVarGetString, (szVarName)); |
|
darope@0
|
340 |
RETURN_API() |
|
darope@0
|
341 |
} |
|
darope@0
|
342 |
void mm_CVarSetFloat(const char *szVarName, float flValue) { |
|
darope@0
|
343 |
META_ENGINE_HANDLE_void(FN_CVARSETFLOAT, pfnCVarSetFloat, (szVarName, flValue)); |
|
darope@0
|
344 |
RETURN_API_void() |
|
darope@0
|
345 |
} |
|
darope@0
|
346 |
void mm_CVarSetString(const char *szVarName, const char *szValue) { |
|
darope@0
|
347 |
META_ENGINE_HANDLE_void(FN_CVARSETSTRING, pfnCVarSetString, (szVarName, szValue)); |
|
darope@0
|
348 |
RETURN_API_void() |
|
darope@0
|
349 |
} |
|
darope@0
|
350 |
|
|
dvander@261
|
351 |
void mm_AlertMessage(ALERT_TYPE atype, const char *szFmt, ...) { |
|
darope@0
|
352 |
#ifndef UNFINISHED |
|
darope@0
|
353 |
META_ENGINE_HANDLE_void_varargs(FN_ALERTMESSAGE, pfnAlertMessage, atype, szFmt); |
|
darope@0
|
354 |
#else /* UNFINISHED */ |
|
darope@0
|
355 |
// Expand macro, since we need to do extra work here. |
|
darope@0
|
356 |
|
|
darope@0
|
357 |
// usual setup |
|
darope@0
|
358 |
SETUP_API_CALLS_void(FN_ALERTMESSAGE, pfnAlertMessage, engine_info); |
|
darope@0
|
359 |
char buf[MAX_STRBUF_LEN]; |
|
darope@0
|
360 |
va_list ap; |
|
darope@0
|
361 |
int len; |
|
darope@0
|
362 |
char *qmsg; |
|
darope@0
|
363 |
META_DEBUG(loglevel, ("In %s: fmt=%s", pfn_string, szFmt)); |
|
darope@0
|
364 |
va_start(ap, szFmt); |
|
darope@0
|
365 |
len=vsnprintf(buf, sizeof(buf), szFmt, ap) + 1; |
|
darope@0
|
366 |
va_end(ap); |
|
darope@0
|
367 |
// pass logmsg string to log parsing thread |
|
darope@0
|
368 |
/// qmsg=strdup(buf); |
|
darope@0
|
369 |
qmsg=(char *) malloc(len * sizeof(char)); |
|
darope@0
|
370 |
if(!qmsg) |
|
darope@0
|
371 |
META_ERROR("malloc failed for logmsg to thread queue"); |
|
darope@0
|
372 |
else { |
|
darope@0
|
373 |
STRNCPY(qmsg, buf, len); |
|
darope@0
|
374 |
LogQueue->push(qmsg); |
|
darope@0
|
375 |
} |
|
darope@0
|
376 |
// usual passing to plugins/engine |
|
darope@0
|
377 |
CALL_PLUGIN_API_void(P_PRE, pfnAlertMessage, (atype, "%s", buf), engine_table); |
|
darope@0
|
378 |
CALL_ENGINE_API_void(pfnAlertMessage, (atype, "%s", buf)); |
|
darope@0
|
379 |
CALL_PLUGIN_API_void(P_POST, pfnAlertMessage, (atype, "%s", buf), engine_post_table); |
|
darope@0
|
380 |
#endif /* UNFINISHED */ |
|
darope@0
|
381 |
|
|
darope@0
|
382 |
// usual return. |
|
darope@0
|
383 |
RETURN_API_void() |
|
darope@0
|
384 |
} |
|
darope@236
|
385 |
#ifdef HLSDK_3_2_OLD_EIFACE |
|
ds@265
|
386 |
void mm_EngineFprintf(FILE *pfile, const char *szFmt, ...) { |
|
darope@236
|
387 |
#else |
|
ds@265
|
388 |
void mm_EngineFprintf(void *pfile, const char *szFmt, ...) { |
|
darope@236
|
389 |
#endif |
|
darope@0
|
390 |
META_ENGINE_HANDLE_void_varargs(FN_ENGINEFPRINTF, pfnEngineFprintf, pfile, szFmt); |
|
darope@0
|
391 |
RETURN_API_void() |
|
darope@0
|
392 |
} |
|
darope@0
|
393 |
|
|
darope@236
|
394 |
#ifdef HLSDK_3_2_OLD_EIFACE |
|
darope@0
|
395 |
void *mm_PvAllocEntPrivateData(edict_t *pEdict, long cb) { |
|
darope@236
|
396 |
#else |
|
darope@236
|
397 |
void *mm_PvAllocEntPrivateData(edict_t *pEdict, int32 cb) { |
|
darope@236
|
398 |
#endif |
|
darope@0
|
399 |
META_ENGINE_HANDLE(void *, NULL, FN_PVALLOCENTPRIVATEDATA, pfnPvAllocEntPrivateData, (pEdict, cb)); |
|
darope@0
|
400 |
RETURN_API() |
|
darope@0
|
401 |
} |
|
darope@0
|
402 |
void *mm_PvEntPrivateData(edict_t *pEdict) { |
|
darope@0
|
403 |
META_ENGINE_HANDLE(void *, NULL, FN_PVENTPRIVATEDATA, pfnPvEntPrivateData, (pEdict)); |
|
darope@0
|
404 |
RETURN_API() |
|
darope@0
|
405 |
} |
|
darope@0
|
406 |
void mm_FreeEntPrivateData(edict_t *pEdict) { |
|
darope@0
|
407 |
META_ENGINE_HANDLE_void(FN_FREEENTPRIVATEDATA, pfnFreeEntPrivateData, (pEdict)); |
|
darope@0
|
408 |
RETURN_API_void() |
|
darope@0
|
409 |
} |
|
darope@0
|
410 |
|
|
darope@0
|
411 |
const char *mm_SzFromIndex(int iString) { |
|
darope@0
|
412 |
META_ENGINE_HANDLE(const char *, NULL, FN_SZFROMINDEX, pfnSzFromIndex, (iString)); |
|
darope@0
|
413 |
RETURN_API() |
|
darope@0
|
414 |
} |
|
darope@0
|
415 |
int mm_AllocString(const char *szValue) { |
|
darope@0
|
416 |
META_ENGINE_HANDLE(int, 0, FN_ALLOCSTRING, pfnAllocString, (szValue)); |
|
darope@0
|
417 |
RETURN_API() |
|
darope@0
|
418 |
} |
|
darope@0
|
419 |
|
|
darope@0
|
420 |
struct entvars_s *mm_GetVarsOfEnt(edict_t *pEdict) { |
|
darope@0
|
421 |
META_ENGINE_HANDLE(struct entvars_s *, NULL, FN_GETVARSOFENT, pfnGetVarsOfEnt, (pEdict)); |
|
darope@0
|
422 |
RETURN_API() |
|
darope@0
|
423 |
} |
|
darope@0
|
424 |
edict_t *mm_PEntityOfEntOffset(int iEntOffset) { |
|
darope@0
|
425 |
META_ENGINE_HANDLE(edict_t *, NULL, FN_PENTITYOFENTOFFSET, pfnPEntityOfEntOffset, (iEntOffset)); |
|
darope@0
|
426 |
RETURN_API() |
|
darope@0
|
427 |
} |
|
darope@0
|
428 |
int mm_EntOffsetOfPEntity(const edict_t *pEdict) { |
|
darope@0
|
429 |
META_ENGINE_HANDLE(int, 0, FN_ENTOFFSETOFPENTITY, pfnEntOffsetOfPEntity, (pEdict)); |
|
darope@0
|
430 |
RETURN_API() |
|
darope@0
|
431 |
} |
|
darope@0
|
432 |
int mm_IndexOfEdict(const edict_t *pEdict) { |
|
darope@0
|
433 |
META_ENGINE_HANDLE(int, 0, FN_INDEXOFEDICT, pfnIndexOfEdict, (pEdict)); |
|
darope@0
|
434 |
RETURN_API() |
|
darope@0
|
435 |
} |
|
darope@0
|
436 |
edict_t *mm_PEntityOfEntIndex(int iEntIndex) { |
|
darope@0
|
437 |
META_ENGINE_HANDLE(edict_t *, NULL, FN_PENTITYOFENTINDEX, pfnPEntityOfEntIndex, (iEntIndex)); |
|
darope@0
|
438 |
RETURN_API() |
|
darope@0
|
439 |
} |
|
darope@0
|
440 |
edict_t *mm_FindEntityByVars(struct entvars_s *pvars) { |
|
darope@0
|
441 |
META_ENGINE_HANDLE(edict_t *, NULL, FN_FINDENTITYBYVARS, pfnFindEntityByVars, (pvars)); |
|
darope@0
|
442 |
RETURN_API() |
|
darope@0
|
443 |
} |
|
darope@0
|
444 |
void *mm_GetModelPtr(edict_t *pEdict) { |
|
darope@0
|
445 |
META_ENGINE_HANDLE(void *, NULL, FN_GETMODELPTR, pfnGetModelPtr, (pEdict)); |
|
darope@0
|
446 |
RETURN_API() |
|
darope@0
|
447 |
} |
|
darope@0
|
448 |
|
|
darope@0
|
449 |
int mm_RegUserMsg(const char *pszName, int iSize) { |
|
darope@0
|
450 |
int imsgid; |
|
darope@0
|
451 |
MRegMsg *nmsg=NULL; |
|
darope@0
|
452 |
META_ENGINE_HANDLE(int, 0, FN_REGUSERMSG, pfnRegUserMsg, (pszName, iSize)); |
|
darope@0
|
453 |
// Expand the macro, since we need to do extra work. |
|
darope@0
|
454 |
/// RETURN_API() |
|
darope@248
|
455 |
if (--CALL_API_count>0) |
|
darope@248
|
456 |
/*Restore backup*/ |
|
darope@248
|
457 |
PublicMetaGlobals = backup_meta_globals; |
|
darope@0
|
458 |
if(status==MRES_OVERRIDE) { |
|
darope@0
|
459 |
META_DEBUG(loglevel, ("Returning (override) %s()", pfn_string)); |
|
darope@0
|
460 |
imsgid=override_ret; |
|
darope@0
|
461 |
} |
|
darope@0
|
462 |
else |
|
darope@0
|
463 |
imsgid=orig_ret; |
|
darope@0
|
464 |
// Add the msgid, name, and size to our saved list, if we haven't |
|
darope@0
|
465 |
// already. |
|
darope@0
|
466 |
nmsg=RegMsgs->find(imsgid); |
|
darope@0
|
467 |
if(nmsg) { |
|
darope@0
|
468 |
if(FStrEq(pszName, nmsg->name)) |
|
darope@0
|
469 |
// This name/msgid pair was already registered. |
|
darope@0
|
470 |
META_DEBUG(3, ("user message registered again: name=%s, msgid=%d", pszName, imsgid)); |
|
darope@0
|
471 |
else |
|
darope@0
|
472 |
// This msgid was previously used by a different message name. |
|
darope@0
|
473 |
META_ERROR("user message id reused: msgid=%d, oldname=%s, newname=%s", imsgid, nmsg->name, pszName); |
|
darope@0
|
474 |
} |
|
darope@0
|
475 |
else |
|
darope@0
|
476 |
RegMsgs->add(pszName, imsgid, iSize); |
|
darope@0
|
477 |
return(imsgid); |
|
darope@0
|
478 |
} |
|
darope@0
|
479 |
|
|
darope@0
|
480 |
void mm_AnimationAutomove(const edict_t *pEdict, float flTime) { |
|
darope@0
|
481 |
META_ENGINE_HANDLE_void(FN_ANIMATIONAUTOMOVE, pfnAnimationAutomove, (pEdict, flTime)); |
|
darope@0
|
482 |
RETURN_API_void() |
|
darope@0
|
483 |
} |
|
darope@0
|
484 |
void mm_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles ) { |
|
darope@0
|
485 |
META_ENGINE_HANDLE_void(FN_GETBONEPOSITION, pfnGetBonePosition, (pEdict, iBone, rgflOrigin, rgflAngles)); |
|
darope@0
|
486 |
RETURN_API_void() |
|
darope@0
|
487 |
} |
|
darope@0
|
488 |
|
|
darope@236
|
489 |
#ifdef HLSDK_3_2_OLD_EIFACE |
|
darope@0
|
490 |
unsigned long mm_FunctionFromName( const char *pName ) { |
|
darope@0
|
491 |
META_ENGINE_HANDLE(unsigned long, 0, FN_FUNCTIONFROMNAME, pfnFunctionFromName, (pName)); |
|
darope@236
|
492 |
#else |
|
darope@236
|
493 |
uint32 mm_FunctionFromName( const char *pName ) { |
|
darope@236
|
494 |
META_ENGINE_HANDLE(uint32, 0, FN_FUNCTIONFROMNAME, pfnFunctionFromName, (pName)); |
|
darope@236
|
495 |
#endif |
|
darope@0
|
496 |
RETURN_API() |
|
darope@0
|
497 |
} |
|
darope@236
|
498 |
#ifdef HLSDK_3_2_OLD_EIFACE |
|
darope@0
|
499 |
const char *mm_NameForFunction( unsigned long function ) { |
|
darope@236
|
500 |
#else |
|
darope@236
|
501 |
const char *mm_NameForFunction( uint32 function ) { |
|
darope@236
|
502 |
#endif |
|
darope@0
|
503 |
META_ENGINE_HANDLE(const char *, NULL, FN_NAMEFORFUNCTION, pfnNameForFunction, (function)); |
|
darope@0
|
504 |
RETURN_API() |
|
darope@0
|
505 |
} |
|
darope@0
|
506 |
|
|
darope@0
|
507 |
//! JOHN: engine callbacks so game DLL can print messages to individual clients |
|
darope@0
|
508 |
void mm_ClientPrintf( edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg ) { |
|
darope@0
|
509 |
META_ENGINE_HANDLE_void(FN_CLIENTPRINTF, pfnClientPrintf, (pEdict, ptype, szMsg)); |
|
darope@0
|
510 |
RETURN_API_void() |
|
darope@0
|
511 |
} |
|
darope@0
|
512 |
void mm_ServerPrint( const char *szMsg ) { |
|
darope@0
|
513 |
META_ENGINE_HANDLE_void(FN_SERVERPRINT, pfnServerPrint, (szMsg)); |
|
darope@0
|
514 |
RETURN_API_void() |
|
darope@0
|
515 |
} |
|
darope@0
|
516 |
|
|
darope@0
|
517 |
//! these 3 added so game DLL can easily access client 'cmd' strings |
|
darope@0
|
518 |
const char *mm_Cmd_Args( void ) { |
|
darope@0
|
519 |
META_ENGINE_HANDLE(const char *, NULL, FN_CMD_ARGS, pfnCmd_Args, ()); |
|
darope@0
|
520 |
RETURN_API() |
|
darope@0
|
521 |
} |
|
darope@0
|
522 |
const char *mm_Cmd_Argv( int argc ) { |
|
darope@0
|
523 |
META_ENGINE_HANDLE(const char *, NULL, FN_CMD_ARGV, pfnCmd_Argv, (argc)); |
|
darope@0
|
524 |
RETURN_API() |
|
darope@0
|
525 |
} |
|
darope@0
|
526 |
int mm_Cmd_Argc( void ) { |
|
darope@0
|
527 |
META_ENGINE_HANDLE(int, 0, FN_CMD_ARGC, pfnCmd_Argc, ()); |
|
darope@0
|
528 |
RETURN_API() |
|
darope@0
|
529 |
} |
|
darope@0
|
530 |
|
|
darope@0
|
531 |
void mm_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ) { |
|
darope@0
|
532 |
META_ENGINE_HANDLE_void(FN_GETATTACHMENT, pfnGetAttachment, (pEdict, iAttachment, rgflOrigin, rgflAngles)); |
|
darope@0
|
533 |
RETURN_API_void() |
|
darope@0
|
534 |
} |
|
darope@0
|
535 |
|
|
darope@0
|
536 |
void mm_CRC32_Init(CRC32_t *pulCRC) { |
|
darope@0
|
537 |
META_ENGINE_HANDLE_void(FN_CRC32_INIT, pfnCRC32_Init, (pulCRC)); |
|
darope@0
|
538 |
RETURN_API_void() |
|
darope@0
|
539 |
} |
|
darope@0
|
540 |
void mm_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len) { |
|
darope@0
|
541 |
META_ENGINE_HANDLE_void(FN_CRC32_PROCESSBUFFER, pfnCRC32_ProcessBuffer, (pulCRC, p, len)); |
|
darope@0
|
542 |
RETURN_API_void() |
|
darope@0
|
543 |
} |
|
darope@0
|
544 |
void mm_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch) { |
|
darope@0
|
545 |
META_ENGINE_HANDLE_void(FN_CRC32_PROCESSBYTE, pfnCRC32_ProcessByte, (pulCRC, ch)); |
|
darope@0
|
546 |
RETURN_API_void() |
|
darope@0
|
547 |
} |
|
darope@0
|
548 |
CRC32_t mm_CRC32_Final(CRC32_t pulCRC) { |
|
darope@0
|
549 |
META_ENGINE_HANDLE(CRC32_t, 0, FN_CRC32_FINAL, pfnCRC32_Final, (pulCRC)); |
|
darope@0
|
550 |
RETURN_API() |
|
darope@0
|
551 |
} |
|
darope@0
|
552 |
|
|
darope@236
|
553 |
#ifdef HLSDK_3_2_OLD_EIFACE |
|
darope@0
|
554 |
long mm_RandomLong(long lLow, long lHigh) { |
|
darope@0
|
555 |
META_ENGINE_HANDLE(long, 0, FN_RANDOMLONG, pfnRandomLong, (lLow, lHigh)); |
|
darope@236
|
556 |
#else |
|
darope@236
|
557 |
int32 mm_RandomLong(int32 lLow, int32 lHigh) { |
|
darope@236
|
558 |
META_ENGINE_HANDLE(int32, 0, FN_RANDOMLONG, pfnRandomLong, (lLow, lHigh)); |
|
darope@236
|
559 |
#endif |
|
darope@0
|
560 |
RETURN_API() |
|
darope@0
|
561 |
} |
|
darope@0
|
562 |
float mm_RandomFloat(float flLow, float flHigh) { |
|
darope@0
|
563 |
META_ENGINE_HANDLE(float, 0.0, FN_RANDOMFLOAT, pfnRandomFloat, (flLow, flHigh)); |
|
darope@0
|
564 |
RETURN_API() |
|
darope@0
|
565 |
} |
|
darope@0
|
566 |
|
|
darope@0
|
567 |
void mm_SetView(const edict_t *pClient, const edict_t *pViewent ) { |
|
darope@0
|
568 |
META_ENGINE_HANDLE_void(FN_SETVIEW, pfnSetView, (pClient, pViewent)); |
|
darope@0
|
569 |
RETURN_API_void() |
|
darope@0
|
570 |
} |
|
darope@0
|
571 |
float mm_Time( void ) { |
|
darope@0
|
572 |
META_ENGINE_HANDLE(float, 0.0, FN_TIME, pfnTime, ()); |
|
darope@0
|
573 |
RETURN_API() |
|
darope@0
|
574 |
} |
|
darope@0
|
575 |
void mm_CrosshairAngle(const edict_t *pClient, float pitch, float yaw) { |
|
darope@0
|
576 |
META_ENGINE_HANDLE_void(FN_CROSSHAIRANGLE, pfnCrosshairAngle, (pClient, pitch, yaw)); |
|
darope@0
|
577 |
RETURN_API_void() |
|
darope@0
|
578 |
} |
|
darope@0
|
579 |
|
|
ds@277
|
580 |
byte * mm_LoadFileForMe(const char *filename, int *pLength) { |
|
darope@0
|
581 |
META_ENGINE_HANDLE(byte *, NULL, FN_LOADFILEFORME, pfnLoadFileForMe, (filename, pLength)); |
|
darope@0
|
582 |
RETURN_API() |
|
darope@0
|
583 |
} |
|
darope@0
|
584 |
void mm_FreeFile(void *buffer) { |
|
darope@0
|
585 |
META_ENGINE_HANDLE_void(FN_FREEFILE, pfnFreeFile, (buffer)); |
|
darope@0
|
586 |
RETURN_API_void() |
|
darope@0
|
587 |
} |
|
darope@0
|
588 |
|
|
darope@0
|
589 |
//! trigger_endsection |
|
darope@0
|
590 |
void mm_EndSection(const char *pszSectionName) { |
|
darope@0
|
591 |
META_ENGINE_HANDLE_void(FN_ENDSECTION, pfnEndSection, (pszSectionName)); |
|
darope@0
|
592 |
RETURN_API_void() |
|
darope@0
|
593 |
} |
|
darope@0
|
594 |
int mm_CompareFileTime(char *filename1, char *filename2, int *iCompare) { |
|
darope@0
|
595 |
META_ENGINE_HANDLE(int, 0, FN_COMPAREFILETIME, pfnCompareFileTime, (filename1, filename2, iCompare)); |
|
darope@0
|
596 |
RETURN_API() |
|
darope@0
|
597 |
} |
|
darope@0
|
598 |
void mm_GetGameDir(char *szGetGameDir) { |
|
darope@0
|
599 |
META_ENGINE_HANDLE_void(FN_GETGAMEDIR, pfnGetGameDir, (szGetGameDir)); |
|
darope@0
|
600 |
RETURN_API_void() |
|
darope@0
|
601 |
} |
|
darope@0
|
602 |
void mm_Cvar_RegisterVariable(cvar_t *variable) { |
|
darope@0
|
603 |
META_ENGINE_HANDLE_void(FN_CVAR_REGISTERVARIABLE, pfnCvar_RegisterVariable, (variable)); |
|
darope@0
|
604 |
RETURN_API_void() |
|
darope@0
|
605 |
} |
|
darope@0
|
606 |
void mm_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds) { |
|
darope@0
|
607 |
META_ENGINE_HANDLE_void(FN_FADECLIENTVOLUME, pfnFadeClientVolume, (pEdict, fadePercent, fadeOutSeconds, holdTime, fadeInSeconds)); |
|
darope@0
|
608 |
RETURN_API_void() |
|
darope@0
|
609 |
} |
|
darope@0
|
610 |
void mm_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed) { |
|
darope@0
|
611 |
META_ENGINE_HANDLE_void(FN_SETCLIENTMAXSPEED, pfnSetClientMaxspeed, (pEdict, fNewMaxspeed)); |
|
darope@0
|
612 |
RETURN_API_void() |
|
darope@0
|
613 |
} |
|
darope@0
|
614 |
//! returns NULL if fake client can't be created |
|
darope@0
|
615 |
edict_t * mm_CreateFakeClient(const char *netname) { |
|
darope@0
|
616 |
META_ENGINE_HANDLE(edict_t *, NULL, FN_CREATEFAKECLIENT, pfnCreateFakeClient, (netname)); |
|
darope@0
|
617 |
RETURN_API() |
|
darope@0
|
618 |
} |
|
darope@0
|
619 |
void mm_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec ) { |
|
darope@0
|
620 |
META_ENGINE_HANDLE_void(FN_RUNPLAYERMOVE, pfnRunPlayerMove, (fakeclient, viewangles, forwardmove, sidemove, upmove, buttons, impulse, msec)); |
|
darope@0
|
621 |
RETURN_API_void() |
|
darope@0
|
622 |
} |
|
darope@0
|
623 |
int mm_NumberOfEntities(void) { |
|
darope@0
|
624 |
META_ENGINE_HANDLE(int, 0, FN_NUMBEROFENTITIES, pfnNumberOfEntities, ()); |
|
darope@0
|
625 |
RETURN_API() |
|
darope@0
|
626 |
} |
|
darope@0
|
627 |
|
|
darope@0
|
628 |
//! passing in NULL gets the serverinfo |
|
darope@0
|
629 |
char *mm_GetInfoKeyBuffer(edict_t *e) { |
|
darope@0
|
630 |
META_ENGINE_HANDLE(char *, NULL, FN_GETINFOKEYBUFFER, pfnGetInfoKeyBuffer, (e)); |
|
darope@0
|
631 |
RETURN_API() |
|
darope@0
|
632 |
} |
|
ds@265
|
633 |
char *mm_InfoKeyValue(char *infobuffer, const char *key) { |
|
darope@0
|
634 |
META_ENGINE_HANDLE(char *, NULL, FN_INFOKEYVALUE, pfnInfoKeyValue, (infobuffer, key)); |
|
darope@0
|
635 |
RETURN_API() |
|
darope@0
|
636 |
} |
|
ds@265
|
637 |
void mm_SetKeyValue(char *infobuffer, const char *key, const char *value) { |
|
darope@0
|
638 |
META_ENGINE_HANDLE_void(FN_SETKEYVALUE, pfnSetKeyValue, (infobuffer, key, value)); |
|
darope@0
|
639 |
RETURN_API_void() |
|
darope@0
|
640 |
} |
|
ds@265
|
641 |
void mm_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value) { |
|
darope@0
|
642 |
META_ENGINE_HANDLE_void(FN_SETCLIENTKEYVALUE, pfnSetClientKeyValue, (clientIndex, infobuffer, key, value)); |
|
darope@0
|
643 |
RETURN_API_void() |
|
darope@0
|
644 |
} |
|
darope@0
|
645 |
|
|
ds@265
|
646 |
int mm_IsMapValid(const char *filename) { |
|
darope@0
|
647 |
META_ENGINE_HANDLE(int, 0, FN_ISMAPVALID, pfnIsMapValid, (filename)); |
|
darope@0
|
648 |
RETURN_API() |
|
darope@0
|
649 |
} |
|
darope@0
|
650 |
void mm_StaticDecal( const float *origin, int decalIndex, int entityIndex, int modelIndex ) { |
|
darope@0
|
651 |
META_ENGINE_HANDLE_void(FN_STATICDECAL, pfnStaticDecal, (origin, decalIndex, entityIndex, modelIndex)); |
|
darope@0
|
652 |
RETURN_API_void() |
|
darope@0
|
653 |
} |
|
ds@265
|
654 |
int mm_PrecacheGeneric(const char *s) { |
|
darope@0
|
655 |
META_ENGINE_HANDLE(int, 0, FN_PRECACHEGENERIC, pfnPrecacheGeneric, (s)); |
|
darope@0
|
656 |
RETURN_API() |
|
darope@0
|
657 |
} |
|
darope@0
|
658 |
//! returns the server assigned userid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients |
|
darope@0
|
659 |
int mm_GetPlayerUserId(edict_t *e ) { |
|
darope@0
|
660 |
META_ENGINE_HANDLE(int, 0, FN_GETPLAYERUSERID, pfnGetPlayerUserId, (e)); |
|
darope@0
|
661 |
RETURN_API() |
|
darope@0
|
662 |
} |
|
darope@0
|
663 |
void mm_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) |
|
darope@0
|
664 |
{ |
|
darope@0
|
665 |
META_ENGINE_HANDLE_void(FN_BUILDSOUNDMSG, pfnBuildSoundMsg, (entity, channel, sample, volume, attenuation, fFlags, pitch, msg_dest, msg_type, pOrigin, ed)); |
|
darope@0
|
666 |
RETURN_API_void() |
|
darope@0
|
667 |
} |
|
darope@0
|
668 |
//! is this a dedicated server? |
|
darope@0
|
669 |
int mm_IsDedicatedServer(void) { |
|
darope@0
|
670 |
META_ENGINE_HANDLE(int, 0, FN_ISDEDICATEDSERVER, pfnIsDedicatedServer, ()); |
|
darope@0
|
671 |
RETURN_API() |
|
darope@0
|
672 |
} |
|
darope@0
|
673 |
cvar_t *mm_CVarGetPointer(const char *szVarName) { |
|
darope@0
|
674 |
META_ENGINE_HANDLE(cvar_t *, NULL, FN_CVARGETPOINTER, pfnCVarGetPointer, (szVarName)); |
|
darope@0
|
675 |
RETURN_API() |
|
darope@0
|
676 |
} |
|
darope@0
|
677 |
//! returns the server assigned WONid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients |
|
darope@0
|
678 |
unsigned int mm_GetPlayerWONId(edict_t *e) { |
|
darope@0
|
679 |
META_ENGINE_HANDLE(unsigned int, 0, FN_GETPLAYERWONID, pfnGetPlayerWONId, (e)); |
|
darope@0
|
680 |
RETURN_API() |
|
darope@0
|
681 |
} |
|
darope@0
|
682 |
|
|
darope@0
|
683 |
//! YWB 8/1/99 TFF Physics additions |
|
darope@0
|
684 |
void mm_Info_RemoveKey( char *s, const char *key ) { |
|
darope@0
|
685 |
META_ENGINE_HANDLE_void(FN_INFO_REMOVEKEY, pfnInfo_RemoveKey, (s, key)); |
|
darope@0
|
686 |
RETURN_API_void() |
|
darope@0
|
687 |
} |
|
darope@0
|
688 |
const char *mm_GetPhysicsKeyValue( const edict_t *pClient, const char *key ) { |
|
darope@0
|
689 |
META_ENGINE_HANDLE(const char *, NULL, FN_GETPHYSICSKEYVALUE, pfnGetPhysicsKeyValue, (pClient, key)); |
|
darope@0
|
690 |
RETURN_API() |
|
darope@0
|
691 |
} |
|
darope@0
|
692 |
void mm_SetPhysicsKeyValue( const edict_t *pClient, const char *key, const char *value ) { |
|
darope@0
|
693 |
META_ENGINE_HANDLE_void(FN_SETPHYSICSKEYVALUE, pfnSetPhysicsKeyValue, (pClient, key, value)); |
|
darope@0
|
694 |
RETURN_API_void() |
|
darope@0
|
695 |
} |
|
darope@0
|
696 |
const char *mm_GetPhysicsInfoString( const edict_t *pClient ) { |
|
darope@0
|
697 |
META_ENGINE_HANDLE(const char *, NULL, FN_GETPHYSICSINFOSTRING, pfnGetPhysicsInfoString, (pClient)); |
|
darope@0
|
698 |
RETURN_API() |
|
darope@0
|
699 |
} |
|
darope@0
|
700 |
unsigned short mm_PrecacheEvent( int type, const char *psz ) { |
|
darope@0
|
701 |
META_ENGINE_HANDLE(unsigned short, 0, FN_PRECACHEEVENT, pfnPrecacheEvent, (type, psz)); |
|
darope@0
|
702 |
RETURN_API() |
|
darope@0
|
703 |
} |
|
darope@0
|
704 |
void mm_PlaybackEvent( int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ) |
|
darope@0
|
705 |
{ |
|
darope@0
|
706 |
META_ENGINE_HANDLE_void(FN_PLAYBACKEVENT, pfnPlaybackEvent, (flags, pInvoker, eventindex, delay, origin, angles, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2)); |
|
darope@0
|
707 |
RETURN_API_void() |
|
darope@0
|
708 |
} |
|
darope@0
|
709 |
|
|
darope@0
|
710 |
unsigned char *mm_SetFatPVS( float *org ) { |
|
darope@0
|
711 |
META_ENGINE_HANDLE(unsigned char *, 0, FN_SETFATPVS, pfnSetFatPVS, (org)); |
|
darope@0
|
712 |
RETURN_API() |
|
darope@0
|
713 |
} |
|
darope@0
|
714 |
unsigned char *mm_SetFatPAS( float *org ) { |
|
darope@0
|
715 |
META_ENGINE_HANDLE(unsigned char *, 0, FN_SETFATPAS, pfnSetFatPAS, (org)); |
|
darope@0
|
716 |
RETURN_API() |
|
darope@0
|
717 |
} |
|
darope@0
|
718 |
|
|
darope@0
|
719 |
int mm_CheckVisibility( const edict_t *entity, unsigned char *pset ) { |
|
darope@0
|
720 |
META_ENGINE_HANDLE(int, 0, FN_CHECKVISIBILITY, pfnCheckVisibility, (entity, pset)); |
|
darope@0
|
721 |
RETURN_API() |
|
darope@0
|
722 |
} |
|
darope@0
|
723 |
|
|
darope@0
|
724 |
void mm_DeltaSetField( struct delta_s *pFields, const char *fieldname ) { |
|
darope@0
|
725 |
META_ENGINE_HANDLE_void(FN_DELTASETFIELD, pfnDeltaSetField, (pFields, fieldname)); |
|
darope@0
|
726 |
RETURN_API_void() |
|
darope@0
|
727 |
} |
|
darope@0
|
728 |
void mm_DeltaUnsetField( struct delta_s *pFields, const char *fieldname ) { |
|
darope@0
|
729 |
META_ENGINE_HANDLE_void(FN_DELTAUNSETFIELD, pfnDeltaUnsetField, (pFields, fieldname)); |
|
darope@0
|
730 |
RETURN_API_void() |
|
darope@0
|
731 |
} |
|
ds@277
|
732 |
void mm_DeltaAddEncoder( const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ) { |
|
darope@0
|
733 |
META_ENGINE_HANDLE_void(FN_DELTAADDENCODER, pfnDeltaAddEncoder, (name, conditionalencode)); |
|
darope@0
|
734 |
RETURN_API_void() |
|
darope@0
|
735 |
} |
|
darope@0
|
736 |
int mm_GetCurrentPlayer( void ) { |
|
darope@0
|
737 |
META_ENGINE_HANDLE(int, 0, FN_GETCURRENTPLAYER, pfnGetCurrentPlayer, ()); |
|
darope@0
|
738 |
RETURN_API() |
|
darope@0
|
739 |
} |
|
darope@0
|
740 |
int mm_CanSkipPlayer( const edict_t *player ) { |
|
darope@0
|
741 |
META_ENGINE_HANDLE(int, 0, FN_CANSKIPPLAYER, pfnCanSkipPlayer, (player)); |
|
darope@0
|
742 |
RETURN_API() |
|
darope@0
|
743 |
} |
|
darope@0
|
744 |
int mm_DeltaFindField( struct delta_s *pFields, const char *fieldname ) { |
|
darope@0
|
745 |
META_ENGINE_HANDLE(int, 0, FN_DELTAFINDFIELD, pfnDeltaFindField, (pFields, fieldname)); |
|
darope@0
|
746 |
RETURN_API() |
|
darope@0
|
747 |
} |
|
darope@0
|
748 |
void mm_DeltaSetFieldByIndex( struct delta_s *pFields, int fieldNumber ) { |
|
darope@0
|
749 |
META_ENGINE_HANDLE_void(FN_DELTASETFIELDBYINDEX, pfnDeltaSetFieldByIndex, (pFields, fieldNumber)); |
|
darope@0
|
750 |
RETURN_API_void() |
|
darope@0
|
751 |
} |
|
darope@0
|
752 |
void mm_DeltaUnsetFieldByIndex( struct delta_s *pFields, int fieldNumber ) { |
|
darope@0
|
753 |
META_ENGINE_HANDLE_void(FN_DELTAUNSETFIELDBYINDEX, pfnDeltaUnsetFieldByIndex, (pFields, fieldNumber)); |
|
darope@0
|
754 |
RETURN_API_void() |
|
darope@0
|
755 |
} |
|
darope@0
|
756 |
|
|
darope@0
|
757 |
void mm_SetGroupMask( int mask, int op ) { |
|
darope@0
|
758 |
META_ENGINE_HANDLE_void(FN_SETGROUPMASK, pfnSetGroupMask, (mask, op)); |
|
darope@0
|
759 |
RETURN_API_void() |
|
darope@0
|
760 |
} |
|
darope@0
|
761 |
|
|
darope@0
|
762 |
int mm_engCreateInstancedBaseline( int classname, struct entity_state_s *baseline ) { |
|
darope@0
|
763 |
META_ENGINE_HANDLE(int, 0, FN_CREATEINSTANCEDBASELINE, pfnCreateInstancedBaseline, (classname, baseline)); |
|
darope@0
|
764 |
RETURN_API() |
|
darope@0
|
765 |
} |
|
ds@277
|
766 |
void mm_Cvar_DirectSet( struct cvar_s *var, const char *value ) { |
|
darope@0
|
767 |
META_ENGINE_HANDLE_void(FN_CVAR_DIRECTSET, pfnCvar_DirectSet, (var, value)); |
|
darope@0
|
768 |
RETURN_API_void() |
|
darope@0
|
769 |
} |
|
darope@0
|
770 |
|
|
darope@0
|
771 |
//! Forces the client and server to be running with the same version of the specified file |
|
darope@0
|
772 |
//!( e.g., a player model ). |
|
darope@0
|
773 |
//! Calling this has no effect in single player |
|
darope@0
|
774 |
void mm_ForceUnmodified( FORCE_TYPE type, float *mins, float *maxs, const char *filename ) { |
|
darope@0
|
775 |
META_ENGINE_HANDLE_void(FN_FORCEUNMODIFIED, pfnForceUnmodified, (type, mins, maxs, filename)); |
|
darope@0
|
776 |
RETURN_API_void() |
|
darope@0
|
777 |
} |
|
darope@0
|
778 |
|
|
darope@0
|
779 |
void mm_GetPlayerStats( const edict_t *pClient, int *ping, int *packet_loss ) { |
|
darope@0
|
780 |
META_ENGINE_HANDLE_void(FN_GETPLAYERSTATS, pfnGetPlayerStats, (pClient, ping, packet_loss)); |
|
darope@0
|
781 |
RETURN_API_void() |
|
darope@0
|
782 |
} |
|
darope@0
|
783 |
|
|
ds@265
|
784 |
void mm_AddServerCommand( const char *cmd_name, void (*function) (void) ) { |
|
darope@0
|
785 |
META_ENGINE_HANDLE_void(FN_ADDSERVERCOMMAND, pfnAddServerCommand, (cmd_name, function)); |
|
darope@0
|
786 |
RETURN_API_void() |
|
darope@0
|
787 |
} |
|
darope@0
|
788 |
|
|
darope@0
|
789 |
// Added in SDK 2.2: |
|
darope@0
|
790 |
|
|
darope@0
|
791 |
//! For voice communications, set which clients hear eachother. |
|
darope@0
|
792 |
//! NOTE: these functions take player entity indices (starting at 1). |
|
darope@0
|
793 |
qboolean mm_Voice_GetClientListening(int iReceiver, int iSender) { |
|
darope@0
|
794 |
META_ENGINE_HANDLE(qboolean, false, FN_VOICE_GETCLIENTLISTENING, pfnVoice_GetClientListening, (iReceiver, iSender)); |
|
darope@0
|
795 |
RETURN_API() |
|
darope@0
|
796 |
} |
|
darope@0
|
797 |
qboolean mm_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen) { |
|
darope@0
|
798 |
META_ENGINE_HANDLE(qboolean, false, FN_VOICE_SETCLIENTLISTENING, pfnVoice_SetClientListening, (iReceiver, iSender, bListen)); |
|
darope@0
|
799 |
RETURN_API() |
|
darope@0
|
800 |
} |
|
darope@0
|
801 |
|
|
darope@0
|
802 |
// Added for HL 1109 (no SDK update): |
|
darope@0
|
803 |
|
|
darope@0
|
804 |
const char *mm_GetPlayerAuthId(edict_t *e) { |
|
darope@0
|
805 |
META_ENGINE_HANDLE(const char *, NULL, FN_GETPLAYERAUTHID, pfnGetPlayerAuthId, (e)); |
|
darope@0
|
806 |
RETURN_API() |
|
darope@0
|
807 |
} |
|
darope@0
|
808 |
|
|
darope@249
|
809 |
// Added 2003-11-10 (no SDK update): |
|
darope@0
|
810 |
|
|
darope@236
|
811 |
sequenceEntry_s *mm_SequenceGet(const char *fileName, const char *entryName) { |
|
darope@236
|
812 |
META_ENGINE_HANDLE(sequenceEntry_s *, NULL, FN_SEQUENCEGET, pfnSequenceGet, (fileName, entryName)); |
|
darope@0
|
813 |
RETURN_API() |
|
darope@0
|
814 |
} |
|
darope@0
|
815 |
|
|
darope@236
|
816 |
sentenceEntry_s *mm_SequencePickSentence(const char *groupName, int pickMethod, int *picked) { |
|
darope@236
|
817 |
META_ENGINE_HANDLE(sentenceEntry_s *, NULL, FN_SEQUENCEPICKSENTENCE, pfnSequencePickSentence, (groupName, pickMethod, picked)); |
|
darope@0
|
818 |
RETURN_API() |
|
darope@0
|
819 |
} |
|
darope@0
|
820 |
|
|
ds@265
|
821 |
int mm_GetFileSize(const char *filename) { |
|
darope@0
|
822 |
META_ENGINE_HANDLE(int, 0, FN_GETFILESIZE, pfnGetFileSize, (filename)); |
|
darope@0
|
823 |
RETURN_API() |
|
darope@0
|
824 |
} |
|
darope@0
|
825 |
|
|
darope@0
|
826 |
unsigned int mm_GetApproxWavePlayLen(const char *filepath) { |
|
darope@0
|
827 |
META_ENGINE_HANDLE(unsigned int, 0, FN_GETAPPROXWAVEPLAYLEN, pfnGetApproxWavePlayLen, (filepath)); |
|
darope@0
|
828 |
RETURN_API() |
|
darope@0
|
829 |
} |
|
darope@0
|
830 |
|
|
darope@0
|
831 |
int mm_IsCareerMatch(void) { |
|
darope@0
|
832 |
META_ENGINE_HANDLE(int, 0, FN_ISCAREERMATCH, pfnIsCareerMatch, ()); |
|
darope@0
|
833 |
RETURN_API() |
|
darope@0
|
834 |
} |
|
darope@0
|
835 |
|
|
darope@0
|
836 |
int mm_GetLocalizedStringLength(const char *label) { |
|
darope@0
|
837 |
META_ENGINE_HANDLE(int, 0, FN_GETLOCALIZEDSTRINGLENGTH, pfnGetLocalizedStringLength, (label)); |
|
darope@0
|
838 |
RETURN_API() |
|
darope@0
|
839 |
} |
|
darope@0
|
840 |
|
|
darope@0
|
841 |
void mm_RegisterTutorMessageShown(int mid) { |
|
darope@0
|
842 |
META_ENGINE_HANDLE_void(FN_REGISTERTUTORMESSAGESHOWN, pfnRegisterTutorMessageShown, (mid)); |
|
darope@0
|
843 |
RETURN_API_void() |
|
darope@0
|
844 |
} |
|
darope@0
|
845 |
|
|
darope@0
|
846 |
int mm_GetTimesTutorMessageShown(int mid) { |
|
darope@0
|
847 |
META_ENGINE_HANDLE(int, 0, FN_GETTIMESTUTORMESSAGESHOWN, pfnGetTimesTutorMessageShown, (mid)); |
|
darope@0
|
848 |
RETURN_API() |
|
darope@0
|
849 |
} |
|
darope@0
|
850 |
|
|
darope@0
|
851 |
void mm_ProcessTutorMessageDecayBuffer(int *buffer, int bufferLength) { |
|
darope@0
|
852 |
META_ENGINE_HANDLE_void(FN_PROCESSTUTORMESSAGEDECAYBUFFER, pfnProcessTutorMessageDecayBuffer, (buffer, bufferLength)); |
|
darope@0
|
853 |
RETURN_API_void() |
|
darope@0
|
854 |
} |
|
darope@0
|
855 |
|
|
darope@0
|
856 |
void mm_ConstructTutorMessageDecayBuffer(int *buffer, int bufferLength) { |
|
darope@0
|
857 |
META_ENGINE_HANDLE_void(FN_CONSTRUCTTUTORMESSAGEDECAYBUFFER, pfnConstructTutorMessageDecayBuffer, (buffer, bufferLength)); |
|
darope@0
|
858 |
RETURN_API_void() |
|
darope@0
|
859 |
} |
|
darope@0
|
860 |
|
|
darope@0
|
861 |
void mm_ResetTutorMessageDecayData(void) { |
|
darope@0
|
862 |
META_ENGINE_HANDLE_void(FN_RESETTUTORMESSAGEDECAYDATA, pfnResetTutorMessageDecayData, ()); |
|
darope@0
|
863 |
RETURN_API_void() |
|
darope@0
|
864 |
} |
|
darope@0
|
865 |
|
|
darope@249
|
866 |
//Added 2005-08-11 (no SDK update) |
|
darope@248
|
867 |
void mm_QueryClientCvarValue(const edict_t *pEdict, const char *cvarName) |
|
darope@248
|
868 |
{ |
|
darope@248
|
869 |
g_Players.set_player_cvar_query(pEdict, cvarName); |
|
darope@248
|
870 |
|
|
darope@248
|
871 |
META_ENGINE_HANDLE_void(FN_QUERYCLIENTCVARVALUE, pfnQueryClientCvarValue, (pEdict, cvarName)); |
|
darope@248
|
872 |
RETURN_API_void(); |
|
darope@248
|
873 |
} |
|
darope@0
|
874 |
|
|
darope@249
|
875 |
//Added 2005-11-22 (no SDK update) |
|
darope@249
|
876 |
void mm_QueryClientCvarValue2(const edict_t *pEdict, const char *cvarName, int requestId) |
|
darope@249
|
877 |
{ |
|
darope@249
|
878 |
META_ENGINE_HANDLE_void(FN_QUERYCLIENTCVARVALUE2, pfnQueryClientCvarValue2, (pEdict, cvarName, requestId)); |
|
darope@249
|
879 |
RETURN_API_void(); |
|
darope@249
|
880 |
} |
|
darope@249
|
881 |
|
|
ds@274
|
882 |
//Added 2009-06-17 (no SDK update) |
|
ds@277
|
883 |
int mm_CheckParm(const char *pchCmdLineToken, char **ppnext) |
|
ds@274
|
884 |
{ |
|
ds@277
|
885 |
META_ENGINE_HANDLE(int, 0, FN_CHECKPARM, pfnCheckParm, (pchCmdLineToken, ppnext)); |
|
ds@274
|
886 |
RETURN_API(); |
|
ds@274
|
887 |
} |
|
ds@274
|
888 |
|
|
darope@250
|
889 |
meta_enginefuncs_t meta_engfuncs( |
|
darope@250
|
890 |
&mm_PrecacheModel, // pfnPrecacheModel() |
|
darope@250
|
891 |
&mm_PrecacheSound, // pfnPrecacheSound() |
|
darope@250
|
892 |
&mm_SetModel, // pfnSetModel() |
|
darope@250
|
893 |
&mm_ModelIndex, // pfnModelIndex() |
|
darope@250
|
894 |
&mm_ModelFrames, // pfnModelFrames() |
|
darope@0
|
895 |
|
|
darope@250
|
896 |
&mm_SetSize, // pfnSetSize() |
|
darope@250
|
897 |
&mm_ChangeLevel, // pfnChangeLevel() |
|
darope@250
|
898 |
&mm_GetSpawnParms, // pfnGetSpawnParms() |
|
darope@250
|
899 |
&mm_SaveSpawnParms, // pfnSaveSpawnParms() |
|
darope@0
|
900 |
|
|
darope@250
|
901 |
&mm_VecToYaw, // pfnVecToYaw() |
|
darope@250
|
902 |
&mm_VecToAngles, // pfnVecToAngles() |
|
darope@250
|
903 |
&mm_MoveToOrigin, // pfnMoveToOrigin() |
|
darope@250
|
904 |
&mm_ChangeYaw, // pfnChangeYaw() |
|
darope@250
|
905 |
&mm_ChangePitch, // pfnChangePitch() |
|
darope@0
|
906 |
|
|
darope@250
|
907 |
&mm_FindEntityByString, // pfnFindEntityByString() |
|
darope@250
|
908 |
&mm_GetEntityIllum, // pfnGetEntityIllum() |
|
darope@250
|
909 |
&mm_FindEntityInSphere, // pfnFindEntityInSphere() |
|
darope@250
|
910 |
&mm_FindClientInPVS, // pfnFindClientInPVS() |
|
darope@250
|
911 |
&mm_EntitiesInPVS, // pfnEntitiesInPVS() |
|
darope@0
|
912 |
|
|
darope@250
|
913 |
&mm_MakeVectors, // pfnMakeVectors() |
|
darope@250
|
914 |
&mm_AngleVectors, // pfnAngleVectors() |
|
darope@0
|
915 |
|
|
darope@250
|
916 |
&mm_CreateEntity, // pfnCreateEntity() |
|
darope@250
|
917 |
&mm_RemoveEntity, // pfnRemoveEntity() |
|
darope@250
|
918 |
&mm_CreateNamedEntity, // pfnCreateNamedEntity() |
|
darope@0
|
919 |
|
|
darope@250
|
920 |
&mm_MakeStatic, // pfnMakeStatic() |
|
darope@250
|
921 |
&mm_EntIsOnFloor, // pfnEntIsOnFloor() |
|
darope@250
|
922 |
&mm_DropToFloor, // pfnDropToFloor() |
|
darope@0
|
923 |
|
|
darope@250
|
924 |
&mm_WalkMove, // pfnWalkMove() |
|
darope@250
|
925 |
&mm_SetOrigin, // pfnSetOrigin() |
|
darope@0
|
926 |
|
|
darope@250
|
927 |
&mm_EmitSound, // pfnEmitSound() |
|
darope@250
|
928 |
&mm_EmitAmbientSound, // pfnEmitAmbientSound() |
|
darope@0
|
929 |
|
|
darope@250
|
930 |
&mm_TraceLine, // pfnTraceLine() |
|
darope@250
|
931 |
&mm_TraceToss, // pfnTraceToss() |
|
darope@250
|
932 |
&mm_TraceMonsterHull, // pfnTraceMonsterHull() |
|
darope@250
|
933 |
&mm_TraceHull, // pfnTraceHull() |
|
darope@250
|
934 |
&mm_TraceModel, // pfnTraceModel() |
|
darope@250
|
935 |
&mm_TraceTexture, // pfnTraceTexture() |
|
darope@250
|
936 |
&mm_TraceSphere, // pfnTraceSphere() |
|
darope@250
|
937 |
&mm_GetAimVector, // pfnGetAimVector() |
|
darope@0
|
938 |
|
|
darope@250
|
939 |
&mm_ServerCommand, // pfnServerCommand() |
|
darope@250
|
940 |
&mm_ServerExecute, // pfnServerExecute() |
|
darope@250
|
941 |
&mm_engClientCommand, // pfnClientCommand() // D'oh, ClientCommand in dllapi too. |
|
darope@0
|
942 |
|
|
darope@250
|
943 |
&mm_ParticleEffect, // pfnParticleEffect() |
|
darope@250
|
944 |
&mm_LightStyle, // pfnLightStyle() |
|
darope@250
|
945 |
&mm_DecalIndex, // pfnDecalIndex() |
|
darope@250
|
946 |
&mm_PointContents, // pfnPointContents() |
|
darope@0
|
947 |
|
|
darope@250
|
948 |
&mm_MessageBegin, // pfnMessageBegin() |
|
darope@250
|
949 |
&mm_MessageEnd, // pfnMessageEnd() |
|
darope@0
|
950 |
|
|
darope@250
|
951 |
&mm_WriteByte, // pfnWriteByte() |
|
darope@250
|
952 |
&mm_WriteChar, // pfnWriteChar() |
|
darope@250
|
953 |
&mm_WriteShort, // pfnWriteShort() |
|
darope@250
|
954 |
&mm_WriteLong, // pfnWriteLong() |
|
darope@250
|
955 |
&mm_WriteAngle, // pfnWriteAngle() |
|
darope@250
|
956 |
&mm_WriteCoord, // pfnWriteCoord() |
|
darope@250
|
957 |
&mm_WriteString, // pfnWriteString() |
|
darope@250
|
958 |
&mm_WriteEntity, // pfnWriteEntity() |
|
darope@0
|
959 |
|
|
darope@250
|
960 |
&mm_CVarRegister, // pfnCVarRegister() |
|
darope@250
|
961 |
&mm_CVarGetFloat, // pfnCVarGetFloat() |
|
darope@250
|
962 |
&mm_CVarGetString, // pfnCVarGetString() |
|
darope@250
|
963 |
&mm_CVarSetFloat, // pfnCVarSetFloat() |
|
darope@250
|
964 |
&mm_CVarSetString, // pfnCVarSetString() |
|
darope@0
|
965 |
|
|
darope@250
|
966 |
&mm_AlertMessage, // pfnAlertMessage() |
|
darope@250
|
967 |
&mm_EngineFprintf, // pfnEngineFprintf() |
|
darope@0
|
968 |
|
|
darope@250
|
969 |
&mm_PvAllocEntPrivateData, // pfnPvAllocEntPrivateData() |
|
darope@250
|
970 |
&mm_PvEntPrivateData, // pfnPvEntPrivateData() |
|
darope@250
|
971 |
&mm_FreeEntPrivateData, // pfnFreeEntPrivateData() |
|
darope@0
|
972 |
|
|
darope@250
|
973 |
&mm_SzFromIndex, // pfnSzFromIndex() |
|
darope@250
|
974 |
&mm_AllocString, // pfnAllocString() |
|
darope@0
|
975 |
|
|
darope@250
|
976 |
&mm_GetVarsOfEnt, // pfnGetVarsOfEnt() |
|
darope@250
|
977 |
&mm_PEntityOfEntOffset, // pfnPEntityOfEntOffset() |
|
darope@250
|
978 |
&mm_EntOffsetOfPEntity, // pfnEntOffsetOfPEntity() |
|
darope@250
|
979 |
&mm_IndexOfEdict, // pfnIndexOfEdict() |
|
darope@250
|
980 |
&mm_PEntityOfEntIndex, // pfnPEntityOfEntIndex() |
|
darope@250
|
981 |
&mm_FindEntityByVars, // pfnFindEntityByVars() |
|
darope@250
|
982 |
&mm_GetModelPtr, // pfnGetModelPtr() |
|
darope@0
|
983 |
|
|
darope@250
|
984 |
&mm_RegUserMsg, // pfnRegUserMsg() |
|
darope@0
|
985 |
|
|
darope@250
|
986 |
&mm_AnimationAutomove, // pfnAnimationAutomove() |
|
darope@250
|
987 |
&mm_GetBonePosition, // pfnGetBonePosition() |
|
darope@0
|
988 |
|
|
darope@250
|
989 |
&mm_FunctionFromName, // pfnFunctionFromName() |
|
darope@250
|
990 |
&mm_NameForFunction, // pfnNameForFunction() |
|
darope@0
|
991 |
|
|
darope@250
|
992 |
&mm_ClientPrintf, // pfnClientPrintf() //! JOHN: engine callbacks so game DLL can print messages to individual clients |
|
darope@250
|
993 |
&mm_ServerPrint, // pfnServerPrint() |
|
darope@0
|
994 |
|
|
darope@250
|
995 |
&mm_Cmd_Args, // pfnCmd_Args() //! these 3 added |
|
darope@250
|
996 |
&mm_Cmd_Argv, // pfnCmd_Argv() //! so game DLL can easily |
|
darope@250
|
997 |
&mm_Cmd_Argc, // pfnCmd_Argc() //! access client 'cmd' strings |
|
darope@0
|
998 |
|
|
darope@250
|
999 |
&mm_GetAttachment, // pfnGetAttachment() |
|
darope@0
|
1000 |
|
|
darope@250
|
1001 |
&mm_CRC32_Init, // pfnCRC32_Init() |
|
darope@250
|
1002 |
&mm_CRC32_ProcessBuffer, // pfnCRC32_ProcessBuffer() |
|
darope@250
|
1003 |
&mm_CRC32_ProcessByte, // pfnCRC32_ProcessByte() |
|
darope@250
|
1004 |
&mm_CRC32_Final, // pfnCRC32_Final() |
|
darope@0
|
1005 |
|
|
darope@250
|
1006 |
&mm_RandomLong, // pfnRandomLong() |
|
darope@250
|
1007 |
&mm_RandomFloat, // pfnRandomFloat() |
|
darope@0
|
1008 |
|
|
darope@250
|
1009 |
&mm_SetView, // pfnSetView() |
|
darope@250
|
1010 |
&mm_Time, // pfnTime() |
|
darope@250
|
1011 |
&mm_CrosshairAngle, // pfnCrosshairAngle() |
|
darope@0
|
1012 |
|
|
darope@250
|
1013 |
&mm_LoadFileForMe, // pfnLoadFileForMe() |
|
darope@250
|
1014 |
&mm_FreeFile, // pfnFreeFile() |
|
darope@0
|
1015 |
|
|
darope@250
|
1016 |
&mm_EndSection, // pfnEndSection() //! trigger_endsection |
|
darope@250
|
1017 |
&mm_CompareFileTime, // pfnCompareFileTime() |
|
darope@250
|
1018 |
&mm_GetGameDir, // pfnGetGameDir() |
|
darope@250
|
1019 |
&mm_Cvar_RegisterVariable, // pfnCvar_RegisterVariable() |
|
darope@250
|
1020 |
&mm_FadeClientVolume, // pfnFadeClientVolume() |
|
darope@250
|
1021 |
&mm_SetClientMaxspeed, // pfnSetClientMaxspeed() |
|
darope@250
|
1022 |
&mm_CreateFakeClient, // pfnCreateFakeClient() //! returns NULL if fake client can't be created |
|
darope@250
|
1023 |
&mm_RunPlayerMove, // pfnRunPlayerMove() |
|
darope@250
|
1024 |
&mm_NumberOfEntities, // pfnNumberOfEntities() |
|
darope@0
|
1025 |
|
|
darope@250
|
1026 |
&mm_GetInfoKeyBuffer, // pfnGetInfoKeyBuffer() //! passing in NULL gets the serverinfo |
|
darope@250
|
1027 |
&mm_InfoKeyValue, // pfnInfoKeyValue() |
|
darope@250
|
1028 |
&mm_SetKeyValue, // pfnSetKeyValue() |
|
darope@250
|
1029 |
&mm_SetClientKeyValue, // pfnSetClientKeyValue() |
|
darope@0
|
1030 |
|
|
darope@250
|
1031 |
&mm_IsMapValid, // pfnIsMapValid() |
|
darope@250
|
1032 |
&mm_StaticDecal, // pfnStaticDecal() |
|
darope@250
|
1033 |
&mm_PrecacheGeneric, // pfnPrecacheGeneric() |
|
darope@250
|
1034 |
&mm_GetPlayerUserId, // pfnGetPlayerUserId() //! returns the server assigned userid for this player. |
|
darope@250
|
1035 |
&mm_BuildSoundMsg, // pfnBuildSoundMsg() |
|
darope@250
|
1036 |
&mm_IsDedicatedServer, // pfnIsDedicatedServer() //! is this a dedicated server? |
|
darope@250
|
1037 |
&mm_CVarGetPointer, // pfnCVarGetPointer() |
|
darope@250
|
1038 |
&mm_GetPlayerWONId, // pfnGetPlayerWONId() //! returns the server assigned WONid for this player. |
|
darope@0
|
1039 |
|
|
darope@0
|
1040 |
//! YWB 8/1/99 TFF Physics additions |
|
darope@250
|
1041 |
&mm_Info_RemoveKey, // pfnInfo_RemoveKey() |
|
darope@250
|
1042 |
&mm_GetPhysicsKeyValue, // pfnGetPhysicsKeyValue() |
|
darope@250
|
1043 |
&mm_SetPhysicsKeyValue, // pfnSetPhysicsKeyValue() |
|
darope@250
|
1044 |
&mm_GetPhysicsInfoString, // pfnGetPhysicsInfoString() |
|
darope@250
|
1045 |
&mm_PrecacheEvent, // pfnPrecacheEvent() |
|
darope@250
|
1046 |
&mm_PlaybackEvent, // pfnPlaybackEvent() |
|
darope@0
|
1047 |
|
|
darope@250
|
1048 |
&mm_SetFatPVS, // pfnSetFatPVS() |
|
darope@250
|
1049 |
&mm_SetFatPAS, // pfnSetFatPAS() |
|
darope@0
|
1050 |
|
|
darope@250
|
1051 |
&mm_CheckVisibility, // pfnCheckVisibility() |
|
darope@0
|
1052 |
|
|
darope@250
|
1053 |
&mm_DeltaSetField, // pfnDeltaSetField() |
|
darope@250
|
1054 |
&mm_DeltaUnsetField, // pfnDeltaUnsetField() |
|
darope@250
|
1055 |
&mm_DeltaAddEncoder, // pfnDeltaAddEncoder() |
|
darope@250
|
1056 |
&mm_GetCurrentPlayer, // pfnGetCurrentPlayer() |
|
darope@250
|
1057 |
&mm_CanSkipPlayer, // pfnCanSkipPlayer() |
|
darope@250
|
1058 |
&mm_DeltaFindField, // pfnDeltaFindField() |
|
darope@250
|
1059 |
&mm_DeltaSetFieldByIndex, // pfnDeltaSetFieldByIndex() |
|
darope@250
|
1060 |
&mm_DeltaUnsetFieldByIndex, // pfnDeltaUnsetFieldByIndex() |
|
darope@0
|
1061 |
|
|
darope@250
|
1062 |
&mm_SetGroupMask, // pfnSetGroupMask() |
|
darope@0
|
1063 |
|
|
darope@250
|
1064 |
&mm_engCreateInstancedBaseline, // pfnCreateInstancedBaseline() // D'oh, CreateInstancedBaseline in dllapi too. |
|
darope@250
|
1065 |
&mm_Cvar_DirectSet, // pfnCvar_DirectSet() |
|
darope@0
|
1066 |
|
|
darope@250
|
1067 |
&mm_ForceUnmodified, // pfnForceUnmodified() |
|
darope@0
|
1068 |
|
|
darope@250
|
1069 |
&mm_GetPlayerStats, // pfnGetPlayerStats() |
|
darope@0
|
1070 |
|
|
darope@250
|
1071 |
&mm_AddServerCommand, // pfnAddServerCommand() |
|
darope@0
|
1072 |
|
|
darope@0
|
1073 |
// Added in SDK 2l2: |
|
darope@250
|
1074 |
&mm_Voice_GetClientListening, // pfnVoice_GetClientListening() |
|
darope@250
|
1075 |
&mm_Voice_SetClientListening, // pfnVoice_SetClientListening() |
|
darope@0
|
1076 |
|
|
darope@0
|
1077 |
// Added for HL 1109 (no SDK update): |
|
darope@250
|
1078 |
&mm_GetPlayerAuthId, // pfnGetPlayerAuthId() |
|
darope@0
|
1079 |
|
|
darope@249
|
1080 |
// Added 2003-11-10 (no SDK update): |
|
darope@250
|
1081 |
&mm_SequenceGet, // pfnSequenceGet() |
|
darope@250
|
1082 |
&mm_SequencePickSentence, // pfnSequencePickSentence() |
|
darope@250
|
1083 |
&mm_GetFileSize, // pfnGetFileSize() |
|
darope@250
|
1084 |
&mm_GetApproxWavePlayLen, // pfnGetApproxWavePlayLen() |
|
darope@250
|
1085 |
&mm_IsCareerMatch, // pfnIsCareerMatch() |
|
darope@250
|
1086 |
&mm_GetLocalizedStringLength, // pfnGetLocalizedStringLength() |
|
darope@250
|
1087 |
&mm_RegisterTutorMessageShown, // pfnRegisterTutorMessageShown() |
|
darope@250
|
1088 |
&mm_GetTimesTutorMessageShown, // pfnGetTimesTutorMessageShown() |
|
darope@250
|
1089 |
&mm_ProcessTutorMessageDecayBuffer, // pfnProcessTutorMessageDecayBuffer() |
|
darope@250
|
1090 |
&mm_ConstructTutorMessageDecayBuffer, // pfnConstructTutorMessageDecayBuffer() |
|
darope@250
|
1091 |
&mm_ResetTutorMessageDecayData, // pfnResetTutorMessageDecayData() |
|
darope@248
|
1092 |
|
|
darope@249
|
1093 |
//Added 2005-08-11 (no SDK update) |
|
darope@250
|
1094 |
&mm_QueryClientCvarValue, // pfnQueryClientCvarValue() |
|
darope@249
|
1095 |
|
|
darope@249
|
1096 |
//Added 2005-11-22 (no SDK update) |
|
ds@274
|
1097 |
&mm_QueryClientCvarValue2, // pfnQueryClientCvarValue2() |
|
ds@274
|
1098 |
|
|
ds@274
|
1099 |
// Added 2009-06-17 (no SDK update) |
|
ds@277
|
1100 |
&mm_CheckParm // pfnCheckParm() |
|
darope@250
|
1101 |
); |
|
darope@248
|
1102 |
|
|
darope@248
|
1103 |
|