Debian Codegraph @

scripts/CellTestLevel.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
19 /////////////////////////////////////////////////////////////////////
20 // D.A.L.L.A.S. Generated Level Script - DLL Source File
21 //
22 // Filename: CellTestLevel.cpp
23 // Version: 3
24 /////////////////////////////////////////////////////////////////////
25 #include <stdio.h>
26 #include <stdlib.h>
27 #include <string.h>
28 #include <ctype.h>
29 #include "osiris_import.h"cxx . . $ `<file>/scripts/osiris_import.h`/
30 #include "osiris_common.h"cxx . . $ `<file>/scripts/osiris_common.h`/
31 #include "DallasFuncs.cpp"cxx . . $ `<file>/scripts/DallasFuncs.cpp`/
32
33 #include "module.h"cxx . . $ `<file>/lib/module.h`/
34
35 #ifdef __cpluspluscxx . . $ `<built-in>:467:9`!
36 extern "C" {
37 #endif
38 DLLEXPORTcxx . . $ `lib/module.h:114:9`! char STDCALLcxx . . $ `lib/module.h:88:11`! InitializeDLL(tOSIRISModuleInitcxx . . $ tOSIRISModuleInit# *func_list);
39 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void STDCALLcxx . . $ `lib/module.h:88:11`! ShutdownDLL(void);
40 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int STDCALLcxx . . $ `lib/module.h:88:11`! GetGOScriptID(const char *name, uint8_tcxx . . $ uint8_t# is_door);
41 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void STDCALLPTRcxx . . $ `lib/module.h:90:10`! CreateInstance(int id);
42 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void STDCALLcxx . . $ `lib/module.h:88:11`! DestroyInstance(int id, void *ptr);
43 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int16_t STDCALLcxx . . $ `lib/module.h:88:11`! CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data);
44 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int STDCALLcxx . . $ `lib/module.h:88:11`! GetTriggerScriptID(int trigger_room, int trigger_face);
45 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int STDCALLcxx . . $ `lib/module.h:88:11`! GetCOScriptList(int **list, int **id_list);
46 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int STDCALLcxx . . $ `lib/module.h:88:11`! SaveRestoreState(void *file_ptr, uint8_tcxx . . $ uint8_t# saving_state);
47 #ifdef __cpluspluscxx . . $ `<built-in>:467:9`!
48 }
49 #endif
50
51 // =================
52 // Script ID Numbers
53 // =================
54 #define ID_LEVEL_0000cxx . . $ `scripts/CellTestLevel.cpp:54:9`! 0x000
55
56 // ========================
57 // Script Class Definitions
58 // ========================
59
60 class BaseScriptcxx . . $ BaseScript# {
61 public:
62 BaseScriptcxx . . $ BaseScript#BaseScript(49f6e7a06ebc5aa8).();
63 ~cxx . . $ BaseScript#`~BaseScript`(ced63f7c635d850d).BaseScriptcxx . . $ BaseScript#();
64 virtual int16_t CallEventcxx . . $ BaseScript#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data);
65 };
66
67 class LevelScript_0000cxx . . $ LevelScript_0000# : public BaseScriptcxx . . $ BaseScript# {
68 public:
69 int16_t CallEventcxx . . $ LevelScript_0000#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data);
70 };
71
72 // ======================
73 // Global Action Counters
74 // ======================
75
76 #define MAX_ACTION_CTR_VALUEcxx . . $ `scripts/CellTestLevel.cpp:76:9`! 100000
77
78 int ScriptActionCtr_000cxx . . $ ScriptActionCtr_000. = 0;
79
80 // ========================================
81 // Function to Clear Global Action Counters
82 // ========================================
83 void ClearGlobalActionCtrscxx . . $ ClearGlobalActionCtrs(49f6e7a06ebc5aa8).(void) { ScriptActionCtr_000cxx . . $ ScriptActionCtr_000. = 0; }
84
85 // ========================================
86 // Function to Save Global Action Counters
87 // ========================================
88 void SaveGlobalActionCtrscxx . . $ SaveGlobalActionCtrs(5d22bdacc48458e8).(void *file_ptr) { File_WriteIntcxx . . $ File_WriteInt.(ScriptActionCtr_000cxx . . $ ScriptActionCtr_000., file_ptr); }
89
90 // ===========================================
91 // Function to Restore Global Action Counters
92 // ===========================================
93 void RestoreGlobalActionCtrscxx . . $ RestoreGlobalActionCtrs(5d22bdacc48458e8).(void *file_ptr) { ScriptActionCtr_000cxx . . $ ScriptActionCtr_000. = File_ReadIntcxx . . $ File_ReadInt.(file_ptr); }
94
95 // ===============================================================
96 // Start of Custom Script Block - DO NOT EDIT ANYTHING BEFORE THIS
97 // ===============================================================
98 /**{CUSTOM_SCRIPT_BLOCK_START}** DO NOT EDIT! **/
99
100 // Enter your custom script code here
101
102 /**{CUSTOM_SCRIPT_BLOCK_END}**** DO NOT EDIT! **/
103 // ============================================================
104 // End of Custom Script Block - DO NOT EDIT ANYTHING AFTER THIS
105 // ============================================================
106
107 // =================
108 // Message File Data
109 // =================
110
111 #define MAX_SCRIPT_MESSAGEScxx . . $ `scripts/CellTestLevel.cpp:111:9`! 256
112 #define MAX_MSG_FILEBUF_LENcxx . . $ `scripts/CellTestLevel.cpp:112:9`! 1024
113 #define NO_MESSAGE_STRINGcxx . . $ `scripts/CellTestLevel.cpp:113:9`! "*Message Not Found*"
114 #define INV_MSGNAME_STRINGcxx . . $ `scripts/CellTestLevel.cpp:114:9`! "*Message Name Invalid*"
115 #define WHITESPACE_CHARScxx . . $ `scripts/CellTestLevel.cpp:115:9`! " \t\r\n"
116
117 // Structure for storing a script message
118 struct tScriptMessagecxx . . $ tScriptMessage# {
119 char *namecxx . . $ tScriptMessage#name.; // the name of the message
120 char *messagecxx . . $ tScriptMessage#message.; // the actual message text
121 };
122
123 // Global storage for level script messages
124 tScriptMessagecxx . . $ tScriptMessage# *message_listcxx . . $ message_list.[MAX_SCRIPT_MESSAGEScxx . . $ `scripts/CellTestLevel.cpp:111:9`!];
125 int num_messagescxx . . $ num_messages.;
126
127 // ======================
128 // Message File Functions
129 // ======================
130
131 // Initializes the Message List
132 void InitMessageListcxx . . $ InitMessageList(49f6e7a06ebc5aa8).(void) {
133 for (int j = 0; j < MAX_SCRIPT_MESSAGEScxx . . $ `scripts/CellTestLevel.cpp:111:9`!; j++)
134 message_listcxx . . $ message_list.[j] = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
135 num_messagescxx . . $ num_messages. = 0;
136 }
137
138 // Clear the Message List
139 void ClearMessageListcxx . . $ ClearMessageList(49f6e7a06ebc5aa8).(void) {
140 for (int j = 0; j < num_messagescxx . . $ num_messages.; j++) {
141 freecxx . . $ free(bd21765a0afc8e3c).(message_listcxx . . $ message_list.[j]->namecxx . . $ tScriptMessage#name.);
142 freecxx . . $ free(bd21765a0afc8e3c).(message_listcxx . . $ message_list.[j]->messagecxx . . $ tScriptMessage#message.);
143 freecxx . . $ free(bd21765a0afc8e3c).(message_listcxx . . $ message_list.[j]);
144 message_listcxx . . $ message_list.[j] = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
145 }
146 num_messagescxx . . $ num_messages. = 0;
147 }
148
149 // Adds a message to the list
150 int AddMessageToListcxx . . $ AddMessageToList(e99f026884c896d5).(char *name, char *msg) {
151 int pos;
152
153 // Make sure there is room in the list
154 if (num_messagescxx . . $ num_messages. >= MAX_SCRIPT_MESSAGEScxx . . $ `scripts/CellTestLevel.cpp:111:9`!)
155 return false;
156
157 // Allocate memory for this message entry
158 pos = num_messagescxx . . $ num_messages.;
159 message_listcxx . . $ message_list.[pos] = (tScriptMessagecxx . . $ tScriptMessage# *)malloccxx . . $ malloc(9f008b2a9698428b).(sizeof(tScriptMessagecxx . . $ tScriptMessage#));
160 if (message_listcxx . . $ message_list.[pos] == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!)
161 return false;
162
163 // Allocate memory for the message name
164 message_listcxx . . $ message_list.[pos]->namecxx . . $ tScriptMessage#name. = (char *)malloccxx . . $ malloc(9f008b2a9698428b).(strlen(name) + 1);
165 if (message_listcxx . . $ message_list.[pos]->namecxx . . $ tScriptMessage#name. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) {
166 freecxx . . $ free(bd21765a0afc8e3c).(message_listcxx . . $ message_list.[pos]);
167 return false;
168 }
169 strcpy(message_listcxx . . $ message_list.[pos]->namecxx . . $ tScriptMessage#name., name);
170
171 // Allocate memory for the message name
172 message_listcxx . . $ message_list.[pos]->messagecxx . . $ tScriptMessage#message. = (char *)malloccxx . . $ malloc(9f008b2a9698428b).(strlen(msg) + 1);
173 if (message_listcxx . . $ message_list.[pos]->messagecxx . . $ tScriptMessage#message. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) {
174 freecxx . . $ free(bd21765a0afc8e3c).(message_listcxx . . $ message_list.[pos]->namecxx . . $ tScriptMessage#name.);
175 freecxx . . $ free(bd21765a0afc8e3c).(message_listcxx . . $ message_list.[pos]);
176 return false;
177 }
178 strcpy(message_listcxx . . $ message_list.[pos]->messagecxx . . $ tScriptMessage#message., msg);
179 num_messagescxx . . $ num_messages.++;
180
181 return true;
182 }
183
184 // Removes any whitespace padding from the end of a string
185 void RemoveTrailingWhitespacecxx . . $ RemoveTrailingWhitespace(fda57c8427c60377).(char *s) {
186 int last_char_pos;
187
188 last_char_pos = strlen(s) - 1;
189 while (last_char_pos >= 0 && isspace(s[last_char_pos])) {
190 s[last_char_pos] = '\0';
191 last_char_pos--;
192 }
193 }
194
195 // Returns a pointer to the first non-whitespace char in given string
196 char *SkipInitialWhitespacecxx . . $ SkipInitialWhitespace(7a9722d75b371431).(char *s) {
197 while ((*s) != '\0' && isspace(*s))
198 s++;
199
200 return (s);
201 }
202
203 // Read in the Messages
204 int ReadMessageFilecxx . . $ ReadMessageFile(5c4306d8553b3696).(const char *filename) {
205 void *infile;
206 char filebuffer[MAX_MSG_FILEBUF_LENcxx . . $ `scripts/CellTestLevel.cpp:112:9`! + 1];
207 char *line, *msg_start;
208 int line_num;
209 bool next_msgid_found;
210
211 // Try to open the file for loading
212 infile = File_Opencxx . . $ File_Open.(filename, "rt");
213 if (!infile)
214 return false;
215
216 line_num = 0;
217 next_msgid_found = true;
218
219 // Clear the message list
220 ClearMessageListcxx . . $ ClearMessageList(49f6e7a06ebc5aa8).();
221
222 // Read in and parse each line of the file
223 while (!File_eofcxx . . $ File_eof.(infile)) {
224
225 // Clear the buffer
226 strcpy(filebuffer, "");
227
228 // Read in a line from the file
229 File_ReadStringcxx . . $ File_ReadString.(filebuffer, MAX_MSG_FILEBUF_LENcxx . . $ `scripts/CellTestLevel.cpp:112:9`!, infile);
230 line_num++;
231
232 // Remove whitespace padding at start and end of line
233 RemoveTrailingWhitespacecxx . . $ RemoveTrailingWhitespace(fda57c8427c60377).(filebuffer);
234 line = SkipInitialWhitespacecxx . . $ SkipInitialWhitespace(7a9722d75b371431).(filebuffer);
235
236 // If line is a comment, or empty, discard it
237 if (strlen(line) == 0 || strncmp(line, "//", 2) == 0)
238 continue;
239
240 if (!next_msgid_found) { // Parse out the last message ID number
241
242 // Grab the first keyword, make sure it's valid
243 line = strtok(line, WHITESPACE_CHARScxx . . $ `scripts/CellTestLevel.cpp:115:9`!);
244 if (line == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!)
245 continue;
246
247 // Grab the second keyword, and assign it as the next message ID
248 line = strtok(NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, WHITESPACE_CHARScxx . . $ `scripts/CellTestLevel.cpp:115:9`!);
249 if (line == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!)
250 continue;
251
252 next_msgid_found = true;
253 } else { // Parse line as a message line
254
255 // Find the start of message, and mark it
256 msg_start = strchr(line, '=');
257 if (msg_start == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!)
258 continue;
259 msg_start[0] = '\0';
260 msg_start++;
261
262 // Add the message to the list
263 AddMessageToListcxx . . $ AddMessageToList(e99f026884c896d5).(line, msg_start);
264 }
265 }
266 File_Closecxx . . $ File_Close.(infile);
267
268 return true;
269 }
270
271 // Find a message
272 const char *GetMessagecxx . . $ GetMessage(fb58d2e09a2a1ce6).(const char *name) {
273 // Make sure given name is valid
274 if (name == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!)
275 return INV_MSGNAME_STRINGcxx . . $ `scripts/CellTestLevel.cpp:114:9`!;
276
277 // Search message list for name
278 for (int j = 0; j < num_messagescxx . . $ num_messages.; j++)
279 if (strcmp(message_listcxx . . $ message_list.[j]->namecxx . . $ tScriptMessage#name., name) == 0)
280 return (message_listcxx . . $ message_list.[j]->messagecxx . . $ tScriptMessage#message.);
281
282 // Couldn't find it
283 return NO_MESSAGE_STRINGcxx . . $ `scripts/CellTestLevel.cpp:113:9`!;
284 }
285
286 //======================
287 // Name List Arrays
288 //======================
289
290 #define NUM_DOOR_NAMEScxx . . $ `scripts/CellTestLevel.cpp:290:9`! 0
291 const char **Door_namescxx . . $ Door_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
292 int *Door_handlescxx . . $ Door_handles. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
293
294 #define NUM_OBJECT_NAMEScxx . . $ `scripts/CellTestLevel.cpp:294:9`! 1
295 const char *Object_namescxx . . $ Object_names.[NUM_OBJECT_NAMEScxx . . $ `scripts/CellTestLevel.cpp:294:9`!] = {"CoreSound"};
296 int Object_handlescxx . . $ Object_handles.[NUM_OBJECT_NAMEScxx . . $ `scripts/CellTestLevel.cpp:294:9`!];
297
298 #define NUM_ROOM_NAMEScxx . . $ `scripts/CellTestLevel.cpp:298:9`! 0
299 const char **Room_namescxx . . $ Room_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
300 int *Room_indexescxx . . $ Room_indexes. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
301
302 #define NUM_TRIGGER_NAMEScxx . . $ `scripts/CellTestLevel.cpp:302:9`! 0
303 const char **Trigger_namescxx . . $ Trigger_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
304 int *Trigger_indexescxx . . $ Trigger_indexes. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
305 int *Trigger_facescxx . . $ Trigger_faces. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
306 int *Trigger_roomscxx . . $ Trigger_rooms. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
307
308 #define NUM_SOUND_NAMEScxx . . $ `scripts/CellTestLevel.cpp:308:9`! 1
309 const char *Sound_namescxx . . $ Sound_names.[NUM_SOUND_NAMEScxx . . $ `scripts/CellTestLevel.cpp:308:9`!] = {"AmbDroneCaveWind"};
310 int Sound_indexescxx . . $ Sound_indexes.[NUM_SOUND_NAMEScxx . . $ `scripts/CellTestLevel.cpp:308:9`!];
311
312 #define NUM_TEXTURE_NAMEScxx . . $ `scripts/CellTestLevel.cpp:312:9`! 0
313 const char **Texture_namescxx . . $ Texture_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
314 int *Texture_indexescxx . . $ Texture_indexes. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
315
316 #define NUM_PATH_NAMEScxx . . $ `scripts/CellTestLevel.cpp:316:9`! 0
317 const char **Path_namescxx . . $ Path_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
318 int *Path_indexescxx . . $ Path_indexes. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
319
320 #define NUM_MATCEN_NAMEScxx . . $ `scripts/CellTestLevel.cpp:320:9`! 0
321 const char **Matcen_namescxx . . $ Matcen_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
322 int *Matcen_indexescxx . . $ Matcen_indexes. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
323
324 #define NUM_GOAL_NAMEScxx . . $ `scripts/CellTestLevel.cpp:324:9`! 0
325 const char **Goal_namescxx . . $ Goal_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
326 int *Goal_indexescxx . . $ Goal_indexes. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
327
328 #define NUM_MESSAGE_NAMEScxx . . $ `scripts/CellTestLevel.cpp:328:9`! 0
329 const char **Message_namescxx . . $ Message_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
330 const char **Message_stringscxx . . $ Message_strings. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
331
332 // ===============
333 // InitializeDLL()
334 // ===============
335 char STDCALLcxx . . $ `lib/module.h:88:11`! InitializeDLLcxx . . $ InitializeDLL(f9aae224659b2173).(tOSIRISModuleInitcxx . . $ tOSIRISModuleInit# *func_list) {
336 osicommon_Initializecxx . . $ osicommon_Initialize(5a9437a4d944b175).((tOSIRISModuleInitcxx . . $ tOSIRISModuleInit# *)func_list);
337 if (func_list->game_checksumcxx . . $ tOSIRISModuleInit#game_checksum. != CHECKSUMcxx . . $ `<built-in>:476:9`!) {
338 mprintfcxx . . $ mprintf.(0, "Game-Checksum FAIL!!! (%ul!=%ul)\n", func_list->game_checksumcxx . . $ tOSIRISModuleInit#game_checksum., CHECKSUMcxx . . $ `<built-in>:476:9`!);
339 mprintfcxx . . $ mprintf.(0, "RECOMPILE YOUR SCRIPTS!!!\n");
340 return 0;
341 }
342
343 ClearGlobalActionCtrscxx . . $ ClearGlobalActionCtrs(49f6e7a06ebc5aa8).();
344 dfInitcxx . . $ dfInit(49f6e7a06ebc5aa8).();
345 InitMessageListcxx . . $ InitMessageList(49f6e7a06ebc5aa8).();
346
347 // Build the filename of the message file
348 char filename[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`! + 32];
349 int lang_type;
350 if (func_list->script_identifiercxx . . $ tOSIRISModuleInit#script_identifier. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) {
351 _splitpathcxx . . $ _splitpath(f70bbbea1d7ce513).(func_list->script_identifiercxx . . $ tOSIRISModuleInit#script_identifier., NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, filename, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!);
352 lang_type = Game_GetLanguagecxx . . $ Game_GetLanguage.();
353 if (lang_type == LANGUAGE_FRENCHcxx . . $ `scripts/osiris_common.h:416:9`!)
354 strcat(filename, "_FRN");
355 else if (lang_type == LANGUAGE_GERMANcxx . . $ `scripts/osiris_common.h:413:9`!)
356 strcat(filename, "_GER");
357 else if (lang_type == LANGUAGE_ITALIANcxx . . $ `scripts/osiris_common.h:415:9`!)
358 strcat(filename, "_ITN");
359 else if (lang_type == LANGUAGE_SPANISHcxx . . $ `scripts/osiris_common.h:414:9`!)
360 strcat(filename, "_SPN");
361 strcat(filename, ".msg");
362 } else {
363 strcpy(filename, "CellTestLevel.msg");
364 lang_type = LANGUAGE_ENGLISHcxx . . $ `scripts/osiris_common.h:412:9`!;
365 }
366 if (!ReadMessageFilecxx . . $ ReadMessageFile(5c4306d8553b3696).(filename)) {
367 mprintfcxx . . $ mprintf.(0, "ERROR: Could not load message file - %s\n", filename);
368 }
369
370 int j;
371
372 // Do Door Index lookups
373 for (j = 0; j < NUM_DOOR_NAMEScxx . . $ `scripts/CellTestLevel.cpp:290:9`!; j++)
374 Door_handlescxx . . $ Door_handles.[j] = Scrpt_FindDoorNamecxx . . $ Scrpt_FindDoorName.(Door_namescxx . . $ Door_names.[j]);
375
376 // Do Object Index lookups
377 for (j = 0; j < NUM_OBJECT_NAMEScxx . . $ `scripts/CellTestLevel.cpp:294:9`!; j++)
378 Object_handlescxx . . $ Object_handles.[j] = Scrpt_FindObjectNamecxx . . $ Scrpt_FindObjectName.(Object_namescxx . . $ Object_names.[j]);
379
380 // Do Room Index lookups
381 for (j = 0; j < NUM_ROOM_NAMEScxx . . $ `scripts/CellTestLevel.cpp:298:9`!; j++)
382 Room_indexescxx . . $ Room_indexes.[j] = Scrpt_FindRoomNamecxx . . $ Scrpt_FindRoomName.(Room_namescxx . . $ Room_names.[j]);
383
384 // Do Trigger Index lookups
385 for (j = 0; j < NUM_TRIGGER_NAMEScxx . . $ `scripts/CellTestLevel.cpp:302:9`!; j++) {
386 Trigger_indexescxx . . $ Trigger_indexes.[j] = Scrpt_FindTriggerNamecxx . . $ Scrpt_FindTriggerName.(Trigger_namescxx . . $ Trigger_names.[j]);
387 Trigger_facescxx . . $ Trigger_faces.[j] = Scrpt_GetTriggerFacecxx . . $ Scrpt_GetTriggerFace.(Trigger_indexescxx . . $ Trigger_indexes.[j]);
388 Trigger_roomscxx . . $ Trigger_rooms.[j] = Scrpt_GetTriggerRoomcxx . . $ Scrpt_GetTriggerRoom.(Trigger_indexescxx . . $ Trigger_indexes.[j]);
389 }
390
391 // Do Sound Index lookups
392 for (j = 0; j < NUM_SOUND_NAMEScxx . . $ `scripts/CellTestLevel.cpp:308:9`!; j++)
393 Sound_indexescxx . . $ Sound_indexes.[j] = Scrpt_FindSoundNamecxx . . $ Scrpt_FindSoundName.(Sound_namescxx . . $ Sound_names.[j]);
394
395 // Do Texture Index lookups
396 for (j = 0; j < NUM_TEXTURE_NAMEScxx . . $ `scripts/CellTestLevel.cpp:312:9`!; j++)
397 Texture_indexescxx . . $ Texture_indexes.[j] = Scrpt_FindTextureNamecxx . . $ Scrpt_FindTextureName.(Texture_namescxx . . $ Texture_names.[j]);
398
399 // Do Path Index lookups
400 for (j = 0; j < NUM_PATH_NAMEScxx . . $ `scripts/CellTestLevel.cpp:316:9`!; j++)
401 Path_indexescxx . . $ Path_indexes.[j] = Scrpt_FindPathNamecxx . . $ Scrpt_FindPathName.(Path_namescxx . . $ Path_names.[j]);
402
403 // Do Matcen Index lookups
404 for (j = 0; j < NUM_MATCEN_NAMEScxx . . $ `scripts/CellTestLevel.cpp:320:9`!; j++)
405 Matcen_indexescxx . . $ Matcen_indexes.[j] = Scrpt_FindMatcenNamecxx . . $ Scrpt_FindMatcenName.(Matcen_namescxx . . $ Matcen_names.[j]);
406
407 // Do Goal Index lookups
408 for (j = 0; j < NUM_GOAL_NAMEScxx . . $ `scripts/CellTestLevel.cpp:324:9`!; j++)
409 Goal_indexescxx . . $ Goal_indexes.[j] = Scrpt_FindLevelGoalNamecxx . . $ Scrpt_FindLevelGoalName.(Goal_namescxx . . $ Goal_names.[j]);
410
411 // Do Message Name lookups
412 for (j = 0; j < NUM_MESSAGE_NAMEScxx . . $ `scripts/CellTestLevel.cpp:328:9`!; j++)
413 Message_stringscxx . . $ Message_strings.[j] = GetMessagecxx . . $ GetMessage(fb58d2e09a2a1ce6).(Message_namescxx . . $ Message_names.[j]);
414
415 return 1;
416 }
417
418 // =============
419 // ShutdownDLL()
420 // =============
421 void STDCALLcxx . . $ `lib/module.h:88:11`! ShutdownDLLcxx . . $ ShutdownDLL(49f6e7a06ebc5aa8).(void) { ClearMessageListcxx . . $ ClearMessageList(49f6e7a06ebc5aa8).(); }
422
423 // ===============
424 // GetGOScriptID()
425 // ===============
426 int STDCALLcxx . . $ `lib/module.h:88:11`! GetGOScriptIDcxx . . $ GetGOScriptID(a2648ab7e2ef960e).(const char *name, uint8_tcxx . . $ uint8_t# isdoor) { return -1; }
427
428 // ================
429 // CreateInstance()
430 // ================
431 void STDCALLPTRcxx . . $ `lib/module.h:90:10`! CreateInstancecxx . . $ CreateInstance(d1680a912d714170).(int id) {
432 switch (id) {
433 case ID_LEVEL_0000cxx . . $ `scripts/CellTestLevel.cpp:54:9`!:
434 return new LevelScript_0000cxx . . $ LevelScript_0000#;
435 break;
436 default:
437 mprintfcxx . . $ mprintf.(0, "SCRIPT: Illegal ID (%d)\n", id);
438 break;
439 }
440 return NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
441 }
442
443 // =================
444 // DestroyInstance()
445 // =================
446 void STDCALLcxx . . $ `lib/module.h:88:11`! DestroyInstancecxx . . $ DestroyInstance(6ca3d68f5c5f0975).(int id, void *ptr) {
447 switch (id) {
448 case ID_LEVEL_0000cxx . . $ `scripts/CellTestLevel.cpp:54:9`!:
449 delete ((LevelScript_0000cxx . . $ LevelScript_0000# *)ptr);
450 default:
451 mprintfcxx . . $ mprintf.(0, "SCRIPT: Illegal ID (%d)\n", id);
452 break;
453 }
454 }
455
456 // ===================
457 // CallInstanceEvent()
458 // ===================
459 int16_t STDCALLcxx . . $ `lib/module.h:88:11`! CallInstanceEventcxx . . $ CallInstanceEvent(79be2a5a01598f29).(int id, void *ptr, int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) {
460 switch (id) {
461 case ID_LEVEL_0000cxx . . $ `scripts/CellTestLevel.cpp:54:9`!:
462 return ((BaseScriptcxx . . $ BaseScript# *)ptr)->CallEventcxx . . $ BaseScript#CallEvent(585a6502c7945bab).(event, data);
463 break;
464 default:
465 mprintfcxx . . $ mprintf.(0, "SCRIPT: Illegal ID (%d)\n", id);
466 break;
467 }
468 return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!;
469 }
470
471 // ==================
472 // SaveRestoreState()
473 // ==================
474 int STDCALLcxx . . $ `lib/module.h:88:11`! SaveRestoreStatecxx . . $ SaveRestoreState(5276b51c10b71c09).(void *file_ptr, uint8_tcxx . . $ uint8_t# saving_state) { return 0; }
475
476 // ====================
477 // GetTriggerScriptID()
478 // ====================
479 int STDCALLcxx . . $ `lib/module.h:88:11`! GetTriggerScriptIDcxx . . $ GetTriggerScriptID(9b79fb6aee4c0440).(int trigger_room, int trigger_face) { return -1; }
480
481 // =================
482 // GetCOScriptList()
483 // =================
484 int STDCALLcxx . . $ `lib/module.h:88:11`! GetCOScriptListcxx . . $ GetCOScriptList(4454eefbcea844d6).(int **list, int **id_list) {
485 static int *cust_handle_list = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
486 static int *cust_id_list = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!;
487
488 *list = cust_handle_list;
489 *id_list = cust_id_list;
490
491 return 0;
492 }
493
494 //=======================
495 // Script Implementation
496 //=======================
497
498 BaseScriptcxx . . $ BaseScript#::BaseScriptcxx . . $ BaseScript#BaseScript(49f6e7a06ebc5aa8).() {}
499
500 BaseScriptcxx . . $ BaseScript#::~cxx . . $ BaseScript#`~BaseScript`(ced63f7c635d850d).BaseScriptcxx . . $ BaseScript#() {}
501
502 int16_t BaseScriptcxx . . $ BaseScript#::CallEventcxx . . $ BaseScript#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) {
503 mprintfcxx . . $ mprintf.(0, "BaseScript::CallEvent()\n");
504 return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!;
505 }
506
507 int16_t LevelScript_0000cxx . . $ LevelScript_0000#::CallEventcxx . . $ LevelScript_0000#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) {
508 switch (event) {
509 case EVT_SAVESTATEcxx . . $ `scripts/osiris_common.h:376:9`!: {
510 tOSIRISEVTSAVESTATEcxx . . $ tOSIRISEVTSAVESTATE# *event_data = &data->evt_savestatecxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_savestate.;
511
512 SaveGlobalActionCtrscxx . . $ SaveGlobalActionCtrs(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTSAVESTATE#fileptr.);
513 dfSavecxx . . $ dfSave(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTSAVESTATE#fileptr.);
514 #ifdef ENABLE_CUSTOM_SAVE_AND_RESTORE
515 dsCustomSave(event_data->fileptr);
516 #endif
517 } break;
518 case EVT_RESTORESTATEcxx . . $ `scripts/osiris_common.h:377:9`!: {
519 tOSIRISEVTRESTORESTATEcxx . . $ tOSIRISEVTRESTORESTATE# *event_data = &data->evt_restorestatecxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_restorestate.;
520
521 RestoreGlobalActionCtrscxx . . $ RestoreGlobalActionCtrs(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTRESTORESTATE#fileptr.);
522 dfRestorecxx . . $ dfRestore(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTRESTORESTATE#fileptr.);
523 #ifdef ENABLE_CUSTOM_SAVE_AND_RESTORE
524 dsCustomRestore(event_data->fileptr);
525 #endif
526 } break;
527 case EVT_LEVELSTARTcxx . . $ `scripts/osiris_common.h:373:9`!: {
528 tOSIRISEVTLEVELSTARTcxx . . $ tOSIRISEVTLEVELSTART# *event_data = &data->evt_levelstartcxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_levelstart.;
529
530 ClearGlobalActionCtrscxx . . $ ClearGlobalActionCtrs(49f6e7a06ebc5aa8).();
531 dfInitcxx . . $ dfInit(49f6e7a06ebc5aa8).();
532
533 // Script 000: Core Sound
534 if (1) {
535 aSoundPlayObjectcxx . . $ aSoundPlayObject(c2f439e40e2f19ed).(Sound_indexescxx . . $ Sound_indexes.[0], Object_handlescxx . . $ Object_handles.[0], 1.000000f);
536
537 // Increment the script action counter
538 if (ScriptActionCtr_000cxx . . $ ScriptActionCtr_000. < MAX_ACTION_CTR_VALUEcxx . . $ `scripts/CellTestLevel.cpp:76:9`!)
539 ScriptActionCtr_000cxx . . $ ScriptActionCtr_000.++;
540 }
541 } break;
542 }
543 return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!;
544 }
545
546 /*********************************************************
547 Script Save Block: DO NOT TOUCH ANYTHING IN THIS BLOCK!!!
548 **********************************************************
549 $$SCRIPT_BLOCK_START
550
551 VERSION 3
552 NEXT_ID 1
553
554 // UserType value blocks
555 $$UTYPE_VALS_START UserVar
556 $$UTYPE_VALS_END
557
558 $$UTYPE_VALS_START UserFlag
559 $$UTYPE_VALS_END
560
561 $$UTYPE_VALS_START SpewHandle
562 $$UTYPE_VALS_END
563
564 $$UTYPE_VALS_START TimerID
565 $$UTYPE_VALS_END
566
567 $$UTYPE_VALS_START SavedObjectSlot
568 $$UTYPE_VALS_END
569
570 $$UTYPE_VALS_START GoalID
571 $$UTYPE_VALS_END
572
573
574 // Name Lists
575 $$DOOR_LIST_START
576 $$DOOR_LIST_END
577
578 $$OBJECT_LIST_START
579 CoreSound
580 $$OBJECT_LIST_END
581
582 $$ROOM_LIST_START
583 $$ROOM_LIST_END
584
585 $$TRIGGER_LIST_START
586 $$TRIGGER_LIST_END
587
588 $$SOUND_LIST_START
589 AmbDroneCaveWind
590 $$SOUND_LIST_END
591
592 $$TEXTURE_LIST_START
593 $$TEXTURE_LIST_END
594
595 $$SPECNAME_LIST_START
596 $$SPECNAME_LIST_END
597
598 $$PATH_LIST_START
599 $$PATH_LIST_END
600
601 $$MATCEN_LIST_START
602 $$MATCEN_LIST_END
603
604 $$GOAL_LIST_START
605 $$GOAL_LIST_END
606
607 $$STRM_AUDIO_LIST_START
608 $$STRM_AUDIO_LIST_END
609
610
611 // Script Tree Dump
612 00:0:Core Sound
613 $$CHILD_BLOCK_START
614 01:2:0
615 02:6
616 03:0
617 $$CHILD_BLOCK_START
618 05:0
619 $$CHILD_BLOCK_END
620 04:0:0:0
621 $$CHILD_BLOCK_START
622 08:aSoundPlayObject
623 $$CHILD_BLOCK_START
624 10:12:0:Sound
625 10:1:0:0:Object
626 10:9:1.000000:Volume
627 $$CHILD_BLOCK_END
628 $$CHILD_BLOCK_END
629 $$CHILD_BLOCK_END
630
631 $$SCRIPT_BLOCK_END
632 *********************************************************/