Debian Codegraph @

scripts/osiris_import.h

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
19 #ifdef __OSIRIS_IMPORT_H_
20 #define OSIRISEXTERN extern
21 #else
22 #define OSIRISEXTERN
23 #endif
24
25 #include "osiris_common.h"
26
27 #if defined(POSIX)
28 #include "linux_lib.h"
29 #endif
30
31 // ===========================================================
32
33 // void mprintf(int n, const char *format, ... );
34 // prints a debug message out to the monochrome monitor
35 typedef void (*mprintf_fp)(int n, const char *format, ...);
36 OSIRISEXTERN mprintf_fp mprintf;
37
38 // The main calling function for multisafe functions
39 typedef void (*MSafe_CallFunction_fp)(int type, msafe_struct *mstruct);
40 OSIRISEXTERN MSafe_CallFunction_fp MSafe_CallFunction;
41
42 // The main calling function for extracting multisafe data
43 typedef void (*MSafe_GetValue_fp)(int type, msafe_struct *mstruct);
44 OSIRISEXTERN MSafe_GetValue_fp MSafe_GetValue;
45
46 // bool Obj_CallEvent(int objnum,int event,tOSIRISEventInfo *ei);
47 // Sends an event to an object. Returns true if the default action should
48 // continue to process.
49 typedef bool (*Obj_CallEvent_fp)(int objnum, int event, tOSIRISEventInfo *ei);
50 OSIRISEXTERN Obj_CallEvent_fp Obj_CallEvent;
51
52 // bool Trgr_CallEvent(int trignum,int event,tOSIRISEventInfo *ei);
53 // Sends an event to a trigger. Returns true if the default action should
54 // continue to process.
55 typedef bool (*Trgr_CallEvent_fp)(int trignum, int event, tOSIRISEventInfo *ei);
56 OSIRISEXTERN Trgr_CallEvent_fp Trgr_CallEvent;
57
58 // void Sound_TouchFile(char *sound_name);
59 // Touches a sound file so it loads into memory
60 typedef void (*Sound_TouchFile_fp)(char *sound_name);
61 OSIRISEXTERN Sound_TouchFile_fp Sound_TouchFile;
62
63 // int Obj_FindID(const char *object_name);
64 // searches for an object id given it's name
65 typedef int (*Obj_FindID_fp)(const char *object_name);
66 OSIRISEXTERN Obj_FindID_fp Obj_FindID;
67
68 // int Obj_FindType(const char *object_name);
69 // searches for an object type given it's name
70 typedef int (*Obj_FindType_fp)(const char *object_name);
71 OSIRISEXTERN Obj_FindType_fp Obj_FindType;
72
73 // int Wpn_FindID(const char *weapon_name);
74 // searches through the weapons for a name and returns the id
75 typedef int (*Wpn_FindID_fp)(const char *weapon_name);
76 OSIRISEXTERN Wpn_FindID_fp Wpn_FindID;
77
78 // float Obj_GetTimeLived(int objhandle);
79 // returns how long an object has lived
80 typedef float (*Obj_GetTimeLived_fp)(int objhandle);
81 OSIRISEXTERN Obj_GetTimeLived_fp Obj_GetTimeLived;
82
83 // void Obj_GetGunPos(int objhandle,int gun_number,vector *gun_pnt,vector *gun_normal);
84 // returns information about a gunpoint of an object
85 typedef void (*Obj_GetGunPos_fp)(int objhandle, int gun_number, vector *gun_pnt, vector *gun_normal);
86 OSIRISEXTERN Obj_GetGunPos_fp Obj_GetGunPosFP;
87
88 static inline void Obj_GetGunPos(int objhandle, int gun_number, vector *gun_pnt, vector *gun_normal = NULL) {
89 Obj_GetGunPosFP(objhandle, gun_number, gun_pnt, gun_normal);
90 }
91
92 // void Obj_GetGroundPos(int objhandle,int ground_number,vector *ground_pnt,vector *ground_normal);
93 // returns information about a groundpoint of an object
94 typedef void (*Obj_GetGroundPos_fp)(int objhandle, int ground_number, vector *ground_pnt, vector *ground_normal);
95 OSIRISEXTERN Obj_GetGroundPos_fp Obj_GetGroundPosFP;
96 static inline void Obj_GetGroundPos(int objhandle, int ground_number, vector *ground_pnt,
97 vector *ground_normal = NULL) {
98 Obj_GetGroundPosFP(objhandle, ground_number, ground_pnt, ground_normal);
99 }
100
101 // void Room_Value(int roomnum, char op, char vhandle, void *ptr);
102 typedef void (*Room_Value_fp)(int roomnum, char op, char vhandle, void *ptr, int index);
103 OSIRISEXTERN Room_Value_fp Room_ValueFP;
104
105 static inline void Room_Value(int roomnum, char op, char vhandle, void *ptr, int index = 0) {
106 Room_ValueFP(roomnum, op, vhandle, ptr, index);
107 }
108
109 // uint8_t Room_IsValid(int roomnum);
110 // returns 0 if the room is not valid. 1 if the room is a terrain cell. 2 if the room is a room segment
111 typedef uint8_t (*Room_IsValid_fp)(int roomnum);
112 OSIRISEXTERN Room_IsValid_fp Room_IsValid;
113
114 // int Obj_GetAttachParent(int childhandle);
115 // returns the handle to the parent of the given attached child
116 typedef int (*Obj_GetAttachParent_fp)(int childhandle);
117 OSIRISEXTERN Obj_GetAttachParent_fp Obj_GetAttachParent;
118
119 // int Obj_GetNumAttachSlots(int objhandle);
120 // returns the number of attach slots an object has.
121 typedef int (*Obj_GetNumAttachSlots_fp)(int objhandle);
122 OSIRISEXTERN Obj_GetNumAttachSlots_fp Obj_GetNumAttachSlots;
123
124 // int Obj_GetAttachChildHandle(int objhandle,char attachpoint);
125 // returns the handle to the child attached on the specified attach point of an object
126 typedef int (*Obj_GetAttachChildHandle_fp)(int objhandle, char attachpoint);
127 OSIRISEXTERN Obj_GetAttachChildHandle_fp Obj_GetAttachChildHandle;
128
129 // int Obj_AttachObjectAP(int parenthandle,char parent_ap,int childhandle,char child_ap,uint8_t f_use_aligned);
130 // Attaches one object to another object based on their attach points
131 typedef int (*Obj_AttachObjectAP_fp)(int parenthandle, char parent_ap, int childhandle, char child_ap,
132 uint8_t f_use_aligned);
133 OSIRISEXTERN Obj_AttachObjectAP_fp Obj_AttachObjectAP;
134
135 // int Obj_AttachObjectRad(int parenthandle,char parent_ap,int childhandle,float percent_rad);
136 // Attached one object to another based on radius
137 typedef int (*Obj_AttachObjectRad_fp)(int parenthandle, char parent_ap, int childhandle, float percent_rad);
138 OSIRISEXTERN Obj_AttachObjectRad_fp Obj_AttachObjectRad;
139
140 // void Obj_UnattachFromParent(int objhandle);
141 // Detaches an object from it's parent
142 typedef void (*Obj_UnattachFromParent_fp)(int objhandle);
143 OSIRISEXTERN Obj_UnattachFromParent_fp Obj_UnattachFromParent;
144
145 // void Obj_UnattachChild(int objhandle,char parent_ap);
146 // Detaches a child object from it's parent
147 typedef void (*Obj_UnattachChild_fp)(int objhandle, char parent_ap);
148 OSIRISEXTERN Obj_UnattachChild_fp Obj_UnattachChild;
149
150 // void Obj_UnattachChildren(int objhandle);
151 // Detaches all children from a parent
152 typedef void (*Obj_UnattachChildren_fp)(int objhandle);
153 OSIRISEXTERN Obj_UnattachChildren_fp Obj_UnattachChildren;
154
155 // int FVI_RayCast(int objhandle,vector *p0,vector *p1,int start_roomnum,float rad,int flags,ray_info *ri);
156 // Shoots out a ray, returns it's fate
157 typedef int (*FVI_RayCast_fp)(int objhandle, vector *p0, vector *p1, int start_roomnum, float rad, int flags,
158 ray_info *ri);
159 OSIRISEXTERN FVI_RayCast_fp FVI_RayCast;
160
161 // int AI_GetPathID(char *string);
162 // searches through GamePath index and returns index of path matching name returns -1 if not found
163 typedef int (*AI_GetPathID_fp)(char *string);
164 OSIRISEXTERN AI_GetPathID_fp AI_GetPathID;
165
166 // int AI_GoalFollowPathSimple(int objhandle,int path_id,int guid,int flags);
167 typedef int (*AI_GoalFollowPathSimple_fp)(int objhandle, int path_id, int guid, int flags, int slot);
168 OSIRISEXTERN AI_GoalFollowPathSimple_fp AI_GoalFollowPathSimpleFP;
169 static inline int AI_GoalFollowPathSimple(int objhandle, int path_id, int guid, int flags, int slot = 3) {
170 return AI_GoalFollowPathSimpleFP(objhandle, path_id, guid, flags, slot);
171 }
172
173 // int AI_PowerSwitch(int objhandle,uint8_t f_power_on);
174 typedef int (*AI_PowerSwitch_fp)(int objhandle, uint8_t f_power_on);
175 OSIRISEXTERN AI_PowerSwitch_fp AI_PowerSwitch;
176
177 // void AI_Value(int objhandle, char op, char vtype, void *ptr);
178 typedef void (*AI_Value_fp)(int objhandle, char op, char vtype, void *ptr);
179 OSIRISEXTERN AI_Value_fp AI_Value;
180
181 // void Obj_Value(int objhandle, char op, char vtype, void *ptr);
182 typedef void (*Obj_Value_fp)(int objhandle, char op, char vtype, void *ptr, int index);
183 OSIRISEXTERN Obj_Value_fp Obj_ValueFP;
184
185 static inline void Obj_Value(int objhandle, char op, char vtype, void *ptr, int index = 0) {
186 Obj_ValueFP(objhandle, op, vtype, ptr, index);
187 }
188
189 // void Matcen_Value(int matcen_handle, char op, char vtype, void *ptr, int prod_index = 0);
190 typedef void (*Matcen_Value_fp)(int matcen_handle, char op, char vtype, void *ptr, int prod_index);
191 OSIRISEXTERN Matcen_Value_fp Matcen_ValueFP;
192 static inline void Matcen_Value(int matcen_handle, char op, char vtype, void *ptr, int prod_index = 0) {
193 Matcen_ValueFP(matcen_handle, op, vtype, ptr, prod_index);
194 }
195
196 // uint8_t AI_TurnTowardsVectors(int objhandle,vector *fvec,vector *uvec);
197 typedef uint8_t (*AI_TurnTowardsVectors_fp)(int objhandle, vector *fvec, vector *uvec);
198 OSIRISEXTERN AI_TurnTowardsVectors_fp AI_TurnTowardsVectors;
199
200 // void AI_SetType(int objhandle,int type);
201 typedef void (*AI_SetType_fp)(int objhandle, int type);
202 OSIRISEXTERN AI_SetType_fp AI_SetType;
203
204 // vector AI_FindHidePos(int hideobjhandle,int viewobjhandle,float time,int *hide_room);
205 typedef vector (*AI_FindHidePos_fp)(int hideobjhandle, int viewobjhandle, float time, int *hide_room);
206 OSIRISEXTERN AI_FindHidePos_fp AI_FindHidePos;
207
208 // int AI_GoalAddEnabler(int objhandle,int goal_index,int enabler_type,float percent,float interval,void *ptr);
209 typedef int (*AI_GoalAddEnabler_fp)(int objhandle, int goal_index, int enabler_type, float percent, float interval,
210 void *ptr);
211 OSIRISEXTERN AI_GoalAddEnabler_fp AI_GoalAddEnabler;
212
213 // int AI_AddGoal(int objhandle,int goal_type,int level,float influence, int guid, int flags, ... );
214 typedef float (*AI_AddGoal_fp)(int objhandle, int goal_type, int level, float influence, int guid, int flags, ...);
215 OSIRISEXTERN AI_AddGoal_fp AI_AddGoal;
216
217 // void AI_ClearGoal(int objhandle,int goal_index);
218 typedef void (*AI_ClearGoal_fp)(int objhandle, int goal_index);
219 OSIRISEXTERN AI_ClearGoal_fp AI_ClearGoal;
220
221 // int AI_FindObjOfType(int objhandle,int type, bool f_ignore_init_room, int parent_handle = OBJECT_HANDLE_NONE);
222 typedef int (*AI_FindObjOfType_fp)(int objhandle, int type, int id, bool f_ignore_init_room, int parent_handle);
223 OSIRISEXTERN AI_FindObjOfType_fp AI_FindObjOfTypeFP;
224 static inline int AI_FindObjOfType(int objhandle, int type, int id, bool f_ignore_init_room,
225 int parent_handle = OBJECT_HANDLE_NONE) {
226 return AI_FindObjOfTypeFP(objhandle, type, id, f_ignore_init_room, parent_handle);
227 }
228 // vector AI_GetRoomPathPoint(int roomnum);
229 typedef vector (*AI_GetRoomPathPoint_fp)(int roomnum);
230 OSIRISEXTERN AI_GetRoomPathPoint_fp AI_GetRoomPathPoint;
231
232 // int AI_FindEnergyCenter(int objhandle);
233 typedef int (*AI_FindEnergyCenter_fp)(int objhandle);
234 OSIRISEXTERN AI_FindEnergyCenter_fp AI_FindEnergyCenter;
235
236 // float AI_GetDistToObj(int objhandle,int otherobjhandle);
237 typedef float (*AI_GetDistToObj_fp)(int objhandle, int otherobjhandle);
238 OSIRISEXTERN AI_GetDistToObj_fp AI_GetDistToObj;
239
240 // int AI_SetGoalFlags(int objhandle,int goal_handle,int flags,uint8_t f_enable);
241 typedef int (*AI_SetGoalFlags_fp)(int objhandle, int goal_handle, int flags, uint8_t f_enable);
242 OSIRISEXTERN AI_SetGoalFlags_fp AI_SetGoalFlags;
243
244 // void AI_SetGoalCircleDist(int objhandle,int goal_handle,float dist);
245 typedef void (*AI_SetGoalCircleDist_fp)(int objhandle, int goal_handle, float dist);
246 OSIRISEXTERN AI_SetGoalCircleDist_fp AI_SetGoalCircleDist;
247
248 // int File_ReadBytes(uint8_t *buffer, int count, void *fileptr);
249 // Reads the specified number of bytes from a file into the buffer
250 // DO NOT USE THIS TO READ STRUCTURES. This function is for byte
251 // data, such as a string or a bitmap of 8-bit pixels.
252 // Returns the number of bytes read.
253 // Throws an exception of type (cfile_error *) if the OS returns an error on read
254 typedef int (*File_ReadBytes_fp)(uint8_t *buffer, int count, void *fileptr);
255 OSIRISEXTERN File_ReadBytes_fp File_ReadBytes;
256
257 // int File_ReadInt(void *fileptr);
258 // The following functions read numeric vales from a CFILE. All values are
259 // stored in the file in Intel (little-endian) format. These functions
260 // will convert to big-endian if required.
261 // These funtions will throw an exception of if the value cannot be read,
262 // so do not call these if you don't require the data to be present.
263
264 // Read and return an integer (32 bits)
265 // Throws an exception of type (cfile_error *) if the OS returns an error on read
266 typedef int (*File_ReadInt_fp)(void *fileptr);
267 OSIRISEXTERN File_ReadInt_fp File_ReadInt;
268
269 // int16_t File_ReadShort(void *fileptr);
270 // Read and return a int16_t (16 bits)
271 // Throws an exception of type (cfile_error *) if the OS returns an error on read
272 typedef int16_t (*File_ReadShort_fp)(void *fileptr);
273 OSIRISEXTERN File_ReadShort_fp File_ReadShort;
274
275 // int8_t File_ReadByte(void *fileptr);
276 // Read and return a byte (8 bits)
277 // Throws an exception of type (cfile_error *) if the OS returns an error on read
278 typedef int8_t (*File_ReadByte_fp)(void *fileptr);
279 OSIRISEXTERN File_ReadByte_fp File_ReadByte;
280
281 // float File_ReadFloat(void *fileptr);
282 // Read and return a float (32 bits)
283 // Throws an exception of type (cfile_error *) if the OS returns an error on read
284 typedef float (*File_ReadFloat_fp)(void *fileptr);
285 OSIRISEXTERN File_ReadFloat_fp File_ReadFloat;
286
287 // double File_ReadDouble(void *fileptr);
288 // Read and return a double (64 bits)
289 // Throws an exception of type (cfile_error *) if the OS returns an error on read
290 typedef double (*File_ReadDouble_fp)(void *fileptr);
291 OSIRISEXTERN File_ReadDouble_fp File_ReadDouble;
292
293 // int File_ReadString(char *buf,size_t n,void *fileptr);
294 // Reads a string from a CFILE. If the file is type binary, this
295 // function reads until a NULL or EOF is found. If the file is text,
296 // the function reads until a newline or EOF is found. The string is always
297 // written to the destination buffer null-terminated, without the newline.
298 // Parameters: buf - where the string is written
299 // n - the maximum string length, including the terminating 0
300 // cfp - the CFILE pointer
301 // Returns the number of bytes in the string, before the terminator
302 // Does not generate an exception on EOF
303 typedef int (*File_ReadString_fp)(char *buf, size_t n, void *fileptr);
304 OSIRISEXTERN File_ReadString_fp File_ReadString;
305
306 // int File_WriteBytes(const uint8_t *buf,int count,void *fileptr);
307 // Writes the specified number of bytes from a file into the buffer
308 // DO NOT USE THIS TO WRITE STRUCTURES. This function is for byte
309 // data, such as a string or a bitmap of 8-bit pixels.
310 // Returns the number of bytes written.
311 // Throws an exception of type (cfile_error *) if the OS returns an error on write
312 typedef int (*File_WriteBytes_fp)(const uint8_t *buf, int count, void *fileptr);
313 OSIRISEXTERN File_WriteBytes_fp File_WriteBytes;
314
315 // int File_WriteString(const char *buf,void *fileptr);
316 // Writes a null-terminated string to a file. If the file is type binary,
317 // the string is terminated in the file with a null. If the file is type
318 // text, the string is terminated with a newline.
319 // Parameters: buf - pointer to the string
320 // cfp = the CFILE pointer
321 // Returns the number of bytes written
322 // Throws an exception of type (cfile_error *) if the OS returns an error on write
323 typedef int (*File_WriteString_fp)(const char *buf, void *fileptr);
324 OSIRISEXTERN File_WriteString_fp File_WriteString;
325
326 // void File_WriteInt(int i,void *fileptr);
327 // The following functions write numeric vales to a CFILE. All values are
328 // stored to the file in Intel (little-endian) format.
329 // All these throw an exception if there's an error on write.
330
331 // Write an integer (32 bits)
332 // Throws an exception of type (cfile_error *) if the OS returns an error on write
333 typedef void (*File_WriteInt_fp)(int i, void *fileptr);
334 OSIRISEXTERN File_WriteInt_fp File_WriteInt;
335
336 // void File_WriteShort(int16_t s,void *fileptr);
337 // Write a int16_t (16 bits)
338 // Throws an exception of type (cfile_error *) if the OS returns an error on write
339 typedef void (*File_WriteShort_fp)(int16_t s, void *fileptr);
340 OSIRISEXTERN File_WriteShort_fp File_WriteShort;
341
342 // void File_WriteByte(int8_t b,void *fileptr);
343 // Write a byte (8 bits). If the byte is a newline & the file is a text file, writes a CR/LF pair.
344 // Throws an exception of type (cfile_error *) if the OS returns an error on write
345 typedef void (*File_WriteByte_fp)(int8_t b, void *fileptr);
346 OSIRISEXTERN File_WriteByte_fp File_WriteByte;
347
348 // void File_WriteFloat(float f,void *fileptr);
349 // Write a float (32 bits)
350 // Throws an exception of type (cfile_error *) if the OS returns an error on write
351 typedef void (*File_WriteFloat_fp)(float f, void *fileptr);
352 OSIRISEXTERN File_WriteFloat_fp File_WriteFloat;
353
354 // void File_WriteDouble(double d,void *fileptr);
355 // Write a double (64 bits)
356 // Throws an exception of type (cfile_error *) if the OS returns an error on write
357 typedef void (*File_WriteDouble_fp)(double d, void *fileptr);
358 OSIRISEXTERN File_WriteDouble_fp File_WriteDouble;
359
360 // void *Scrpt_MemAlloc(tOSIRISMEMCHUNK *mem_info);
361 // Allocates a chunk of memory to be associated with a script. It will automatically
362 // save this memory to disk on game save, and will pass the pointer to this memory on EVT_MEMRESTORE
363 typedef void *(*Scrpt_MemAlloc_fp)(tOSIRISMEMCHUNK *mem_info);
364 OSIRISEXTERN Scrpt_MemAlloc_fp Scrpt_MemAlloc;
365
366 // void Scrpt_MemFree(void *memory_ptr);
367 // Frees a chunk of memory that was allocated by Scrpt_MemAlloc().
368 typedef void (*Scrpt_MemFree_fp)(void *memory_ptr);
369 OSIRISEXTERN Scrpt_MemFree_fp Scrpt_MemFree;
370
371 // void Scrpt_CancelTimer(int timer_id);
372 // Cancels a timer thats in use, given it's ID
373 typedef void (*Scrpt_CancelTimer_fp)(int timer_id);
374 OSIRISEXTERN Scrpt_CancelTimer_fp Scrpt_CancelTimer;
375
376 // int Scrpt_CreateTimer(tOSIRISTIMER *timer_info);
377 // Adds a timer to the list to be processed. You'll receive a EVT_TIMER when the timer is signaled.
378 // Returns an id to the timer, which can be used to cancel a timer. -1 on error.
379 typedef int (*Scrpt_CreateTimer_fp)(tOSIRISTIMER *timer_info);
380 OSIRISEXTERN Scrpt_CreateTimer_fp Scrpt_CreateTimer;
381
382 // void MSafe_DoPowerup (msafe_struct *mstruct);
383 // Does whatever magic needs to be done to get the default powerups to work
384 typedef void (*MSafe_DoPowerup_fp)(msafe_struct *mstruct);
385 OSIRISEXTERN MSafe_DoPowerup_fp MSafe_DoPowerup;
386
387 // int Obj_Create()(uint8_t type,uint16_t id,int roomnum,vector *pos,const matrix *orient,int parent_handle)
388 typedef int (*Obj_Create_fp)(uint8_t type, uint16_t id, int roomnum, vector *pos, const matrix *orient, int parent_handle,
389 vector *initial_velocity);
390 OSIRISEXTERN Obj_Create_fp Obj_CreateFP;
391 static inline int Obj_Create(uint8_t type, uint16_t id, int roomnum, vector *pos, const matrix *orient = NULL,
392 int parent_handle = 0, vector *initial_velocity = NULL) {
393 return Obj_CreateFP(type, id, roomnum, pos, orient, parent_handle, initial_velocity);
394 }
395 // float Game_GetTime() (void)
396 typedef float (*Game_GetTime_fp)(void);
397 OSIRISEXTERN Game_GetTime_fp Game_GetTime;
398
399 // float Game_GetFrameTime() (void)
400 typedef float (*Game_GetFrameTime_fp)(void);
401 OSIRISEXTERN Game_GetFrameTime_fp Game_GetFrameTime;
402
403 // void Obj_WBValue() (int obj_handle, char wb_index, char op, char vtype, void *ptr, char g_index)
404 typedef void (*Obj_WBValue_fp)(int obj_handle, char wb_index, char op, char vtype, void *ptr, char g_index);
405 OSIRISEXTERN Obj_WBValue_fp Obj_WBValueFP;
406 static inline void Obj_WBValue(int obj_handle, char wb_index, char op, char vtype, void *ptr, char g_index = 0) {
407 Obj_WBValueFP(obj_handle, wb_index, op, vtype, ptr, g_index);
408 }
409
410 // uint8_t Scrpt_TimerExists(int handle);
411 typedef uint8_t (*Scrpt_TimerExists_fp)(int handle);
412 OSIRISEXTERN Scrpt_TimerExists_fp Scrpt_TimerExists;
413
414 typedef void (*Matcen_Reset_fp)(int handle);
415 OSIRISEXTERN Matcen_Reset_fp Matcen_Reset;
416
417 typedef void (*Matcen_Copy_fp)(int dhandle, int shandle);
418 OSIRISEXTERN Matcen_Copy_fp Matcen_Copy;
419
420 typedef int (*Matcen_Create_fp)(char *name);
421 OSIRISEXTERN Matcen_Create_fp Matcen_Create;
422
423 typedef int (*Matcen_FindID_fp)(char *str);
424 OSIRISEXTERN Matcen_FindID_fp Matcen_FindID;
425
426 // void Msn_FlagSet(int flag,uint8_t value);
427 // Sets/Clears mission flags. flag is which mission flag to set/clear (1-32)
428 // value is 0 to clear, or 1 to set
429 typedef void (*Msn_FlagSet_fp)(int flag, uint8_t value);
430 OSIRISEXTERN Msn_FlagSet_fp Msn_FlagSet;
431
432 // int Msn_FlagGet(int flag);
433 // Gets a mission flag. flag is what mission flag to get. Returns 1 if set, 0 if not.
434 typedef int (*Msn_FlagGet_fp)(int flag);
435 OSIRISEXTERN Msn_FlagGet_fp Msn_FlagGet;
436
437 typedef void (*Player_Value_fp)(int obj_handle, char op, char vhandle, void *ptr, int index);
438 OSIRISEXTERN Player_Value_fp Player_ValueFP;
439 static inline void Player_Value(int obj_handle, char op, char vhandle, void *ptr, int index = 0) {
440 Player_ValueFP(obj_handle, op, vhandle, ptr, index);
441 }
442
443 typedef void (*Obj_SetCustomAnim_fp)(int handle, float start, float end, float time, char flags, int sound_handle,
444 char next_anim_type);
445 OSIRISEXTERN Obj_SetCustomAnim_fp Obj_SetCustomAnimFP;
446 static inline void Obj_SetCustomAnim(int handle, float start, float end, float time, char flags, int sound_handle = -1,
447 char next_anim_type = -1) {
448 Obj_SetCustomAnimFP(handle, start, end, time, flags, sound_handle, next_anim_type);
449 }
450
451 typedef void (*Player_AddHudMessage_fp)(int handle, const char *str);
452 OSIRISEXTERN Player_AddHudMessage_fp Player_AddHudMessage;
453
454 typedef void (*Obj_Ghost_fp)(int handle, bool f_ghost);
455 OSIRISEXTERN Obj_Ghost_fp Obj_Ghost;
456
457 typedef void (*Obj_Burning_fp)(int handle, float time, float damage_per_second);
458 OSIRISEXTERN Obj_Burning_fp Obj_BurningFP;
459 static inline void Obj_Burning(int handle, float time, float damage_per_second = 1.0f) {
460 Obj_BurningFP(handle, time, damage_per_second);
461 }
462
463 typedef bool (*Obj_IsEffect_fp)(int handle, int type_flag);
464 OSIRISEXTERN Obj_IsEffect_fp Obj_IsEffect;
465
466 // opens a cfile for reading/writing (works just like fopen())
467 typedef void *(*File_Open_fp)(const char *filename, const char *mode);
468 OSIRISEXTERN File_Open_fp File_Open;
469
470 // closes a cfile (like fclose())
471 typedef void (*File_Close_fp)(void *fileptr);
472 OSIRISEXTERN File_Close_fp File_Close;
473
474 // returns the current position of the file (like ftell())
475 typedef int (*File_Tell_fp)(void *fileptr);
476 OSIRISEXTERN File_Tell_fp File_Tell;
477
478 // returns 1 if the file is at the EOF, else 0 (like feof())
479 typedef uint8_t (*File_eof_fp)(void *fileptr);
480 OSIRISEXTERN File_eof_fp File_eof;
481
482 typedef void (*Sound_Stop_fp)(int s_handle, bool f_immediately);
483 OSIRISEXTERN Sound_Stop_fp Sound_StopFP;
484 static inline void Sound_Stop(int s_handle, bool f_immediately = true) { Sound_StopFP(s_handle, f_immediately); }
485
486 typedef int (*Sound_Play2d_fp)(int obj_handle, int s_id, float volume);
487 OSIRISEXTERN Sound_Play2d_fp Sound_Play2dFP;
488 static inline int Sound_Play2d(int obj_handle, int s_id, float volume = 1.0f) {
489 return Sound_Play2dFP(obj_handle, s_id, volume);
490 }
491
492 typedef int (*Sound_Play3d_fp)(int obj_handle, int s_id, float volume);
493 OSIRISEXTERN Sound_Play3d_fp Sound_Play3dFP;
494 static inline int Sound_Play3d(int obj_handle, int s_id, float volume = 1.0f) {
495 return Sound_Play3dFP(obj_handle, s_id, volume);
496 }
497
498 typedef int (*Sound_FindId_fp)(const char *s_name);
499 OSIRISEXTERN Sound_FindId_fp Sound_FindId;
500
501 typedef bool (*AI_IsObjFriend_fp)(int obj_handle, int it_handle);
502 OSIRISEXTERN AI_IsObjFriend_fp AI_IsObjFriend;
503
504 typedef bool (*AI_IsObjEnemy_fp)(int obj_handle, int it_handle);
505 OSIRISEXTERN AI_IsObjEnemy_fp AI_IsObjEnemy;
506
507 typedef bool (*AI_GoalValue_fp)(int obj_handle, char g_index, char op, char vtype, void *ptr, char index);
508 OSIRISEXTERN AI_GoalValue_fp AI_GoalValueFP;
509 static inline bool AI_GoalValue(int obj_handle, char g_index, char op, char vtype, void *ptr, char index = 0) {
510 return AI_GoalValueFP(obj_handle, g_index, op, vtype, ptr, index);
511 }
512
513 typedef int (*AI_GetNearbyObjs_fp)(vector *pos, int init_roomnum, float rad, int *object_handle_list, int max_elements,
514 bool f_lightmap_only, bool f_only_players_and_ais,
515 bool f_include_non_collide_objects, bool f_stop_at_closed_doors);
516 OSIRISEXTERN AI_GetNearbyObjs_fp AI_GetNearbyObjsFP;
517 static inline int AI_GetNearbyObjs(vector *pos, int init_roomnum, float rad, int *object_handle_list, int max_elements,
518 bool f_lightmap_only, bool f_only_players_and_ais = true,
519 bool f_include_non_collide_objects = false, bool f_stop_at_closed_doors = true) {
520 return AI_GetNearbyObjsFP(pos, init_roomnum, rad, object_handle_list, max_elements, f_lightmap_only,
521 f_only_players_and_ais, f_include_non_collide_objects, f_stop_at_closed_doors);
522 }
523
524 typedef char (*AI_GetCurGoalIndex_fp)(int obj_handle);
525 OSIRISEXTERN AI_GetCurGoalIndex_fp AI_GetCurGoalIndex;
526
527 // Allocates a block of global memory for this module, of size amount_of_memory.
528 // unique_identfier is the script provided unique ID which is used throughout.
529 // script_identifier is the pointer of data provided to the script in it's InitializeDLL function (really the name of
530 // the script) Returns -1 if there isn't enough available memory Returns -2 if the unique identifier passed in is
531 // already used, but the requested amount_of_memory is different If the memory has already been allocated, it will
532 // return the handle.
533 typedef OMMSHANDLE (*OMMS_Malloc_fp)(size_t amount_of_memory, uint32_t unique_identifier, char *script_identifier);
534 OSIRISEXTERN OMMS_Malloc_fp OMMS_Malloc;
535
536 // Attaches to a block of global OMMS memory. As long as at least one module (or script) is
537 // attached to a module, the memory will not be deleted. (Increments the reference count)
538 // Returns NULL if the memory couldn't be attached (it has been either free'd or never malloced)
539 typedef void *(*OMMS_Attach_fp)(OMMSHANDLE handle);
540 OSIRISEXTERN OMMS_Attach_fp OMMS_Attach;
541
542 // Detaches a block of global OMMS memory. (Reduces the reference count).
543 typedef void (*OMMS_Detach_fp)(OMMSHANDLE handle);
544 OSIRISEXTERN OMMS_Detach_fp OMMS_Detach;
545
546 // Frees a block of global memory
547 // Only has affect if you are attached to the memory. Memory will _ONLY_ be deleted when the
548 // following conditions are meant for the shared memory block:
549 // 1) The reference count for the global memory is at 0 (OMMS_Attach() adds to reference count, OMMS_Detach()
550 // subtracts). 2) OMMS_Free() has been called for the block of global memory. The conditions can happen in any order,
551 // but
552 // as soon as both are satisfied, the memory becomes deleted and any pointer returned by OMMS_Attach() becomes
553 // invalid.
554 //
555 // handle : the value returned by OMMS_Malloc()
556 typedef void (*OMMS_Free_fp)(OMMSHANDLE handle);
557 OSIRISEXTERN OMMS_Free_fp OMMS_Free;
558
559 // Returns an OMMSHANDLE to a block of global memory allocated by a module/script. Pass
560 // in the unique_identifier and the script_identifier that was passed in the OMMS_Malloc().
561 // Note: script_identifier is really the filename of the module that called the OMMS_Malloc().
562 // Returns -1 if the module was never OMMS_Malloc()'d.
563 typedef OMMSHANDLE (*OMMS_Find_fp)(uint32_t unique_identifier, char *script_identifier);
564 OSIRISEXTERN OMMS_Find_fp OMMS_Find;
565
566 // Returns information about the OMMS memory given it's handle returned from the OMMS_Find() or
567 // OMMS_Malloc(). Returns 0 if the handle was invalid, 1 if the information has been filled in;
568 // Pass NULL in for those parameters you don't need information about.
569 typedef char (*OMMS_GetInfo_fp)(OMMSHANDLE handle, uint32_t *mem_size, uint32_t *uid, uint16_t *reference_count,
570 uint8_t *has_free_been_called);
571 OSIRISEXTERN OMMS_GetInfo_fp OMMS_GetInfo;
572
573 // Starts an in-game cinematic sequence. text_string is the text to be displayed
574 // use pipes (|) to seperate lines.
575 typedef bool (*Cine_Start_fp)(tGameCinematic *info, const char *text_string);
576 OSIRISEXTERN Cine_Start_fp Cine_Start;
577
578 // Stops and clears up a in-game cinematic.
579 typedef void (*Cine_Stop_fp)(void);
580 OSIRISEXTERN Cine_Stop_fp Cine_Stop;
581
582 // Looks up the id's of the sound, room, trigger, object, ect. based on the name
583 typedef int (*Scrpt_FindSoundName_fp)(const char *name);
584 OSIRISEXTERN Scrpt_FindSoundName_fp Scrpt_FindSoundName;
585
586 typedef int (*Scrpt_FindRoomName_fp)(const char *name);
587 OSIRISEXTERN Scrpt_FindRoomName_fp Scrpt_FindRoomName;
588
589 typedef int (*Scrpt_FindTriggerName_fp)(const char *name);
590 OSIRISEXTERN Scrpt_FindTriggerName_fp Scrpt_FindTriggerName;
591
592 typedef int (*Scrpt_FindObjectName_fp)(const char *name);
593 OSIRISEXTERN Scrpt_FindObjectName_fp Scrpt_FindObjectName;
594
595 typedef int (*Scrpt_GetTriggerRoom_fp)(int trigger_id);
596 OSIRISEXTERN Scrpt_GetTriggerRoom_fp Scrpt_GetTriggerRoom;
597
598 typedef int (*Scrpt_GetTriggerFace_fp)(int trigger_id);
599 OSIRISEXTERN Scrpt_GetTriggerFace_fp Scrpt_GetTriggerFace;
600
601 typedef int (*Scrpt_FindDoorName_fp)(const char *name);
602 OSIRISEXTERN Scrpt_FindDoorName_fp Scrpt_FindDoorName;
603
604 typedef int (*Scrpt_FindTextureName_fp)(const char *name);
605 OSIRISEXTERN Scrpt_FindTextureName_fp Scrpt_FindTextureName;
606
607 typedef void (*Game_CreateRandomSparks_fp)(int num_sparks, vector *pos, int roomnum, int which_index,
608 float force_scalar);
609 OSIRISEXTERN Game_CreateRandomSparks_fp Game_CreateRandomSparksFP;
610 static inline void Game_CreateRandomSparks(int num_sparks, vector *pos, int roomnum, int which_index = -1,
611 float force_scalar = 1.0f) {
612 return Game_CreateRandomSparksFP(num_sparks, pos, roomnum, which_index, force_scalar);
613 }
614
615 // Cancels a timer given its ID
616 typedef void (*Scrpt_CancelTimerID_fp)(int id);
617 OSIRISEXTERN Scrpt_CancelTimerID_fp Scrpt_CancelTimerID;
618
619 // disable/enable ship
620 typedef void (*Game_EnableShip_fp)(const char *ship_name, bool enable);
621 OSIRISEXTERN Game_EnableShip_fp Game_EnableShip;
622
623 // is ship enabled
624 typedef bool (*Game_IsShipEnabled_fp)(const char *ship_name);
625 OSIRISEXTERN Game_IsShipEnabled_fp Game_IsShipEnabled;
626
627 // gets information about a path point
628 // pass NULL for parameters not needed.
629 // pathid: path number
630 // point: which path point
631 // returns true if operation was successful
632 typedef bool (*Path_GetInformation_fp)(int pathid, int point, vector *pos, int *room, matrix *orient);
633 OSIRISEXTERN Path_GetInformation_fp Path_GetInformationFP;
634 static inline bool Path_GetInformation(int pathid, int point, vector *pos = NULL, int *room = NULL,
635 matrix *orient = NULL) {
636 return Path_GetInformationFP(pathid, point, pos, room, orient);
637 }
638 // starts a canned cinematic sequence
639 typedef void (*Cine_StartCanned_fp)(tCannedCinematicInfo *info);
640 OSIRISEXTERN Cine_StartCanned_fp Cine_StartCanned;
641
642 typedef int (*Scrpt_FindMatcenName_fp)(const char *name);
643 OSIRISEXTERN Scrpt_FindMatcenName_fp Scrpt_FindMatcenName;
644
645 typedef int (*Scrpt_FindPathName_fp)(const char *name);
646 OSIRISEXTERN Scrpt_FindPathName_fp Scrpt_FindPathName;
647
648 typedef int (*Scrpt_FindLevelGoalName_fp)(const char *name);
649 OSIRISEXTERN Scrpt_FindLevelGoalName_fp Scrpt_FindLevelGoalName;
650
651 typedef void (*LGoal_Value_fp)(char op, char vtype, void *ptr, int g_index, int i_index);
652 OSIRISEXTERN LGoal_Value_fp LGoal_ValueFP;
653 static inline void LGoal_Value(char op, char vtype, void *ptr, int g_index = -1, int i_index = -1) {
654 LGoal_ValueFP(op, vtype, ptr, g_index, i_index);
655 }
656
657 typedef int (*Obj_MakeListOfType_fp)(int objhandle, int type, int id, bool f_ignore_init_room, int parent_handle,
658 int max_recorded, int *handles);
659 OSIRISEXTERN Obj_MakeListOfType_fp Obj_MakeListOfType;
660
661 typedef void (*Obj_Kill_fp)(int handle, int killer_handle, float damage, int flags, float min_time, float max_time);
662 OSIRISEXTERN Obj_Kill_fp Obj_Kill;
663
664 // typedef bool (*AI_AreRoomsReachable_fp)(int room1, int room2);
665 // OSIRISEXTERN AI_AreRoomsReachable_fp AI_AreRoomsReachable;
666
667 typedef bool (*AI_IsDestReachable_fp)(int handle, int room);
668 OSIRISEXTERN AI_IsDestReachable_fp AI_IsDestReachable;
669
670 typedef bool (*AI_IsObjReachable_fp)(int handle, int target);
671 OSIRISEXTERN AI_IsObjReachable_fp AI_IsObjReachable;
672
673 typedef char (*Game_GetDiffLevel_fp)(void);
674 OSIRISEXTERN Game_GetDiffLevel_fp Game_GetDiffLevel;
675
676 /*
677 0:LANGUAGE_ENGLISH
678 1:LANGUAGE_GERMAN
679 2:LANGUAGE_SPANISH
680 3:LANGUAGE_ITALIAN
681 4:LANGUAGE_FRENCH
682 */
683 typedef int (*Game_GetLanguage_fp)(void);
684 OSIRISEXTERN Game_GetLanguage_fp Game_GetLanguage;
685
686 // Sets/Gets information about a path.
687 // If you change is PV_ALL (or any of it's individual components), pass in a pointer to an
688 // osiris_path_node_info struct. For the others, you must pass in an appropriate pointer
689 // (i.e. an int* for PV_I_NUMNODES). You can only set PV_ALL components.
690 // for PV_I_NUMNODES, path_id MUST be specified, node_id is ignored
691 // for PV_I_NUMPATHS, path_id and node_id are ignored
692 // for PV_CS_NAME, path_id MUST be specified, node_id is ignored
693 // for PV_ALL components, path_id and node_id MUST be valid.
694 typedef void (*Path_Value_fp)(int path_id, int node_id, char op, int changes, void *ptr);
695 OSIRISEXTERN Path_Value_fp Path_Value;
696
697 // ===========================================================
698
699 // osicommon_Initialize
700 // Initializes module's functions
701 void osicommon_Initialize(tOSIRISModuleInit *mi);
702 #ifndef __OSIRIS_IMPORT_H_
703 void osicommon_Initialize(tOSIRISModuleInit *mi) {
704 int i = 0;
705 mprintf = (mprintf_fp)mi->fp[i++];
706 MSafe_CallFunction = (MSafe_CallFunction_fp)mi->fp[i++];
707 MSafe_GetValue = (MSafe_GetValue_fp)mi->fp[i++];
708 Obj_CallEvent = (Obj_CallEvent_fp)mi->fp[i++];
709 Trgr_CallEvent = (Trgr_CallEvent_fp)mi->fp[i++];
710 Sound_TouchFile = (Sound_TouchFile_fp)mi->fp[i++];
711 Obj_FindID = (Obj_FindID_fp)mi->fp[i++];
712 Wpn_FindID = (Wpn_FindID_fp)mi->fp[i++];
713 Obj_GetTimeLived = (Obj_GetTimeLived_fp)mi->fp[i++];
714 Obj_GetGunPosFP = (Obj_GetGunPos_fp)mi->fp[i++];
715 Room_ValueFP = (Room_Value_fp)mi->fp[i++];
716 Room_IsValid = (Room_IsValid_fp)mi->fp[i++];
717 Obj_GetAttachParent = (Obj_GetAttachParent_fp)mi->fp[i++];
718 Obj_GetNumAttachSlots = (Obj_GetNumAttachSlots_fp)mi->fp[i++];
719 Obj_GetAttachChildHandle = (Obj_GetAttachChildHandle_fp)mi->fp[i++];
720 Obj_AttachObjectAP = (Obj_AttachObjectAP_fp)mi->fp[i++];
721 Obj_AttachObjectRad = (Obj_AttachObjectRad_fp)mi->fp[i++];
722 Obj_UnattachFromParent = (Obj_UnattachFromParent_fp)mi->fp[i++];
723 Obj_UnattachChild = (Obj_UnattachChild_fp)mi->fp[i++];
724 Obj_UnattachChildren = (Obj_UnattachChildren_fp)mi->fp[i++];
725 FVI_RayCast = (FVI_RayCast_fp)mi->fp[i++];
726 AI_GetPathID = (AI_GetPathID_fp)mi->fp[i++];
727 AI_GoalFollowPathSimpleFP = (AI_GoalFollowPathSimple_fp)mi->fp[i++];
728 AI_PowerSwitch = (AI_PowerSwitch_fp)mi->fp[i++];
729 AI_TurnTowardsVectors = (AI_TurnTowardsVectors_fp)mi->fp[i++];
730 AI_SetType = (AI_SetType_fp)mi->fp[i++];
731 AI_FindHidePos = (AI_FindHidePos_fp)mi->fp[i++];
732 AI_GoalAddEnabler = (AI_GoalAddEnabler_fp)mi->fp[i++];
733 AI_AddGoal = (AI_AddGoal_fp)mi->fp[i++];
734 AI_ClearGoal = (AI_ClearGoal_fp)mi->fp[i++];
735 AI_Value = (AI_Value_fp)mi->fp[i++];
736 AI_FindObjOfTypeFP = (AI_FindObjOfType_fp)mi->fp[i++];
737 AI_GetRoomPathPoint = (AI_GetRoomPathPoint_fp)mi->fp[i++];
738 AI_FindEnergyCenter = (AI_FindEnergyCenter_fp)mi->fp[i++];
739 AI_GetDistToObj = (AI_GetDistToObj_fp)mi->fp[i++];
740 AI_SetGoalFlags = (AI_SetGoalFlags_fp)mi->fp[i++];
741 AI_SetGoalCircleDist = (AI_SetGoalCircleDist_fp)mi->fp[i++];
742 File_ReadBytes = (File_ReadBytes_fp)mi->fp[i++];
743 File_ReadInt = (File_ReadInt_fp)mi->fp[i++];
744 File_ReadShort = (File_ReadShort_fp)mi->fp[i++];
745 File_ReadByte = (File_ReadByte_fp)mi->fp[i++];
746 File_ReadFloat = (File_ReadFloat_fp)mi->fp[i++];
747 File_ReadDouble = (File_ReadDouble_fp)mi->fp[i++];
748 File_ReadString = (File_ReadString_fp)mi->fp[i++];
749 File_WriteBytes = (File_WriteBytes_fp)mi->fp[i++];
750 File_WriteString = (File_WriteString_fp)mi->fp[i++];
751 File_WriteInt = (File_WriteInt_fp)mi->fp[i++];
752 File_WriteShort = (File_WriteShort_fp)mi->fp[i++];
753 File_WriteByte = (File_WriteByte_fp)mi->fp[i++];
754 File_WriteFloat = (File_WriteFloat_fp)mi->fp[i++];
755 File_WriteDouble = (File_WriteDouble_fp)mi->fp[i++];
756 Scrpt_MemAlloc = (Scrpt_MemAlloc_fp)mi->fp[i++];
757 Scrpt_MemFree = (Scrpt_MemFree_fp)mi->fp[i++];
758 Scrpt_CancelTimer = (Scrpt_CancelTimer_fp)mi->fp[i++];
759 Scrpt_CreateTimer = (Scrpt_CreateTimer_fp)mi->fp[i++];
760 MSafe_DoPowerup = (MSafe_DoPowerup_fp)mi->fp[i++];
761 Obj_CreateFP = (Obj_Create_fp)mi->fp[i++];
762 Game_GetTime = (Game_GetTime_fp)mi->fp[i++];
763 Game_GetFrameTime = (Game_GetFrameTime_fp)mi->fp[i++];
764 Obj_WBValueFP = (Obj_WBValue_fp)mi->fp[i++];
765 Scrpt_TimerExists = (Scrpt_TimerExists_fp)mi->fp[i++];
766 Obj_ValueFP = (Obj_Value_fp)mi->fp[i++];
767 Matcen_ValueFP = (Matcen_Value_fp)mi->fp[i++];
768 Matcen_Reset = (Matcen_Reset_fp)mi->fp[i++];
769 Matcen_Copy = (Matcen_Copy_fp)mi->fp[i++];
770 Matcen_Create = (Matcen_Create_fp)mi->fp[i++];
771 Matcen_FindID = (Matcen_FindID_fp)mi->fp[i++];
772 Msn_FlagSet = (Msn_FlagSet_fp)mi->fp[i++];
773 Msn_FlagGet = (Msn_FlagGet_fp)mi->fp[i++];
774 Player_ValueFP = (Player_Value_fp)mi->fp[i++];
775 Obj_SetCustomAnimFP = (Obj_SetCustomAnim_fp)mi->fp[i++];
776 Player_AddHudMessage = (Player_AddHudMessage_fp)mi->fp[i++];
777 Obj_Ghost = (Obj_Ghost_fp)mi->fp[i++];
778 Obj_BurningFP = (Obj_Burning_fp)mi->fp[i++];
779 Obj_IsEffect = (Obj_IsEffect_fp)mi->fp[i++];
780 File_Open = (File_Open_fp)mi->fp[i++];
781 File_Close = (File_Close_fp)mi->fp[i++];
782 File_Tell = (File_Tell_fp)mi->fp[i++];
783 File_eof = (File_eof_fp)mi->fp[i++];
784 Sound_StopFP = (Sound_Stop_fp)mi->fp[i++];
785 Sound_Play2dFP = (Sound_Play2d_fp)mi->fp[i++];
786 Sound_Play3dFP = (Sound_Play3d_fp)mi->fp[i++];
787 Sound_FindId = (Sound_FindId_fp)mi->fp[i++];
788 AI_IsObjFriend = (AI_IsObjFriend_fp)mi->fp[i++];
789 AI_IsObjEnemy = (AI_IsObjEnemy_fp)mi->fp[i++];
790 AI_GoalValueFP = (AI_GoalValue_fp)mi->fp[i++];
791 AI_GetNearbyObjsFP = (AI_GetNearbyObjs_fp)mi->fp[i++];
792 AI_GetCurGoalIndex = (AI_GetCurGoalIndex_fp)mi->fp[i++];
793 OMMS_Malloc = (OMMS_Malloc_fp)mi->fp[i++];
794 OMMS_Attach = (OMMS_Attach_fp)mi->fp[i++];
795 OMMS_Detach = (OMMS_Detach_fp)mi->fp[i++];
796 OMMS_Free = (OMMS_Free_fp)mi->fp[i++];
797 OMMS_Find = (OMMS_Find_fp)mi->fp[i++];
798 OMMS_GetInfo = (OMMS_GetInfo_fp)mi->fp[i++];
799 Cine_Start = (Cine_Start_fp)mi->fp[i++];
800 Cine_Stop = (Cine_Stop_fp)mi->fp[i++];
801 Scrpt_FindSoundName = (Scrpt_FindSoundName_fp)mi->fp[i++];
802 Scrpt_FindRoomName = (Scrpt_FindRoomName_fp)mi->fp[i++];
803 Scrpt_FindTriggerName = (Scrpt_FindTriggerName_fp)mi->fp[i++];
804 Scrpt_FindObjectName = (Scrpt_FindObjectName_fp)mi->fp[i++];
805 Scrpt_GetTriggerRoom = (Scrpt_GetTriggerRoom_fp)mi->fp[i++];
806 Scrpt_GetTriggerFace = (Scrpt_GetTriggerFace_fp)mi->fp[i++];
807 Scrpt_FindDoorName = (Scrpt_FindDoorName_fp)mi->fp[i++];
808 Scrpt_FindTextureName = (Scrpt_FindTextureName_fp)mi->fp[i++];
809 Game_CreateRandomSparksFP = (Game_CreateRandomSparks_fp)mi->fp[i++];
810 Scrpt_CancelTimerID = (Scrpt_CancelTimerID_fp)mi->fp[i++];
811 Obj_GetGroundPosFP = (Obj_GetGroundPos_fp)mi->fp[i++];
812 Game_EnableShip = (Game_EnableShip_fp)mi->fp[i++];
813 Game_IsShipEnabled = (Game_IsShipEnabled_fp)mi->fp[i++];
814 Path_GetInformationFP = (Path_GetInformation_fp)mi->fp[i++];
815 Cine_StartCanned = (Cine_StartCanned_fp)mi->fp[i++];
816 Scrpt_FindMatcenName = (Scrpt_FindMatcenName_fp)mi->fp[i++];
817 Scrpt_FindPathName = (Scrpt_FindPathName_fp)mi->fp[i++];
818 Scrpt_FindLevelGoalName = (Scrpt_FindLevelGoalName_fp)mi->fp[i++];
819 Obj_FindType = (Obj_FindType_fp)mi->fp[i++];
820 LGoal_ValueFP = (LGoal_Value_fp)mi->fp[i++];
821 Obj_MakeListOfType = (Obj_MakeListOfType_fp)mi->fp[i++];
822 Obj_Kill = (Obj_Kill_fp)mi->fp[i++];
823 // AI_AreRoomsReachable = (AI_AreRoomsReachable_fp)mi->fp[i++];
824 AI_IsDestReachable = (AI_IsDestReachable_fp)mi->fp[i++];
825 AI_IsObjReachable = (AI_IsObjReachable_fp)mi->fp[i++];
826 Game_GetDiffLevel = (Game_GetDiffLevel_fp)mi->fp[i++];
827 Game_GetLanguage = (Game_GetLanguage_fp)mi->fp[i++];
828 Path_Value = (Path_Value_fp)mi->fp[i++];
829 }
830 #endif
831
832 #ifndef __OSIRIS_IMPORT_H_
833 #define __OSIRIS_IMPORT_H_
834 #endif