Debian Codegraph @

scripts/barney.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: barney.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/barney.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/barney.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/barney.cpp:109:9`! 256
110 #define MAX_MSG_FILEBUF_LENcxx . . $ `scripts/barney.cpp:110:9`! 1024
111 #define NO_MESSAGE_STRINGcxx . . $ `scripts/barney.cpp:111:9`! "*Message Not Found*"
112 #define INV_MSGNAME_STRINGcxx . . $ `scripts/barney.cpp:112:9`! "*Message Name Invalid*"
113 #define WHITESPACE_CHARScxx . . $ `scripts/barney.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/barney.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/barney.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/barney.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/barney.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/barney.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/barney.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/barney.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/barney.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/barney.cpp:111:9`!;
282 }
283
284 //======================
285 // Name List Arrays
286 //======================
287
288 #define NUM_DOOR_NAMEScxx . . $ `scripts/barney.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/barney.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/barney.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/barney.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/barney.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/barney.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/barney.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/barney.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/barney.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/barney.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 ReadMessageFilecxx . . $ ReadMessageFile(5c4306d8553b3696).("barney.msg");
345
346 int j;
347
348 // Do Door Index lookups
349 for (j = 0; j < NUM_DOOR_NAMEScxx . . $ `scripts/barney.cpp:288:9`!; j++)
350 Door_handlescxx . . $ Door_handles.[j] = Scrpt_FindDoorNamecxx . . $ Scrpt_FindDoorName.(Door_namescxx . . $ Door_names.[j]);
351
352 // Do Object Index lookups
353 for (j = 0; j < NUM_OBJECT_NAMEScxx . . $ `scripts/barney.cpp:292:9`!; j++)
354 Object_handlescxx . . $ Object_handles.[j] = Scrpt_FindObjectNamecxx . . $ Scrpt_FindObjectName.(Object_namescxx . . $ Object_names.[j]);
355
356 // Do Room Index lookups
357 for (j = 0; j < NUM_ROOM_NAMEScxx . . $ `scripts/barney.cpp:296:9`!; j++)
358 Room_indexescxx . . $ Room_indexes.[j] = Scrpt_FindRoomNamecxx . . $ Scrpt_FindRoomName.(Room_namescxx . . $ Room_names.[j]);
359
360 // Do Trigger Index lookups
361 for (j = 0; j < NUM_TRIGGER_NAMEScxx . . $ `scripts/barney.cpp:300:9`!; j++) {
362 Trigger_indexescxx . . $ Trigger_indexes.[j] = Scrpt_FindTriggerNamecxx . . $ Scrpt_FindTriggerName.(Trigger_namescxx . . $ Trigger_names.[j]);
363 Trigger_facescxx . . $ Trigger_faces.[j] = Scrpt_GetTriggerFacecxx . . $ Scrpt_GetTriggerFace.(Trigger_indexescxx . . $ Trigger_indexes.[j]);
364 Trigger_roomscxx . . $ Trigger_rooms.[j] = Scrpt_GetTriggerRoomcxx . . $ Scrpt_GetTriggerRoom.(Trigger_indexescxx . . $ Trigger_indexes.[j]);
365 }
366
367 // Do Sound Index lookups
368 for (j = 0; j < NUM_SOUND_NAMEScxx . . $ `scripts/barney.cpp:306:9`!; j++)
369 Sound_indexescxx . . $ Sound_indexes.[j] = Scrpt_FindSoundNamecxx . . $ Scrpt_FindSoundName.(Sound_namescxx . . $ Sound_names.[j]);
370
371 // Do Texture Index lookups
372 for (j = 0; j < NUM_TEXTURE_NAMEScxx . . $ `scripts/barney.cpp:310:9`!; j++)
373 Texture_indexescxx . . $ Texture_indexes.[j] = Scrpt_FindTextureNamecxx . . $ Scrpt_FindTextureName.(Texture_namescxx . . $ Texture_names.[j]);
374
375 // Do Path Index lookups
376 for (j = 0; j < NUM_PATH_NAMEScxx . . $ `scripts/barney.cpp:314:9`!; j++)
377 Path_indexescxx . . $ Path_indexes.[j] = Scrpt_FindPathNamecxx . . $ Scrpt_FindPathName.(Path_namescxx . . $ Path_names.[j]);
378
379 // Do Matcen Index lookups
380 for (j = 0; j < NUM_MATCEN_NAMEScxx . . $ `scripts/barney.cpp:318:9`!; j++)
381 Matcen_indexescxx . . $ Matcen_indexes.[j] = Scrpt_FindMatcenNamecxx . . $ Scrpt_FindMatcenName.(Matcen_namescxx . . $ Matcen_names.[j]);
382
383 // Do Goal Index lookups
384 for (j = 0; j < NUM_GOAL_NAMEScxx . . $ `scripts/barney.cpp:322:9`!; j++)
385 Goal_indexescxx . . $ Goal_indexes.[j] = Scrpt_FindLevelGoalNamecxx . . $ Scrpt_FindLevelGoalName.(Goal_namescxx . . $ Goal_names.[j]);
386
387 // Do Message Name lookups
388 for (j = 0; j < NUM_MESSAGE_NAMEScxx . . $ `scripts/barney.cpp:326:9`!; j++)
389 Message_stringscxx . . $ Message_strings.[j] = GetMessagecxx . . $ GetMessage(fb58d2e09a2a1ce6).(Message_namescxx . . $ Message_names.[j]);
390
391 return 1;
392 }
393
394 // =============
395 // ShutdownDLL()
396 // =============
397 void STDCALLcxx . . $ `lib/module.h:88:11`! ShutdownDLLcxx . . $ ShutdownDLL(49f6e7a06ebc5aa8).(void) { ClearMessageListcxx . . $ ClearMessageList(49f6e7a06ebc5aa8).(); }
398
399 // ===============
400 // GetGOScriptID()
401 // ===============
402 int STDCALLcxx . . $ `lib/module.h:88:11`! GetGOScriptIDcxx . . $ GetGOScriptID(a2648ab7e2ef960e).(const char *name, uint8_tcxx . . $ uint8_t# isdoor) { return -1; }
403
404 // ================
405 // CreateInstance()
406 // ================
407 void STDCALLPTRcxx . . $ `lib/module.h:90:10`! CreateInstancecxx . . $ CreateInstance(d1680a912d714170).(int id) {
408 switch (id) {
409 case ID_LEVEL_0000cxx . . $ `scripts/barney.cpp:54:9`!:
410 return new LevelScript_0000cxx . . $ LevelScript_0000#;
411 break;
412 default:
413 mprintfcxx . . $ mprintf.(0, "SCRIPT: Illegal ID (%d)\n", id);
414 break;
415 }
416 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
417 }
418
419 // =================
420 // DestroyInstance()
421 // =================
422 void STDCALLcxx . . $ `lib/module.h:88:11`! DestroyInstancecxx . . $ DestroyInstance(6ca3d68f5c5f0975).(int id, void *ptr) {
423 switch (id) {
424 case ID_LEVEL_0000cxx . . $ `scripts/barney.cpp:54:9`!:
425 delete ((LevelScript_0000cxx . . $ LevelScript_0000# *)ptr);
426 default:
427 mprintfcxx . . $ mprintf.(0, "SCRIPT: Illegal ID (%d)\n", id);
428 break;
429 }
430 }
431
432 // ===================
433 // CallInstanceEvent()
434 // ===================
435 int16_t STDCALLcxx . . $ `lib/module.h:88:11`! CallInstanceEventcxx . . $ CallInstanceEvent(79be2a5a01598f29).(int id, void *ptr, int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) {
436 switch (id) {
437 case ID_LEVEL_0000cxx . . $ `scripts/barney.cpp:54:9`!:
438 return ((BaseScriptcxx . . $ BaseScript# *)ptr)->CallEventcxx . . $ BaseScript#CallEvent(585a6502c7945bab).(event, data);
439 break;
440 default:
441 mprintfcxx . . $ mprintf.(0, "SCRIPT: Illegal ID (%d)\n", id);
442 break;
443 }
444 return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!;
445 }
446
447 // ==================
448 // SaveRestoreState()
449 // ==================
450 int STDCALLcxx . . $ `lib/module.h:88:11`! SaveRestoreStatecxx . . $ SaveRestoreState(5276b51c10b71c09).(void *file_ptr, uint8_tcxx . . $ uint8_t# saving_state) { return 0; }
451
452 // ====================
453 // GetTriggerScriptID()
454 // ====================
455 int STDCALLcxx . . $ `lib/module.h:88:11`! GetTriggerScriptIDcxx . . $ GetTriggerScriptID(9b79fb6aee4c0440).(int trigger_room, int trigger_face) { return -1; }
456
457 // =================
458 // GetCOScriptList()
459 // =================
460 int STDCALLcxx . . $ `lib/module.h:88:11`! GetCOScriptListcxx . . $ GetCOScriptList(4454eefbcea844d6).(int **list, int **id_list) {
461 static int *cust_handle_list = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
462 static int *cust_id_list = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
463
464 *list = cust_handle_list;
465 *id_list = cust_id_list;
466
467 return 0;
468 }
469
470 //=======================
471 // Script Implementation
472 //=======================
473
474 BaseScriptcxx . . $ BaseScript#::BaseScriptcxx . . $ BaseScript#BaseScript(49f6e7a06ebc5aa8).() {}
475
476 BaseScriptcxx . . $ BaseScript#::~cxx . . $ BaseScript#`~BaseScript`(ced63f7c635d850d).BaseScriptcxx . . $ BaseScript#() {}
477
478 int16_t BaseScriptcxx . . $ BaseScript#::CallEventcxx . . $ BaseScript#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) {
479 mprintfcxx . . $ mprintf.(0, "BaseScript::CallEvent()\n");
480 return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!;
481 }
482
483 int16_t LevelScript_0000cxx . . $ LevelScript_0000#::CallEventcxx . . $ LevelScript_0000#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) {
484 switch (event) {
485 case EVT_SAVESTATEcxx . . $ `scripts/osiris_common.h:376:9`!: {
486 tOSIRISEVTSAVESTATEcxx . . $ tOSIRISEVTSAVESTATE# *event_data = &data->evt_savestatecxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_savestate.;
487
488 SaveGlobalActionCtrscxx . . $ SaveGlobalActionCtrs(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTSAVESTATE#fileptr.);
489 dfSavecxx . . $ dfSave(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTSAVESTATE#fileptr.);
490 } break;
491 case EVT_RESTORESTATEcxx . . $ `scripts/osiris_common.h:377:9`!: {
492 tOSIRISEVTRESTORESTATEcxx . . $ tOSIRISEVTRESTORESTATE# *event_data = &data->evt_restorestatecxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_restorestate.;
493
494 RestoreGlobalActionCtrscxx . . $ RestoreGlobalActionCtrs(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTRESTORESTATE#fileptr.);
495 dfRestorecxx . . $ dfRestore(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTRESTORESTATE#fileptr.);
496 } break;
497 case EVT_LEVELSTARTcxx . . $ `scripts/osiris_common.h:373:9`!: {
498 tOSIRISEVTLEVELSTARTcxx . . $ tOSIRISEVTLEVELSTART# *event_data = &data->evt_levelstartcxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_levelstart.;
499
500 ClearGlobalActionCtrscxx . . $ ClearGlobalActionCtrs(49f6e7a06ebc5aa8).();
501 dfInitcxx . . $ dfInit(49f6e7a06ebc5aa8).();
502 } break;
503 }
504 return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!;
505 }
506
507 /*********************************************************
508 Script Save Block: DO NOT TOUCH ANYTHING IN THIS BLOCK!!!
509 **********************************************************
510 $$SCRIPT_BLOCK_START
511
512 VERSION 3
513 NEXT_ID 0
514
515 // UserType value blocks
516 $$UTYPE_VALS_START UserVar
517 $$UTYPE_VALS_END
518
519 $$UTYPE_VALS_START UserFlag
520 $$UTYPE_VALS_END
521
522 $$UTYPE_VALS_START SpewHandle
523 $$UTYPE_VALS_END
524
525 $$UTYPE_VALS_START TimerID
526 $$UTYPE_VALS_END
527
528 $$UTYPE_VALS_START SavedObjectSlot
529 $$UTYPE_VALS_END
530
531 $$UTYPE_VALS_START GoalID
532 $$UTYPE_VALS_END
533
534
535 // Name Lists
536 $$DOOR_LIST_START
537 $$DOOR_LIST_END
538
539 $$OBJECT_LIST_START
540 $$OBJECT_LIST_END
541
542 $$ROOM_LIST_START
543 $$ROOM_LIST_END
544
545 $$TRIGGER_LIST_START
546 $$TRIGGER_LIST_END
547
548 $$SOUND_LIST_START
549 $$SOUND_LIST_END
550
551 $$TEXTURE_LIST_START
552 $$TEXTURE_LIST_END
553
554 $$SPECNAME_LIST_START
555 $$SPECNAME_LIST_END
556
557 $$PATH_LIST_START
558 $$PATH_LIST_END
559
560 $$MATCEN_LIST_START
561 $$MATCEN_LIST_END
562
563 $$GOAL_LIST_START
564 $$GOAL_LIST_END
565
566 $$STRM_AUDIO_LIST_START
567 $$STRM_AUDIO_LIST_END
568
569
570 // Script Tree Dump
571
572 $$SCRIPT_BLOCK_END
573 *********************************************************/