Debian Codegraph @

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