Debian Codegraph @

netgames/dmfc/dmfcfunctions.cpp

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/Main/Dmfc/dmfcfunctions.cpp $
21 * $Revision: 1.1.1.1 $
22 * $Date: 2003/08/26 03:57:20 $
23 * $Author: kevinb $
24 *
25 * Function pointers
26 *
27 * $Log: dmfcfunctions.cpp,v $
28 * Revision 1.1.1.1 2003/08/26 03:57:20 kevinb
29 * initial 1.5 import
30 *
31 *
32 * 26 8/16/99 5:38p Jeff
33 * final updates for patch
34 *
35 * 25 8/15/99 4:36p Jeff
36 * finished exporting all inventory class functions. export object_info
37 * array. added check for -nooutragelogo to display Outrage logo display.
38 *
39 * 24 8/11/99 5:31p Jeff
40 * addon tablefile function returns a bool now
41 *
42 * 23 8/11/99 1:22p Jeff
43 * exported needed functions for camera windows
44 *
45 * 22 7/20/99 11:27a Jeff
46 * created functions to fire weapons
47 *
48 * 21 7/11/99 3:31p Jeff
49 * exported game arguments, made command line option to specify
50 * autoexec.dmfc
51 *
52 * 20 7/07/99 12:16p Jeff
53 * all mangles symbol names fixed. Finished making interface functions.
54 *
55 * 19 5/20/99 5:31p Jeff
56 * exported PlayerStopSounds
57 *
58 * 18 5/19/99 11:49p Jeff
59 * final preparations for dmfc version 1.0
60 *
61 * 17 5/19/99 5:27p Jeff
62 * fixed some function prototypes
63 *
64 * 16 5/19/99 2:44a Jeff
65 * CreateTextItem has a third parameter
66 *
67 * 15 5/03/99 8:39a Jeff
68 * tons of Entropy fixes
69 *
70 * 14 4/30/99 7:36p Jeff
71 * exported vis_effects to dmfc
72 *
73 * 13 3/27/99 4:53p Jeff
74 * player rankings in multiplayer games implemented. Fixed join message
75 * so it doesn't get cut off
76 *
77 * 12 3/22/99 6:20p Jeff
78 * added 2 more audio taunts. a mulitplayer event when someone plays an
79 * audio taunt. option to disable audio taunts.
80 *
81 * 11 3/17/99 12:23p Jeff
82 * converted DMFC to be COM interface
83 *
84 * 10 3/12/99 7:40p Jeff
85 * removed enhanced objcreate, added enhanced objsetpos
86 *
87 * 9 3/11/99 6:30p Jeff
88 * numerous fixes to demo system in multiplayer games (when
89 * recording/playback a demo in a multiplayer game)
90 *
91 * 8 3/05/99 1:29p Jeff
92 *
93 * 7 2/25/99 8:54p Jeff
94 * Inventory supports level change persistant items. Inventory supports
95 * time-out objects. Inventory Reset changed (takes a level of reset
96 * now). Quad lasers stay across level change (single player). Guidebot
97 * bug fixed (now back in ship on level start). Quads time out when
98 * spewed. Invulnerability and cloak powerups no longer use game
99 * event/callbacks, so they can be saved in game saves (moved to
100 * MakePlayerInvulnerable and MakeObjectInvisible)
101 *
102 * 6 2/10/99 11:36p Jeff
103 * exported renderer and fvi functions
104 *
105 * 5 2/08/99 5:22p Jeff
106 * exported rend_SetZBuffer...fixed up small view of stats
107 *
108 * 4 2/08/99 12:06a Jeff
109 * exported some new functions and variables
110 *
111 * 3 2/06/99 6:59p Jeff
112 * created RenderHUDGetTextLineWidth and RenderHUDGetTextHeight
113 *
114 * 2 2/03/99 4:09p Jeff
115 * moved function pointers to seperate file. created autoexec.dmfc
116 *
117 * $NoKeywords: $
118 */
119
120 #include <filesystem>
121
122 #include "DMFC.h"
123 #include "dmfcinternal.h"
124 #include "dmfcinputcommands.h"
125 #include "gamedll_header.h"
126
127 void (*DLLGetGameAPI)(game_api *);
128 bool (*DLLAddHUDMessage)(const char *format, ...);
129 void (*DLLDebug_ConsolePrintf)(int n, const char *format, ...);
130 void (*DLLMultiSendClientExecuteDLL)(int eventnum, int me_objnum, int it_objnum, int to, dllinfo *info);
131 void (*DLLMultiSendObject)(object *obj, uint8_t announce, uint8_t demo_record);
132 void (*DLLMultiPaintGoalRooms)(int *texcolors);
133 void (*DLLMultiSendSpecialPacket)(int slot, uint8_t *outdata, int size);
134 void (*DLLComputeRoomCenter)(vector *vp, room *rp);
135 int (*DLLGetGoalRoomForTeam)(int teamnum);
136 int (*DLLObjCreate)(uint8_t type, uint16_t id, int roomnum, vector *pos, const matrix *orient,
137 int parent_handle);
138 int (*DLLFindObjectIDName)(const char *name);
139 void (*DLLObjSetPosNoMark)(object *objp, vector *newpos, int roomnum, matrix *orient,
140 bool f_update_attached_children);
141 void (*DLLObjSetPos)(object *objp, vector *newpos, int roomnum, matrix *orient,
142 bool f_update_attached_children);
143 void (*DLLSetMaxTeams)(int num);
144 int (*DLLIncTeamScore)(int team, int amount);
145 bool (*DLLInvCheckItem)(int pnum, int type, int id);
146 bool (*DLLInvAddTypeID)(int pnum, int type, int id, int aux_type, int aux_id, int flags, const char *description);
147 bool (*DLLInvRemove)(int pnum, int type, int id);
148 void (*DLLPlayerSetLighting)(int slot, float dist, float r, float g, float b);
149 int (*DLLFindShipName)(const char *name);
150 void (*DLLPlayerSetRotatingBall)(int slot, int num, float speed, float *r, float *g, float *b);
151 void (*DLLPlayerChangeShip)(int slot, int ship_index);
152 int (*DLLInvGetTypeIDCount)(int playernum, int type, int id);
153 int (*DLLPlay3dSound)(int sound_index, object *cur_obj, float volume, int flags);
154 int (*DLLFindSoundName)(const char *str);
155 int (*DLLSpewCreate)(spewinfo *spew);
156 void (*DLLSpewClearEvent)(int handle, bool force);
157 int (*DLLbm_AllocLoadFileBitmap)(const char *filename, int mipped, int format);
158 void (*DLLbm_FreeBitmap)(int handle);
159 void (*DLLrend_DrawScaledBitmap)(int x1, int y1, int x2, int y2, int bm, float u0, float v0, float u1,
160 float v1, float zval, int color, float *alphas);
161 void (*DLLgrtext_Printf)(int x, int y, const char *fmt, ...);
162 void (*DLLgrtext_Flush)(void);
163 void (*DLLgrtext_SetColor)(ddgr_color col);
164 void (*DLLgrtext_SetFancyColor)(ddgr_color col1, ddgr_color col2, ddgr_color col3, ddgr_color col4);
165 void (*DLLgrtext_SetAlpha)(uint8_t alpha);
166 uint8_t (*DLLgrtext_GetAlpha)(void);
167 void (*DLLgrtext_SetFont)(int font_handle);
168 int (*DLLgrtext_GetFont)(void);
169 int (*DLLgrtext_GetTextLineWidth)(const char *str);
170 int (*DLLgrfont_GetHeight)(int font);
171 void (*DLLgrtext_CenteredPrintf)(int xoff, int y, const char *fmt, ...);
172 bool (*DLLAddColoredHUDMessage)(ddgr_color color, const char *format, ...);
173 int (*DLLbm_h)(int handle, int miplevel);
174 int (*DLLbm_w)(int handle, int miplevel);
175 void (*DLLrend_DrawSimpleBitmap)(int bm_handle, int x, int y);
176 void (*DLLMultiClientSendSpecialPacket)(uint8_t *outdate, int size);
177 bool (*DLLAddBlinkingHUDMessage)(char *format, ...);
178 void (*DLLInvReset)(int playernum, bool reset_all);
179 void (*DLLAddHUDItem)(tHUDItem *item);
180 void (*DLLRenderHUDQuad)(int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm,
181 uint8_t alpha, int sat_count);
182 void (*DLLRenderHUDText)(ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...);
183 void (*DLLMultiEndLevel)(void);
184 uint16_t *(*DLLbm_data)(int handle, int miplevel);
185 int (*DLLbm_AllocBitmap)(int w, int h, int add_mem);
186 void (*DLLrend_FillRect)(ddgr_color color, int x1, int y1, int x2, int y2);
187 bool (*DLLbm_CreateChunkedBitmap)(int bm_handle, chunked_bitmap *chunk);
188 void (*DLLbm_DestroyChunkedBitmap)(chunked_bitmap *chunk);
189 void (*DLLrend_DrawChunkedBitmap)(chunked_bitmap *chunk, int x, int y, uint8_t alpha);
190 void (*DLLrend_DrawScaledChunkedBitmap)(chunked_bitmap *chunk, int x, int y, int neww, int newh,
191 uint8_t alpha);
192 void (*DLLOpenCFILE)(CFILE **handle, const std::filesystem::path &filename, const char *mode);
193 void (*DLLcfclose)(CFILE *cfp);
194 int (*DLLcfeof)(CFILE *cfp);
195 int (*DLLcfexist)(const std::filesystem::path &filename);
196 int (*DLLcf_ReadBytes)(uint8_t *buf, int count, CFILE *cfp);
197 int (*DLLcf_ReadInt)(CFILE *cfp);
198 int16_t (*DLLcf_ReadShort)(CFILE *cfp);
199 int8_t (*DLLcf_ReadByte)(CFILE *cfp);
200 float (*DLLcf_ReadFloat)(CFILE *cfp);
201 double (*DLLcf_ReadDouble)(CFILE *cfp);
202 int (*DLLcf_ReadString)(char *buf, size_t n, CFILE *cfp);
203 int (*DLLcf_WriteBytes)(const uint8_t *buf, int count, CFILE *cfp);
204 int (*DLLcf_WriteString)(CFILE *cfp, const char *buf);
205 void (*DLLcf_WriteInt)(CFILE *cfp, int i);
206 void (*DLLcf_WriteShort)(CFILE *cfp, int16_t s);
207 void (*DLLcf_WriteByte)(CFILE *cfp, int8_t b);
208 void (*DLLcf_WriteFloat)(CFILE *cfp, float f);
209 void (*DLLcf_WriteDouble)(CFILE *cfp, double d);
210 bool (*DLLcf_CopyFile)(char *dest, const char *src);
211 bool (*DLLcf_Diff)(const char *a, const char *b);
212 void (*DLLMultiDisconnectPlayer)(int slot);
213 void (*DLLnw_GetNumbersFromHostAddress)(network_address *address, char *str);
214 int (*DLLnw_GetThisIP)(void);
215 bool (*DLLCreateStringTable)(const char *filename, char ***table, int *size);
216 void (*DLLDestroyStringTable)(char **table, int size);
217 void (*DLLRenderHUDTextFlags)(int flags, ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...);
218 void (*DLLPlayerSetHUDNameFOV)(int fov);
219 void (*DLLGetUltimateParentForObject)(object **parent, object *child);
220 void (*DLLSetObjectDeadFlagRaw)(object *obj, bool tell_clients_to_remove, bool tell_clients_to_play_sound);
221 void (*DLLSetObjectDeadFlag)(object *obj, bool tell_clients_to_remove, bool tell_clients_to_play_sound);
222 void (*FatalError)(const char *reason);
223 int (*DLLMultiMatchWeapon)(uint32_t unique_id);
224 uint32_t (*DLLMultiGetMatchChecksum)(int type, int id);
225 int (*DLLFindWeaponName)(const char *name);
226 int (*DLLcf_OpenLibrary)(const std::filesystem::path &libname);
227 void (*DLLcf_CloseLibrary)(int handle);
228 void (*DLLMultiSendRequestToObserve)(int mode, int on, int objnum);
229 int (*DLLFindTextureName)(const char *name);
230 bool (*DLLApplyDamageToPlayer)(object *playerobj, object *killer, int damage_type, float damage_amount,
231 int server_says, int weapon_id, bool playsound);
232 int (*DLLMultiMatchGeneric)(uint32_t unique_id);
233 void (*DLLSetUITextItemText)(void *uit, char *newtext, uint32_t color);
234 void *(*DLLNewUIWindowCreate)(int x, int y, int w, int h, int flags);
235 void (*DLLNewUIWindowDestroy)(void *deswin);
236 void (*DLLNewUIWindowOpen)(void *deswin);
237 void (*DLLNewUIWindowClose)(void *deswin);
238 void *(*DLLTextCreate)(void *parentwin, void *textitem, int x, int y, int flags);
239 void *(*DLLEditCreate)(void *parentwin, int id, int x, int y, int w, int h, int flags);
240 void *(*DLLButtonCreate)(void *parentwin, int id, void *titleitem, int x, int y, int w, int h, int flags);
241 void *(*DLLListCreate)(void *parentwin, int id, int x, int y, int w, int h, int flags);
242 void (*DLLListRemoveAll)(void *item);
243 void (*DLLListAddItem)(void *item, void *uitext);
244 void (*DLLListRemoveItem)(void *item, void *txtitem);
245 void (*DLLListSelectItem)(void *item, void *txtitem);
246 char *(*DLLListGetItem)(void *item, int index);
247 int (*DLLListGetSelectedIndex)(void *item);
248 void (*DLLListSetSelectedIndex)(void *item, int index);
249 void (*DLLEditSetText)(void *item, const char *buff);
250 void (*DLLEditGetText)(void *item, char *buff, int len);
251 int (*DLLDoUI)(void);
252 int (*DLLDoMessageBox)(const char *title, const char *msg, int type, ddgr_color title_color,
253 ddgr_color text_color);
254 void (*DLLDescentDefer)(void);
255 void *(*DLLNewUIGameWindowCreate)(int x, int y, int w, int h, int flags);
256 void (*DLLNewUIGameWindowDestroy)(void *item);
257 void (*DLLNewUIGameWindowOpen)(void *item);
258 void (*DLLNewUIGameWindowClose)(void *item);
259 void *(*DLLHotSpotCreate)(void *parentwin, int id, int key, void *txtitemoff, void *txtitemon, int x,
260 int y, int w, int h, int flags);
261 int (*DLLPollUI)(void);
262 void (*DLLRemoveUITextItem)(void *item);
263 void *(*DLLCreateNewUITextItem)(const char *newtext, uint32_t color, int font);
264 void (*DLLRemoveUIBmpItem)(void *item);
265 void *(*DLLCreateNewUIBmpItem)(int handle, uint8_t alpha);
266 void *(*DLLUIConsoleGadgetCreate)(void *parentid, int id, int x, int y, int font, int cols, int rows,
267 int flags);
268 void (*DLLUIConsoleGadgetputs)(void *item, const char *str);
269 void (*DLLNewUIWindowSetFocusOnEditGadget)(void *item, void *parent);
270 void *(*DLLOldListCreate)(void *parentitem, int id, int x, int y, int w, int h, int flags);
271 void (*DLLOldListRemoveAll)(void *item);
272 void (*DLLOldListAddItem)(void *item, void *uitext);
273 void (*DLLOldListRemoveItem)(void *item, void *txtitem);
274 void (*DLLOldListSelectItem)(void *item, void *txtitem);
275 void *(*DLLOldEditCreate)(void *parentitem, int id, int x, int y, int w, int h, int flags);
276 void (*DLLOldEditGetText)(void *item, char *buff, int len);
277 void (*DLLOldEditSetText)(void *item, const char *newtext);
278 char *(*DLLOldListGetItem)(void *item, int index);
279 int (*DLLOldListGetSelectedIndex)(void *item);
280 void (*DLLToggleUICallback)(int state);
281 void (*DLLSetOldEditBufferLen)(void *item, int len);
282 void (*DLLNewUIWindowLoadBackgroundImage)(void *item, const char *image_name);
283 void (*DLLDeleteUIItem)(void *delitem);
284 void (*DLLHotSpotSetStates)(void *hs, void *texton, void *textoff);
285 void (*DLLSetUICallback)(void (*fn)());
286 void (*DLLGetUICallback)(void **fn);
287 void (*DLLSuspendControls)(void);
288 void (*DLLResumeControls)(void);
289 void (*DLLShowCursor)(void);
290 void (*DLLHideCursor)(void);
291 void (*DLLGameFrame)(void);
292 void (*DPrintf)(const char *format, ...);
293 void (*DLLassert)(int, const char *, const char *, int);
294 void (*DLLddio_SplitPath)(const char *srcPath, char *path, char *filename, char *ext);
295 void (*DLLddio_MakePath)(char *newPath, const char *absolutePathHeader, const char *subDir, ...);
296 int (*DLLPlay2dSound)(int sound_index, float volume);
297 void (*DLLTouchSound)(int sound_index);
298 bool (*DatabaseRead1)(const char *label, char *entry, int *entrylen);
299 bool (*DatabaseRead2)(const char *label, void *entry, int wordsize);
300 bool (*DatabaseRead3)(const char *label, bool *entry);
301 bool (*DatabaseWrite1)(const char *label, const char *entry, int entrylen);
302 bool (*DatabaseWrite2)(const char *label, int entry);
303 bool (*DLLAttachObject)(object *parent, char parent_ap, object *child, char child_ap, bool f_use_aligned);
304 bool (*DLLObjGet)(int handle, object **obj);
305 int (*DLLGetUIItemWidth)(void *item);
306 int (*DLLGetUIItemHeight)(void *item);
307 void *(*DLLSliderCreate)(void *parent, int id, int x, int y, int flags);
308 void (*DLLSliderSetRange)(void *slider, int range);
309 int (*DLLSliderGetRange)(void *slider);
310 void (*DLLSliderSetPos)(void *slider, int pos);
311 int (*DLLSliderGetPos)(void *slider);
312 void (*DLLSliderSetSelectChangeCallback)(void *slider, void (*fn)(int));
313 void (*DLLSliderSetSelectChangeCallbackWData)(void *slider, void (*fn)(int, void *), void *ptr);
314 void (*DLLTextSetTitle)(void *text, void *textitem);
315 bool (*DLLPPic_GetPilot)(uint16_t pilot_id, char *pilot_name, int buffersize);
316 int (*DLLPPic_GetBitmapHandle)(uint16_t pilot_id);
317 void (*DLLrend_DrawLine)(int x1, int y1, int x2, int y2);
318 void (*DLLrend_SetFlatColor)(ddgr_color color);
319 void (*DLLMultiSetLogoState)(bool state);
320 void (*DLLPlayerSpewInventory)(object *obj, bool spew_energy_and_shield, bool spew_nonspewable);
321 int (*DLLPlayerGetRandomStartPosition)(int slot);
322 void (*DLLInitPlayerNewShip)(int slot, int inven_reset);
323 void *(*DLLCheckBoxCreate)(void *parent, int id, void *title, int x, int y, int w, int h, int flags);
324 void (*DLLCheckBoxSetCheck)(void *cb, bool state);
325 bool (*DLLCheckBoxIsChecked)(void *cb);
326 uint32_t (*DLLnw_GetHostAddressFromNumbers)(char *str);
327 void (*TableFilesClear)(void);
328 bool (*TableFileAdd)(char *filename);
329 void (*DLLDebugBreak_callback_stop)(void);
330 void (*DLLDebugBreak_callback_resume)(void);
331 void (*DLLInt3MessageBox)(const char *file, const char *line);
332 void (*DLLGetUIItemPosition)(void *item, int *x, int *y, int *w, int *h);
333 bool (*DLLAttachObjectRadius)(object *parent, char parent_ap, object *child, float percent_rad);
334 bool (*DLLUnattachChildren)(object *parent);
335 bool (*DLLUnattachChild)(object *parent, char parent_ap);
336 bool (*DLLUnattachFromParent)(object *child);
337 float (*DLLvm_GetMagnitude)(vector *);
338 void (*DLLvm_MatrixMulVector)(vector *, vector *, matrix *);
339 void (*DLLphys_apply_force)(object *obj, vector *force_vec, int16_t weapon_index);
340 void (*DLLphys_apply_rot)(object *obj, vector *force_vec);
341 void (*DLLvm_TransposeMatrix)(matrix *);
342 void (*DLLvm_CrossProduct)(vector *, vector *, vector *);
343 float (*DLLvm_NormalizeVector)(vector *);
344 void (*DLLConvertEulerToAxisAmount)(vector *e, vector *n, float *w);
345 void (*DLLConvertAxisAmountToEuler)(vector *n, float *w, vector *e);
346 float (*DLLvm_GetMagnitudeFast)(vector *);
347 void (*DLLvm_MakeIdentity)(matrix *);
348 void (*DLLvm_MakeVectorZero)(vector *v);
349 void (*DLLvm_MakeAngleZero)(angvec *a);
350 void (*DLLvm_VectorMulTMatrix)(vector *result, vector *v, matrix *m);
351 void (*DLLvm_MatrixMul)(matrix *, matrix *, matrix *);
352 void (*DLLvm_MatrixMulTMatrix)(matrix *dest, matrix *src0, matrix *src1);
353 float (*DLLvm_DotProduct)(vector *, vector *);
354 void (*DLLvm_SubVectors)(vector *, const vector *, const vector *);
355 void (*DLLvm_AddVectors)(vector *, vector *, vector *);
356 void (*DLLvm_AverageVector)(vector *, int);
357 void (*DLLvm_ScaleVector)(vector *, vector *, float);
358 void (*DLLvm_ScaleAddVector)(vector *d, vector *p, vector *v, float s);
359 void (*DLLvm_DivVector)(vector *, vector *, float);
360 float (*DLLvm_NormalizeVectorFast)(vector *);
361 void (*DLLvm_ClearMatrix)(matrix *);
362 void (*DLLvm_AnglesToMatrix)(matrix *, angle p, angle h, angle b);
363 void (*DLLvm_Orthogonalize)(matrix *m);
364 void (*DLLvm_VectorToMatrix)(matrix *m, vector *fvec, vector *uvec, vector *rvec);
365 void (*DLLvm_VectorAngleToMatrix)(matrix *m, vector *v, angle a);
366 void (*DLLvm_SinCos)(angle, float *, float *);
367 float (*DLLvm_GetSlope)(float, float, float, float);
368 void (*DLLvm_GetPerp)(vector *n, vector *a, vector *b, vector *c);
369 float (*DLLvm_GetNormal)(vector *n, vector *v0, vector *v1, vector *v2);
370 float (*DLLvm_VectorDistance)(const vector *a, const vector *b);
371 float (*DLLvm_VectorDistanceQuick)(vector *a, vector *b);
372 float (*DLLvm_GetNormalizedDir)(vector *dest, vector *end, vector *start);
373 float (*DLLvm_GetNormalizedDirFast)(vector *dest, vector *end, vector *start);
374 angvec *(*DLLvm_ExtractAnglesFromMatrix)(angvec *a, matrix *m);
375 angle (*DLLvm_DeltaAngVec)(vector *v0, vector *v1, vector *fvec);
376 angle (*DLLvm_DeltaAngVecNorm)(vector *v0, vector *v1, vector *fvec);
377 float (*DLLvm_DistToPlane)(vector *checkp, vector *norm, vector *planep);
378 float (*DLLvm_CalcDetValue)(matrix *det);
379 void (*DLLvm_MakeInverseMatrix)(matrix *dest);
380 void (*DLLvm_SinCosToMatrix)(matrix *m, float sinp, float cosp, float sinb, float cosb, float sinh,
381 float cosh);
382 float (*DLLvm_GetCentroid)(vector *centroid, vector *src, int nv);
383 void (*DLLvm_MakeRandomVector)(vector *vec);
384 float (*DLLvm_ComputeBoundingSphere)(vector *center, vector *vecs, int num_verts);
385 float (*DLLvm_GetCentroidFast)(vector *centroid, vector *src, int nv);
386 int (*DLLRenderHUDGetTextLineWidth)(const char *string);
387 int (*DLLRenderHUDGetTextHeight)(const char *string);
388 void (*DLLStartFrame)(int x, int y, int x2, int y2, bool clear);
389 void (*DLLEndFrame)(void);
390 void (*DLLResetFacings)(void);
391 void (*DLLGameRenderWorld)(object *viewer, vector *viewer_eye, int viewer_roomnum, matrix *viewer_orient,
392 float zoom, bool rear_view);
393 bool (*DLLGetFrameParameters)(int *x1, int *y1, int *x2, int *y2);
394 void (*DLLrend_SetZBufferState)(int8_t state);
395 void (*DLLrend_SetLighting)(light_state);
396 void (*DLLrend_SetColorModel)(color_model);
397 void (*DLLrend_SetTextureType)(texture_type);
398 void (*DLLrend_DrawPolygon)(int handle, g3Point **p, int nv, int map_type);
399 void (*DLLrend_SetMipState)(int8_t);
400 void (*DLLrend_SetFogState)(int8_t on);
401 void (*DLLrend_SetFiltering)(int8_t state);
402 void (*DLLrend_SetOverlayMap)(int handle);
403 void (*DLLrend_SetOverlayType)(uint8_t type);
404 void (*DLLrend_ClearScreen)(ddgr_color color);
405 void (*DLLrend_SetPixel)(ddgr_color color, int x, int y);
406 ddgr_color (*DLLrend_GetPixel)(int x, int y);
407 void (*DLLrend_FillCircle)(ddgr_color col, int x, int y, int rad);
408 void (*DLLrend_DrawCircle)(int x, int y, int rad);
409 void (*DLLrend_SetAlphaType)(int8_t);
410 void (*DLLrend_SetAlphaValue)(uint8_t val);
411 void (*DLLrend_SetWrapType)(wrap_type val);
412 void (*DLLrend_SetZBias)(float z_bias);
413 void (*DLLrend_SetZBufferWriteMask)(int state);
414 void (*DLLrend_GetLFBLock)(renderer_lfb *lfb);
415 void (*DLLrend_ReleaseLFBLock)(renderer_lfb *lfb);
416 void (*DLLrend_DrawLFBBitmap)(int sx, int sy, int w, int h, int dx, int dy, uint16_t *data, int rowsize);
417 void (*DLLrend_DrawSpecialLine)(g3Point *p0, g3Point *p1);
418 int (*DLLfvi_FindIntersection)(fvi_query *fq, fvi_info *hit_data, bool no_subdivision);
419 int (*DLLfvi_QuickDistFaceList)(int init_room_index, vector *pos, float rad,
420 fvi_face_room_list *quick_fr_list, int max_elements);
421 int (*DLLfvi_QuickDistCellList)(int init_cell_index, vector *pos, float rad, int *quick_cell_list,
422 int max_elements);
423 int (*DLLfvi_QuickDistObjectList)(vector *pos, int init_roomnum, float rad, int16_t *object_index_list,
424 int max_elements, bool f_lightmap_only, bool f_only_players_and_ais,
425 bool f_include_non_collide_objects, bool f_stop_at_closed_doors);
426 bool (*DLLfvi_QuickRoomCheck)(vector *pos, room *cur_room, bool try_again);
427 bool (*DLLtaunt_AreEnabled)(void);
428 void (*DLLtaunt_Enable)(bool enable);
429 int (*GetPlayerRankIndex)(int pnum, char *rankbuf);
430 int (*DLLVisEffectAllocate)(void);
431 int (*DLLVisEffectFree)(int visnum);
432 int (*DLLVisEffectInitType)(vis_effect *vis);
433 int (*DLLVisEffectCreate)(uint8_t type, uint8_t id, int roomnum, vector *pos);
434 void (*DLLVisEffectLink)(int visnum, int roomnum);
435 void (*DLLVisEffectUnlink)(int visnum);
436 void (*DLLVisEffectRelink)(int visnum, int newroomnum);
437 void (*DLLVisEffectDelete)(int visnum);
438 void (*DLLCreateRandomSparks)(int num_sparks, vector *pos, int roomnum, int which_index,
439 float force_scalar);
440 void (*DLLCreateRandomLineSparks)(int num_sparks, vector *pos, int roomnum, uint16_t color,
441 float force_scalar);
442 int (*DLLVisEffectCreateControlled)(uint8_t type, object *parent, uint8_t id, int roomnum, vector *pos,
443 float lifetime, vector *velocity, int phys_flags, float size,
444 float mass, float drag, bool isreal);
445 void (*DLLCreateRandomParticles)(int num_sparks, vector *pos, int roomnum, int bm_handle, float size,
446 float life);
447 void (*DLLAttachRandomNapalmEffectsToObject)(object *obj);
448 void (*DLLInitObjectScripts)(object *objp, bool do_evt_created);
449 void (*DLLg3_StartFrame)(vector *view_pos, matrix *view_matrix, float zoom);
450 void (*DLLg3_EndFrame)(void);
451 void (*DLLg3_GetViewPosition)(vector *vp);
452 void (*DLLg3_GetViewMatrix)(matrix *mat);
453 void (*DLLg3_GetUnscaledMatrix)(matrix *mat);
454 void (*DLLg3_StartInstanceMatrix)(vector *pos, matrix *orient);
455 void (*DLLg3_StartInstanceAngles)(vector *pos, angvec *angles);
456 void (*DLLg3_DoneInstance)();
457 bool (*DLLg3_CheckNormalFacing)(vector *v, vector *norm);
458 uint8_t (*DLLg3_RotatePoint)(g3Point *dest, vector *src);
459 void (*DLLg3_ProjectPoint)(g3Point *point);
460 float (*DLLg3_CalcPointDepth)(vector *pnt);
461 void (*DLLg3_Point2Vec)(vector *v, int16_t sx, int16_t sy);
462 uint8_t (*DLLg3_CodePoint)(g3Point *point);
463 vector *(*DLLg3_RotateDeltaX)(vector *dest, float dx);
464 vector *(*DLLg3_RotateDeltaY)(vector *dest, float dy);
465 vector *(*DLLg3_RotateDeltaZ)(vector *dest, float dz);
466 vector *(*DLLg3_RotateDeltaVec)(vector *dest, vector *src);
467 uint8_t (*DLLg3_AddDeltaVec)(g3Point *dest, g3Point *src, vector *deltav);
468 int (*DLLg3_DrawPoly)(int nv, g3Point **pointlist, int bm, int map_type, g3Codes *clip_codes);
469 void (*DLLg3_DrawSphere)(ddgr_color color, g3Point *pnt, float rad);
470 void (*DLLg3_CheckAndDrawPoly)(int nv, g3Point **pointlist, int bm, vector *norm, vector *pnt);
471 void (*DLLg3_DrawLine)(ddgr_color color, g3Point *p0, g3Point *p1);
472 void (*DLLg3_DrawBitmap)(vector *pos, float width, float height, int bm, int color);
473 void (*DLLg3_DrawRotatedBitmap)(vector *pos, angle rot_angle, float width, float height, int bm,
474 int color);
475 void (*DLLg3_DrawBox)(ddgr_color color, g3Point *pnt, float rad);
476 void (*DLLg3_SetCustomClipPlane)(uint8_t state, vector *pnt, vector *normal);
477 void (*DLLg3_SetFarClipZ)(float z);
478 g3Point **(*DLLg3_ClipPolygon)(g3Point **pointlist, int *nv, g3Codes *cc);
479 void (*DLLg3_FreeTempPoints)(g3Point **pointlist, int nv);
480 void (*DLLg3_GetMatrixScale)(vector *matrix_scale);
481 void (*DLLg3_SetTriangulationTest)(int state);
482 void (*DLLg3_DrawSpecialLine)(g3Point *p0, g3Point *p1);
483 void (*DLLg3_DrawPlanarRotatedBitmap)(vector *pos, vector *norm, angle rot_angle, float width,
484 float height, int bm);
485 void (*DLLPlayerStopSounds)(int slot);
486 int (*DLLFindArg)(const char *which);
487 int (*DLLFireWeaponFromObject)(object *obj, int weapon_num, int gun_num, bool f_force_forward,
488 bool f_force_target);
489 int (*DLLCreateAndFireWeapon)(vector *pos, vector *dir, object *parent, int weapon_num);
490 void (*DLLSelectNextCameraView)(int window);
491 bool (*Inven_Add)(Inventory *inven, int type, int id, object *parent, int aux_type, int aux_id, int flags,
492 char *description);
493 bool (*Inven_AddObject)(Inventory *inven, int object_handle, int flags, char *description);
494 bool (*Inven_AddCounterMeasure)(Inventory *inven, int id, int aux_type, int aux_id, int flags,
495 char *description);
496 bool (*Inven_Remove)(Inventory *inven, int type, int id);
497 bool (*Inven_Use)(Inventory *inven, int type, int id, object *parent);
498 bool (*Inven_UseObjHandle)(Inventory *inven, int objhandle, object *parent);
499 int (*Inven_Size)(Inventory *inven);
500 bool (*Inven_CheckItem)(Inventory *inven, int type, int id);
501 void (*Inven_Reset)(Inventory *inven, bool in_game, int reset_stage);
502 void (*Inven_ResetPos)(Inventory *inven);
503 void (*Inven_NextPos)(Inventory *inven, bool skip);
504 void (*Inven_PrevPos)(Inventory *inven, bool skip);
505 bool (*Inven_GetPosTypeID)(Inventory *inven, int &type, int &id);
506 bool (*Inven_GetAuxPosTypeID)(Inventory *inven, int &type, int &id);
507 char *(*Inven_GetPosDescription)(Inventory *inven);
508 char *(*Inven_GetPosIconName)(Inventory *inven);
509 char *(*Inven_GetPosName)(Inventory *inven);
510 bool (*Inven_GetPosInfo)(Inventory *inven, uint16_t &iflags, int &flags);
511 int (*Inven_GetPosCount)(Inventory *inven);
512 bool (*Inven_AtBeginning)(Inventory *inven);
513 bool (*Inven_AtEnd)(Inventory *inven);
514 void (*Inven_GotoPos)(Inventory *inven, int newpos);
515 void (*Inven_GotoPosTypeID)(Inventory *inven, int type, int id);
516 bool (*Inven_UsePos)(Inventory *inven, object *parent);
517 int (*Inven_GetPos)(Inventory *inven);
518 void (*Inven_ValidatePos)(Inventory *inven, bool forward);
519 bool (*Inven_IsSelectable)(Inventory *inven);
520 bool (*Inven_IsUsable)(Inventory *inven);
521 int (*Inven_GetTypeIDCount)(Inventory *inven, int type, int id);
522 bool (*Inven_FindPos)(Inventory *inven, int type, int id);
523 int (*Inven_GetInventoryItemList)(Inventory *inven, tInvenList *list, int max_amount, int *cur_sel);