Debian Codegraph @

Descent3/BriefingParse.cpp

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/main/BriefingParse.cpp $
21 * $Revision: 11 $
22 * $Date: 4/14/99 2:50a $
23 * $Author: Jeff $
24 *
25 * Parse functions to parse a briefing file
26 *
27 * $Log: /DescentIII/main/BriefingParse.cpp $
28 *
29 * 11 4/14/99 2:50a Jeff
30 * fixed some case mismatched #includes
31 *
32 * 10 2/17/99 6:55p Jeff
33 * added jump button type. Added no early render flag for bitmaps. Fixed
34 * color bug for type text
35 *
36 * 9 2/17/99 11:12a Doug
37 * set movie type to TC_MOVIE_STATIC (Jeff)
38 *
39 * 8 1/13/99 8:01p Jeff
40 * initialize text_ptr (even though it really doesn't get used till it's
41 * init), to get rid of warning
42 *
43 * 7 1/04/99 12:32p Jeff
44 * added support for mission flag parsing
45 *
46 * 6 11/17/98 3:39p Jeff
47 * handle any length line when parsing
48 *
49 * 5 10/12/98 8:32p Jeff
50 * changed the way focus is handled
51 *
52 * 4 9/17/98 2:28p Jeff
53 * added focus filenames to button effect
54 *
55 * 3 9/11/98 6:06p Jeff
56 * Briefing Editor completed
57 *
58 * 2 9/09/98 7:02p Jeff
59 * Initial Creation
60 *
61 * $NoKeywords: $
62 */
63 #include "BriefingParse.h"cxx . . $ `<file>/Descent3/BriefingParse.h`/
64 #include "TelComEffects.h"cxx . . $ `<file>/Descent3/TelComEffects.h`/
65 #include <stdlib.h>
66 #include <string.h>
67 #include <ctype.h>
68 #include "cfile.h"cxx . . $ `<file>/cfile/cfile.h`/
69 #include "pserror.h"cxx . . $ `<file>/misc/pserror.h`/
70 #include "game.h"cxx . . $ `<file>/Descent3/game.h`/
71 #include "mem.h"cxx . . $ `<file>/mem/mem.h`/
72 #include "voice.h"cxx . . $ `<file>/Descent3/voice.h`/
73 #include "streamaudio.h"cxx . . $ `<file>/stream_audio/streamaudio.h`/
74 #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/
75
76 // constructor
77 CBriefParsecxx . . $ CBriefParse#::CBriefParsecxx . . $ CBriefParse#CBriefParse(49f6e7a06ebc5aa8).() {
78 AddTextEffectcxx . . $ CBriefParse#AddTextEffect. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
79 AddBmpEffectcxx . . $ CBriefParse#AddBmpEffect. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
80 AddMovieEffectcxx . . $ CBriefParse#AddMovieEffect. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
81 AddBkgEffectcxx . . $ CBriefParse#AddBkgEffect. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
82 AddPolyEffectcxx . . $ CBriefParse#AddPolyEffect. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
83 AddSoundEffectcxx . . $ CBriefParse#AddSoundEffect. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
84 AddButtonEffectcxx . . $ CBriefParse#AddButtonEffect. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
85 StartScreencxx . . $ CBriefParse#StartScreen. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
86 EndScreencxx . . $ CBriefParse#EndScreen. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
87 LoopCallbackcxx . . $ CBriefParse#LoopCallback. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
88 SetTitlecxx . . $ CBriefParse#SetTitle. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
89 SetStaticcxx . . $ CBriefParse#SetStatic. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
90 SetGlitchcxx . . $ CBriefParse#SetGlitch. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
91 AddVoicecxx . . $ CBriefParse#AddVoice. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
92 linenumcxx . . $ CBriefParse#linenum. = 0;
93 parse_errorcxx . . $ CBriefParse#parse_error. = false;
94 }
95
96 // destructor
97 CBriefParsecxx . . $ CBriefParse#::~cxx . . $ CBriefParse#`~CBriefParse`(ced63f7c635d850d).CBriefParsecxx . . $ CBriefParse#() {}
98
99 // SetCallbacks
100 //
101 // Registers (or changes) the callbacks of the class
102 void CBriefParsecxx . . $ CBriefParse#::SetCallbackscxx . . $ CBriefParse#SetCallbacks(9ee811468c67755d).(tBriefParseCallbackscxx . . $ tBriefParseCallbacks# *cb) {
103 AddTextEffectcxx . . $ CBriefParse#AddTextEffect. = cb->AddTextEffectcxx . . $ tBriefParseCallbacks#AddTextEffect.;
104 AddBmpEffectcxx . . $ CBriefParse#AddBmpEffect. = cb->AddBmpEffectcxx . . $ tBriefParseCallbacks#AddBmpEffect.;
105 AddMovieEffectcxx . . $ CBriefParse#AddMovieEffect. = cb->AddMovieEffectcxx . . $ tBriefParseCallbacks#AddMovieEffect.;
106 AddBkgEffectcxx . . $ CBriefParse#AddBkgEffect. = cb->AddBkgEffectcxx . . $ tBriefParseCallbacks#AddBkgEffect.;
107 AddPolyEffectcxx . . $ CBriefParse#AddPolyEffect. = cb->AddPolyEffectcxx . . $ tBriefParseCallbacks#AddPolyEffect.;
108 AddSoundEffectcxx . . $ CBriefParse#AddSoundEffect. = cb->AddSoundEffectcxx . . $ tBriefParseCallbacks#AddSoundEffect.;
109 AddButtonEffectcxx . . $ CBriefParse#AddButtonEffect. = cb->AddButtonEffectcxx . . $ tBriefParseCallbacks#AddButtonEffect.;
110 StartScreencxx . . $ CBriefParse#StartScreen. = cb->StartScreencxx . . $ tBriefParseCallbacks#StartScreen.;
111 EndScreencxx . . $ CBriefParse#EndScreen. = cb->EndScreencxx . . $ tBriefParseCallbacks#EndScreen.;
112 LoopCallbackcxx . . $ CBriefParse#LoopCallback. = cb->LoopCallbackcxx . . $ tBriefParseCallbacks#LoopCallback.;
113 SetTitlecxx . . $ CBriefParse#SetTitle. = cb->SetTitlecxx . . $ tBriefParseCallbacks#SetTitle.;
114 SetStaticcxx . . $ CBriefParse#SetStatic. = cb->SetStaticcxx . . $ tBriefParseCallbacks#SetStatic.;
115 SetGlitchcxx . . $ CBriefParse#SetGlitch. = cb->SetGlitchcxx . . $ tBriefParseCallbacks#SetGlitch.;
116 AddVoicecxx . . $ CBriefParse#AddVoice. = cb->AddVoicecxx . . $ tBriefParseCallbacks#AddVoice.;
117 }
118
119 ////////////////////////////////////////////////////////////////////////////////
120
121 // Keyword IDs. These must match the keyword strings below
122 #define K_NONEcxx . . $ `Descent3/BriefingParse.cpp:122:9`! -1
123 #define K_SCREENcxx . . $ `Descent3/BriefingParse.cpp:123:9`! 0
124 #define K_BUTTONcxx . . $ `Descent3/BriefingParse.cpp:124:9`! 1
125 #define K_TEXTcxx . . $ `Descent3/BriefingParse.cpp:125:9`! 2
126 #define K_ENDTEXTcxx . . $ `Descent3/BriefingParse.cpp:126:9`! 3
127 #define K_BITMAPcxx . . $ `Descent3/BriefingParse.cpp:127:9`! 4
128 #define K_ENDSCREENcxx . . $ `Descent3/BriefingParse.cpp:128:9`! 5
129 #define K_MOVIEcxx . . $ `Descent3/BriefingParse.cpp:129:9`! 6
130 #define K_POLYcxx . . $ `Descent3/BriefingParse.cpp:130:9`! 7
131 #define K_TITLEcxx . . $ `Descent3/BriefingParse.cpp:131:9`! 8
132 #define K_SOUNDcxx . . $ `Descent3/BriefingParse.cpp:132:9`! 9
133 #define K_STATICcxx . . $ `Descent3/BriefingParse.cpp:133:9`! 10
134 #define K_GLITCHcxx . . $ `Descent3/BriefingParse.cpp:134:9`! 11
135 #define K_VOICEcxx . . $ `Descent3/BriefingParse.cpp:135:9`! 12
136 #define NUM_KEYWORDScxx . . $ `Descent3/BriefingParse.cpp:136:9`! 13
137
138 // Button types
139 #define B_DISPcxx . . $ `Descent3/BriefingParse.cpp:139:9`! 1 // display a screen
140 #define B_BACKcxx . . $ `Descent3/BriefingParse.cpp:140:9`! 2 // go back a page
141 #define B_FORWARDcxx . . $ `Descent3/BriefingParse.cpp:141:9`! 3 // go forward a page
142 #define B_QUITcxx . . $ `Descent3/BriefingParse.cpp:142:9`! 4 // exit TelCom
143
144 // Keywords. These must match the keyword IDs above
145 static const char *const keywordscxx . . $ keywords.[] = {"screen", "button", "text", "endtext", "bitmap", "endscreen", "movie",
146 "poly", "title", "sound", "static", "glitch", "voice"};
147
148 #define tfxNONEcxx . . $ `Descent3/BriefingParse.cpp:148:9`! 0
149 #define tfxFLASHcxx . . $ `Descent3/BriefingParse.cpp:149:9`! 1
150 #define tfxSCROLL_L2Rcxx . . $ `Descent3/BriefingParse.cpp:150:9`! 2
151 #define tfxSCROLL_R2Lcxx . . $ `Descent3/BriefingParse.cpp:151:9`! 3
152 #define tfxSCROLL_T2Bcxx . . $ `Descent3/BriefingParse.cpp:152:9`! 4
153 #define tfxSCROLL_B2Tcxx . . $ `Descent3/BriefingParse.cpp:153:9`! 5
154 #define tfxFADE_IN_AND_OUTcxx . . $ `Descent3/BriefingParse.cpp:154:9`! 6
155 #define tfxFADE_INcxx . . $ `Descent3/BriefingParse.cpp:155:9`! 7
156 #define tfxFADE_OUTcxx . . $ `Descent3/BriefingParse.cpp:156:9`! 8
157
158 #define fntSMBRIEFcxx . . $ `Descent3/BriefingParse.cpp:158:9`! 0
159 #define fntLGBRIEFcxx . . $ `Descent3/BriefingParse.cpp:159:9`! 1
160 static const char *const FontNamescxx . . $ FontNames.[] = {"sm_brief", "lg_brief", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!};
161
162 static const char *const TextEffectstrcxx . . $ TextEffectstr.[] = {"None", "flash", "scroll_l2r", "scroll_r2l", "scroll_t2b",
163 "scroll_b2t", "fade_in_and_out", "fade_in", "fade_out", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!};
164 #define bfxNONEcxx . . $ `Descent3/BriefingParse.cpp:164:9`! 0
165 #define bfxFADE_INcxx . . $ `Descent3/BriefingParse.cpp:165:9`! 1
166 #define bfxFADE_OUTcxx . . $ `Descent3/BriefingParse.cpp:166:9`! 2
167 #define bfxBLUR_INcxx . . $ `Descent3/BriefingParse.cpp:167:9`! 3
168 #define bfxBLUR_OUTcxx . . $ `Descent3/BriefingParse.cpp:168:9`! 4
169 #define bfxSCAN_INcxx . . $ `Descent3/BriefingParse.cpp:169:9`! 5
170 #define bfxSCAN_OUTcxx . . $ `Descent3/BriefingParse.cpp:170:9`! 6
171 #define bfxINVERT_INcxx . . $ `Descent3/BriefingParse.cpp:171:9`! 7
172 #define bfxINVERT_OUTcxx . . $ `Descent3/BriefingParse.cpp:172:9`! 8
173 #define bfxSTRETCH_INcxx . . $ `Descent3/BriefingParse.cpp:173:9`! 9
174 #define bfxSTRETCH_OUTcxx . . $ `Descent3/BriefingParse.cpp:174:9`! 10
175
176 static const char *const BitmapEffectstrcxx . . $ BitmapEffectstr.[] = {"None", "Fade_in", "Fade_out", "Blur_in",
177 "Blur_out", "Scan_in", "Scan_out", "Invert_in",
178 "Invert_out", "Stretch_in", "Stretch_out", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!};
179
180 ////////////////////////////////////////////
181 // These are the types of on screen buttons
182 #define osbDOWN_ARROWcxx . . $ `Descent3/BriefingParse.cpp:182:9`! 0
183 #define osbUP_ARROWcxx . . $ `Descent3/BriefingParse.cpp:183:9`! 1
184 #define osbNEXT_PAGEcxx . . $ `Descent3/BriefingParse.cpp:184:9`! 2
185 #define osbPREV_PAGEcxx . . $ `Descent3/BriefingParse.cpp:185:9`! 3
186 #define osbQUITcxx . . $ `Descent3/BriefingParse.cpp:186:9`! 4
187 #define osbJUMP_PAGEcxx . . $ `Descent3/BriefingParse.cpp:187:9`! 5
188
189 static const char *const OnScreenButtonTypescxx . . $ OnScreenButtonTypes.[] = {"Down", "Up", "Next", "Prev", "Quit", "Jump", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!};
190
191 /////////////////////////////////////////////
192 // These are the different ways an onscreen button will respond to mouse clicks
193 #define oscHOLD_DOWNcxx . . $ `Descent3/BriefingParse.cpp:193:9`! 0
194 #define oscCLICK_DOWNcxx . . $ `Descent3/BriefingParse.cpp:194:9`! 1
195 #define oscCLICK_UPcxx . . $ `Descent3/BriefingParse.cpp:195:9`! 2
196
197 static const char *const OnScreenButtonClickTypescxx . . $ OnScreenButtonClickTypes.[] = {"HoldDown", "ClickDown", "ClickUp", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!};
198
199 #define PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(i) \
200 do { \
201 p = ParseInt(p, &(i)); \
202 if (!p) \
203 goto done_parsing; \
204 } while (0)
205 #define PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(i) \
206 do { \
207 p = ParseFloat(p, &(i)); \
208 if (!p) \
209 goto done_parsing; \
210 } while (0)
211 #define PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!() \
212 do { \
213 p = ParseComma(p); \
214 if (!p) \
215 goto done_parsing; \
216 } while (0)
217 #define PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(buf) \
218 do { \
219 p = ParseString(p, buf, sizeof(buf)); \
220 if (!p) \
221 goto done_parsing; \
222 } while (0)
223 #define PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(buf) \
224 do { \
225 p = ParseToken(p, buf, sizeof(buf)); \
226 if (!p) \
227 goto done_parsing; \
228 } while (0)
229
230 static int ReadFullLinecxx . . $ ReadFullLine(3fa5792a75966c34).(char **data, CFILEcxx . . $ CFILE# *ifile) {
231 int counter, readin;
232 char buffer[512];
233 bool done;
234
235 counter = 0;
236 done = false;
237 readin = 0;
238 *data = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
239 char c;
240
241 while (!done) {
242
243 // read in a byte
244 c = cfgetccxx . . $ cfgetc(413716a422df0036).(ifile);
245
246 if ((c == EOFcxx . . $ `<external>/232824719582829767/stdio.h:105:9`!) || (!(ifile->flagscxx . . $ CFILE#flags. & CFF_TEXTcxx . . $ CFF_TEXT.) && (c == 0)) || ((ifile->flagscxx . . $ CFILE#flags. & CFF_TEXTcxx . . $ CFF_TEXT.) && (c == '\n'))) {
247 // we've hit the end of the line
248 done = true;
249 } else {
250 buffer[readin] = c;
251 readin++;
252 }
253
254 // check if we have a full temp buffer
255 if (readin == sizeof(buffer)) {
256 // we have a full temp buffer
257 char *temp_buffer;
258 temp_buffer = (char *)mem_malloccxx . . $ `mem/mem.h:79:9`!(counter + sizeof(buffer)); // allocate another buffer full
259 if (*data) {
260 // copy over existing data
261 memcpy(temp_buffer, *data, counter);
262 // free it
263 mem_freecxx . . $ `mem/mem.h:80:9`!(*data);
264 }
265 // copy over new data
266 memcpy(&temp_buffer[counter], buffer, sizeof(buffer));
267
268 // reset our buffer for the temp buffer
269 counter += readin;
270 readin = 0;
271
272 *data = temp_buffer;
273 }
274 }
275
276 // append all the data thats in the tempbuffer into the final buffer
277 char *temp_buffer;
278 temp_buffer = (char *)mem_malloccxx . . $ `mem/mem.h:79:9`!(counter + readin + 1); // allocate what we need (plus for NULL term)
279 if (*data) {
280 // copy over existing data
281 memcpy(temp_buffer, *data, counter);
282 // free it
283 mem_freecxx . . $ `mem/mem.h:80:9`!(*data);
284 }
285 // copy over new data
286 memcpy(&temp_buffer[counter], buffer, readin);
287
288 counter += (readin + 1);
289 *data = temp_buffer;
290
291 temp_buffer[counter - 1] = '\0';
292
293 return counter;
294 }
295
296 // ParseBriefing
297 //
298 // Parses the briefing file (calling the callbacks throughout), check return code
299 int CBriefParsecxx . . $ CBriefParse#::ParseBriefingcxx . . $ CBriefParse#ParseBriefing(5c4306d8553b3696).(const char *filename) {
300 CFILEcxx . . $ CFILE# *ifile;
301 bool retvalue = false;
302 bool voice_def_screen = false;
303 char text_buf[8192], *text_ptr = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
304 bool abort = 0;
305 bool gottitle = false;
306 char *linebuf = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
307
308 int beffect = bfxNONEcxx . . $ `Descent3/BriefingParse.cpp:164:9`!;
309 int x = 0, y = 0;
310 char filen[40];
311 bool emergency_exit = false;
312
313 // the following block of 'globals' are for when parsing a text block, the information is stored
314 // here until a $endtext is hit
315 char title_buf[128];
316 bool reading_text = false;
317 tTextBufferDesccxx . . $ tTextBufferDesc# text_buffer_desc = {};
318 text_buffer_desc.text_idcxx . . $ tTextBufferDesc#text_id. = -1; // id # for current textblock
319 text_buffer_desc.teffectcxx . . $ tTextBufferDesc#teffect. = tfxNONEcxx . . $ `Descent3/BriefingParse.cpp:148:9`!;
320
321 int current_screen = -1;
322 char title[100];
323
324 strcpy(title, " ");
325
326 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Parsing <%s>\n", filename);
327
328 // Open the file
329 ifile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(filenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rt");
330 if (!ifile)
331 return PBERR_FILENOTEXISTcxx . . $ `Descent3/BriefingParse.h:61:9`!;
332
333 // Initialize vars
334 linenumcxx . . $ CBriefParse#linenum. = 0;
335 parse_errorcxx . . $ CBriefParse#parse_error. = 0;
336 title_buf[0] = 0;
337
338 // Read & parse lines
339 int bytes_read;
340 const char *p;
341
342 linebuf = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
343
344 while ((!cfeofcxx . . $ cfeof(413716a422df0036).(ifile) && !parse_errorcxx . . $ CBriefParse#parse_error. && !abort)) {
345 if (linebuf) {
346 mem_freecxx . . $ `mem/mem.h:80:9`!(linebuf);
347 linebuf = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
348 }
349
350 if (LoopCallbackcxx . . $ CBriefParse#LoopCallback.) {
351 abort = (*LoopCallbackcxx . . $ CBriefParse#LoopCallback.)();
352 }
353
354 // Read the line
355 bytes_read = ReadFullLinecxx . . $ ReadFullLine(3fa5792a75966c34).(&linebuf, ifile);
356 linenumcxx . . $ CBriefParse#linenum.++;
357
358 if (!linebuf) {
359 // no more data? or empty line
360 continue;
361 }
362
363 // Check for line too long
364 //@@if (bytes_read >= sizeof(linebuf)-1) {
365 //@@ ParseError("Line too long");
366 //@@ break;
367 //@@}
368
369 // Check for keyword
370 if (linebuf[0] == '$') {
371 int keyword_id;
372
373 // Get the keyword id
374 p = ParseKeywordcxx . . $ CBriefParse#ParseKeyword(6a735779416056db).(linebuf, &keyword_id);
375
376 switch (keyword_id) {
377 case K_TITLEcxx . . $ `Descent3/BriefingParse.cpp:131:9`!: {
378 if (gottitle)
379 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("$TITLE already defined\n");
380 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(title);
381 gottitle = true;
382 if (SetTitlecxx . . $ CBriefParse#SetTitle.)
383 (*SetTitlecxx . . $ CBriefParse#SetTitle.)(title);
384 } break;
385 case K_STATICcxx . . $ `Descent3/BriefingParse.cpp:133:9`!: {
386 float s;
387 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(s);
388 if (SetStaticcxx . . $ CBriefParse#SetStatic.)
389 (*SetStaticcxx . . $ CBriefParse#SetStatic.)(s);
390 } break;
391 case K_GLITCHcxx . . $ `Descent3/BriefingParse.cpp:134:9`!: {
392 float g;
393 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(g);
394 if (SetGlitchcxx . . $ CBriefParse#SetGlitch.)
395 (*SetGlitchcxx . . $ CBriefParse#SetGlitch.)(g);
396 } break;
397 case K_SOUNDcxx . . $ `Descent3/BriefingParse.cpp:132:9`!: {
398 // add a sound effect
399 char buffer[20];
400 char d[128];
401 d[0] = '\0';
402 TCSNDDESCcxx . . $ TCSNDDESC# snddesc;
403 snddesc.capscxx . . $ TCSNDDESC#caps. = 0;
404 bool play = false;
405 snddesc.mission_mask_setcxx . . $ TCSNDDESC#mission_mask_set. = snddesc.mission_mask_unsetcxx . . $ TCSNDDESC#mission_mask_unset. = 0;
406
407 while (!play) {
408 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(buffer);
409 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "play"))
410 play = true;
411 else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "once")) {
412 snddesc.capscxx . . $ TCSNDDESC#caps. |= TCSD_ONCEcxx . . $ `Descent3/TelComEfxStructs.h:132:9`!;
413 snddesc.oncecxx . . $ TCSNDDESC#once. = true;
414 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "starttime")) {
415 snddesc.capscxx . . $ TCSNDDESC#caps. |= TCSD_WAITTIMEcxx . . $ `Descent3/TelComEfxStructs.h:131:9`!;
416 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(snddesc.waittime);
417 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isset")) {
418 int value, bit = 0x01;
419 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
420 if (value >= 0 && value < 32) {
421 bit = bit << value;
422 snddesc.mission_mask_setcxx . . $ TCSNDDESC#mission_mask_set. |= bit;
423 }
424 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isnset")) {
425 int value, bit = 0x01;
426 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
427 if (value >= 0 && value < 32) {
428 bit = bit << value;
429 snddesc.mission_mask_unsetcxx . . $ TCSNDDESC#mission_mask_unset. |= bit;
430 }
431 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "desc")) {
432 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(d);
433 } else
434 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Illegal parameter in $SOUND");
435 }
436 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(snddesc.filename);
437 if (AddSoundEffectcxx . . $ CBriefParse#AddSoundEffect.)
438 (*AddSoundEffectcxx . . $ CBriefParse#AddSoundEffect.)(&snddesc, d);
439 } break;
440 case K_VOICEcxx . . $ `Descent3/BriefingParse.cpp:135:9`!: {
441 // define the voice for this screen
442 bool play = false;
443 char d[128];
444 d[0] = '\0';
445 if (current_screen == -1)
446 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Voice keyword found outside a $screen block\n");
447 if (voice_def_screen)
448 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("A Voice is already defined for screen\n");
449
450 char buffer[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
451 char token[30];
452 int vflags = 0;
453 bool bitdepthset = false;
454 while (!play) {
455 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(token);
456 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(token, "play"))
457 play = true;
458 else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(token, "8bit")) {
459 vflags |= VF_8BITcxx . . $ `Descent3/voice.h:54:9`!;
460 bitdepthset = true;
461 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(token, "compressed")) {
462 vflags |= VF_COMPRESSEDcxx . . $ `Descent3/voice.h:51:9`!;
463 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(token, "stereo")) {
464 vflags |= VF_STEREOcxx . . $ `Descent3/voice.h:52:9`!;
465 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isset")) {
466 int value, bit = 0x01;
467 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
468 if (value >= 0 && value < 32) {
469 bit = bit << value;
470 // snddesc.mission_mask_set |= bit;
471 }
472 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isnset")) {
473 int value, bit = 0x01;
474 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
475 if (value >= 0 && value < 32) {
476 bit = bit << value;
477 // snddesc.mission_mask_unset |= bit;
478 }
479 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(token, "desc")) {
480 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(d);
481 } else
482 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Illegal parameter in $VOICE");
483 }
484 if (!bitdepthset)
485 vflags |= VF_16BITcxx . . $ `Descent3/voice.h:53:9`! | VF_INTERUPTcxx . . $ `Descent3/voice.h:55:9`! | VF_FORCEcxx . . $ `Descent3/voice.h:57:9`!;
486
487 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(buffer);
488
489 /*
490 if(AddVoice)
491 (*AddVoice)(buffer,flags);
492 */
493
494 voice_def_screen = true;
495 } break;
496 case K_POLYcxx . . $ `Descent3/BriefingParse.cpp:130:9`!: {
497 // add a poly effect
498 char name[32];
499 float pos_x, pos_y, pos_z;
500 float rot_x, rot_y, rot_z;
501 float ori_x, ori_y, ori_z;
502
503 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(pos_x);
504 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
505 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(pos_y);
506 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
507 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(pos_z);
508
509 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(ori_x);
510 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
511 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(ori_y);
512 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
513 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(ori_z);
514
515 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(rot_x);
516 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
517 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(rot_y);
518 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
519 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(rot_z);
520
521 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(name);
522 TCPOLYDESCcxx . . $ TCPOLYDESC# polydesc;
523 polydesc.capscxx . . $ TCPOLYDESC#caps. = 0;
524 polydesc.pos_xcxx . . $ TCPOLYDESC#pos_x. = pos_x;
525 polydesc.pos_ycxx . . $ TCPOLYDESC#pos_y. = pos_y;
526 polydesc.pos_zcxx . . $ TCPOLYDESC#pos_z. = pos_z;
527 polydesc.ori_xcxx . . $ TCPOLYDESC#ori_x. = ori_x;
528 polydesc.ori_ycxx . . $ TCPOLYDESC#ori_y. = ori_y;
529 polydesc.ori_zcxx . . $ TCPOLYDESC#ori_z. = ori_z;
530 polydesc.rot_xcxx . . $ TCPOLYDESC#rot_x. = rot_x;
531 polydesc.rot_ycxx . . $ TCPOLYDESC#rot_y. = rot_y;
532 polydesc.rot_zcxx . . $ TCPOLYDESC#rot_z. = rot_z;
533 polydesc.mission_mask_setcxx . . $ TCPOLYDESC#mission_mask_set. = 0;
534 polydesc.mission_mask_unsetcxx . . $ TCPOLYDESC#mission_mask_unset. = 0;
535 strcpy(polydesc.polynamecxx . . $ TCPOLYDESC#polyname., name);
536 if (AddPolyEffectcxx . . $ CBriefParse#AddPolyEffect.)
537 (*AddPolyEffectcxx . . $ CBriefParse#AddPolyEffect.)(&polydesc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
538 } break;
539 case K_BUTTONcxx . . $ `Descent3/BriefingParse.cpp:124:9`!: {
540 if (!ParseButtonEffectcxx . . $ CBriefParse#ParseButtonEffect(c5f7da30cbc0f4e9).(p))
541 goto done_parsing;
542 } break;
543 case K_SCREENcxx . . $ `Descent3/BriefingParse.cpp:123:9`!: {
544 // define a screen
545 char description[128];
546 char buffer[64];
547 bool done = false;
548 bool layout_found = false;
549 char layout_scr[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
550 uint32_tcxx . . $ uint32_t# mission_mask_set = 0, mission_mask_unset = 0;
551 description[0] = '\0';
552 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(current_screen);
553
554 if ((current_screen < 0) || (current_screen >= MAX_TELCOM_SCREENScxx . . $ `Descent3/TelCom.h:93:9`!))
555 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Illegal Screen number\n");
556
557 while (!done) {
558 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(buffer);
559 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "start")) {
560 done = 1;
561 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "desc")) {
562 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(description);
563 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isset")) {
564 int value, bit = 0x01;
565 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
566 if (value >= 0 && value < 32) {
567 bit = bit << value;
568 mission_mask_set |= bit;
569 }
570 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isnset")) {
571 int value, bit = 0x01;
572 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
573 if (value >= 0 && value < 32) {
574 bit = bit << value;
575 mission_mask_unset |= bit;
576 }
577 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "layout")) {
578 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(layout_scr);
579 layout_found = true;
580 }
581 }
582
583 if (StartScreencxx . . $ CBriefParse#StartScreen.)
584 (*StartScreencxx . . $ CBriefParse#StartScreen.)(current_screen, description, (layout_found) ? layout_scr : NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, mission_mask_set,
585 mission_mask_unset);
586
587 voice_def_screen = false;
588 } break;
589 case K_ENDSCREENcxx . . $ `Descent3/BriefingParse.cpp:128:9`!: {
590 if ((current_screen >= 0) && (current_screen < MAX_TELCOM_SCREENScxx . . $ `Descent3/TelCom.h:93:9`!)) {
591 if (EndScreencxx . . $ CBriefParse#EndScreen.)
592 (*EndScreencxx . . $ CBriefParse#EndScreen.)();
593 } else {
594 // invalid screen
595 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Illegal screen number or missing $SCREEN\n");
596 }
597 current_screen = -1;
598 } break;
599 case K_TEXTcxx . . $ `Descent3/BriefingParse.cpp:125:9`!: {
600 reading_text = true;
601 text_ptr = text_buf;
602 text_buffer_desc.text_idcxx . . $ tTextBufferDesc#text_id. = -1;
603
604 if (!ParseTextEffectcxx . . $ CBriefParse#ParseTextEffect(7303da5f26e915b1).(p, &text_buffer_desc))
605 goto done_parsing;
606 } break;
607 case K_ENDTEXTcxx . . $ `Descent3/BriefingParse.cpp:126:9`!: {
608 if (!reading_text)
609 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Found $ENDTEXT without $TEXT");
610 reading_text = false;
611 text_buffer_desc.textdesccxx . . $ tTextBufferDesc#textdesc..loopingcxx . . $ TCTEXTDESC#looping. = false;
612 text_buffer_desc.textdesccxx . . $ tTextBufferDesc#textdesc..capscxx . . $ TCTEXTDESC#caps. |= TCTD_LOOPINGcxx . . $ `Descent3/TelComEfxStructs.h:109:9`!;
613 if (AddTextEffectcxx . . $ CBriefParse#AddTextEffect.)
614 (*AddTextEffectcxx . . $ CBriefParse#AddTextEffect.)(&text_buffer_desc.textdesccxx . . $ tTextBufferDesc#textdesc., text_buf, text_buffer_desc.descriptioncxx . . $ tTextBufferDesc#description.,
615 text_buffer_desc.text_idcxx . . $ tTextBufferDesc#text_id.);
616 text_buffer_desc.text_idcxx . . $ tTextBufferDesc#text_id. = -1;
617 text_ptr = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
618 } break;
619 case K_BITMAPcxx . . $ `Descent3/BriefingParse.cpp:127:9`!: {
620 char buffer[64];
621 char d[128];
622 d[0] = '\0';
623 bool done = 0;
624 bool found;
625 float speed, starttime;
626 int i;
627
628 speed = 1.0f;
629 starttime = 0;
630
631 TCBMPDESCcxx . . $ TCBMPDESC# bmpdesc;
632 bmpdesc.capscxx . . $ TCBMPDESC#caps. = 0;
633 bmpdesc.typecxx . . $ TCBMPDESC#type. = TC_BMP_STATICcxx . . $ `Descent3/TelComEfxStructs.h:139:9`!;
634 bmpdesc.flagscxx . . $ TCBMPDESC#flags. = 0;
635 bmpdesc.mission_mask_setcxx . . $ TCBMPDESC#mission_mask_set. = 0;
636 bmpdesc.mission_mask_unsetcxx . . $ TCBMPDESC#mission_mask_unset. = 0;
637 while (!done) {
638 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(buffer);
639 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "show")) {
640 done = 1;
641 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "no_early_rend")) {
642 bmpdesc.flagscxx . . $ TCBMPDESC#flags. |= TC_NOEARLYRENDERcxx . . $ `Descent3/TelComEfxStructs.h:160:9`!;
643 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "effect")) {
644 found = false;
645 i = 0;
646 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(buffer);
647 while (!found) {
648 if (!BitmapEffectstrcxx . . $ BitmapEffectstr.[i])
649 found = true;
650 else if (!strnicmpcxx . . $ `linux/linux_fix.h:44:9`!(BitmapEffectstr[i], buffer, strlen(BitmapEffectstr[i]))) {
651 beffect = i;
652 found = true;
653 }
654 i++;
655 }
656 bmpdesc.typecxx . . $ TCBMPDESC#type. = TC_BMP_STATICcxx . . $ `Descent3/TelComEfxStructs.h:139:9`!;
657 switch (beffect) {
658 case bfxBLUR_INcxx . . $ `Descent3/BriefingParse.cpp:167:9`!:
659 bmpdesc.typecxx . . $ TCBMPDESC#type. = TC_BMP_BLURcxx . . $ `Descent3/TelComEfxStructs.h:140:9`!;
660 bmpdesc.flagscxx . . $ TCBMPDESC#flags. |= TC_BMPF_INcxx . . $ `Descent3/TelComEfxStructs.h:158:9`!;
661 break;
662 case bfxBLUR_OUTcxx . . $ `Descent3/BriefingParse.cpp:168:9`!:
663 bmpdesc.typecxx . . $ TCBMPDESC#type. = TC_BMP_BLURcxx . . $ `Descent3/TelComEfxStructs.h:140:9`!;
664 bmpdesc.flagscxx . . $ TCBMPDESC#flags. |= TC_BMPF_OUTcxx . . $ `Descent3/TelComEfxStructs.h:159:9`!;
665 break;
666 case bfxSCAN_INcxx . . $ `Descent3/BriefingParse.cpp:169:9`!:
667 bmpdesc.typecxx . . $ TCBMPDESC#type. = TC_BMP_SCANLINEcxx . . $ `Descent3/TelComEfxStructs.h:141:9`!;
668 bmpdesc.flagscxx . . $ TCBMPDESC#flags. |= TC_BMPF_INcxx . . $ `Descent3/TelComEfxStructs.h:158:9`!;
669 break;
670 case bfxSCAN_OUTcxx . . $ `Descent3/BriefingParse.cpp:170:9`!:
671 bmpdesc.typecxx . . $ TCBMPDESC#type. = TC_BMP_SCANLINEcxx . . $ `Descent3/TelComEfxStructs.h:141:9`!;
672 bmpdesc.flagscxx . . $ TCBMPDESC#flags. |= TC_BMPF_OUTcxx . . $ `Descent3/TelComEfxStructs.h:159:9`!;
673 break;
674 case bfxINVERT_INcxx . . $ `Descent3/BriefingParse.cpp:171:9`!:
675 bmpdesc.typecxx . . $ TCBMPDESC#type. = TC_BMP_INVERTcxx . . $ `Descent3/TelComEfxStructs.h:142:9`!;
676 bmpdesc.flagscxx . . $ TCBMPDESC#flags. |= TC_BMPF_INcxx . . $ `Descent3/TelComEfxStructs.h:158:9`!;
677 break;
678 case bfxINVERT_OUTcxx . . $ `Descent3/BriefingParse.cpp:172:9`!:
679 bmpdesc.typecxx . . $ TCBMPDESC#type. = TC_BMP_INVERTcxx . . $ `Descent3/TelComEfxStructs.h:142:9`!;
680 bmpdesc.flagscxx . . $ TCBMPDESC#flags. |= TC_BMPF_OUTcxx . . $ `Descent3/TelComEfxStructs.h:159:9`!;
681 break;
682 case bfxSTRETCH_INcxx . . $ `Descent3/BriefingParse.cpp:173:9`!:
683 bmpdesc.typecxx . . $ TCBMPDESC#type. = TC_BMP_STRETCHcxx . . $ `Descent3/TelComEfxStructs.h:143:9`!;
684 bmpdesc.flagscxx . . $ TCBMPDESC#flags. |= TC_BMPF_INcxx . . $ `Descent3/TelComEfxStructs.h:158:9`!;
685 break;
686 case bfxSTRETCH_OUTcxx . . $ `Descent3/BriefingParse.cpp:174:9`!:
687 bmpdesc.typecxx . . $ TCBMPDESC#type. = TC_BMP_STRETCHcxx . . $ `Descent3/TelComEfxStructs.h:143:9`!;
688 bmpdesc.flagscxx . . $ TCBMPDESC#flags. |= TC_BMPF_OUTcxx . . $ `Descent3/TelComEfxStructs.h:159:9`!;
689 break;
690 case bfxFADE_INcxx . . $ `Descent3/BriefingParse.cpp:165:9`!:
691 case bfxFADE_OUTcxx . . $ `Descent3/BriefingParse.cpp:166:9`!:
692 default:
693 bmpdesc.typecxx . . $ TCBMPDESC#type. |= TC_BMP_STATICcxx . . $ `Descent3/TelComEfxStructs.h:139:9`!;
694 break;
695 }
696 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "speed")) {
697 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(speed);
698 bmpdesc.speedcxx . . $ TCBMPDESC#speed. = speed;
699 bmpdesc.capscxx . . $ TCBMPDESC#caps. |= TCBD_SPEEDcxx . . $ `Descent3/TelComEfxStructs.h:118:9`!;
700 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "starttime")) {
701 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(starttime);
702 bmpdesc.waittimecxx . . $ TCBMPDESC#waittime. = starttime;
703 bmpdesc.capscxx . . $ TCBMPDESC#caps. |= TCBD_WAITTIMEcxx . . $ `Descent3/TelComEfxStructs.h:117:9`!;
704 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "position")) {
705 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(x);
706 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
707 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(y);
708 bmpdesc.capscxx . . $ TCBMPDESC#caps. |= TCBD_XYcxx . . $ `Descent3/TelComEfxStructs.h:115:9`!;
709 bmpdesc.xcxx . . $ TCBMPDESC#x. = x;
710 bmpdesc.ycxx . . $ TCBMPDESC#y. = y;
711 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isset")) {
712 int value, bit = 0x01;
713 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
714 if (value >= 0 && value < 32) {
715 bit = bit << value;
716 bmpdesc.mission_mask_setcxx . . $ TCBMPDESC#mission_mask_set. |= bit;
717 }
718 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isnset")) {
719 int value, bit = 0x01;
720 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
721 if (value >= 0 && value < 32) {
722 bit = bit << value;
723 bmpdesc.mission_mask_unsetcxx . . $ TCBMPDESC#mission_mask_unset. |= bit;
724 }
725 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "desc")) {
726 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(d);
727 } else
728 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Illegal parameter in $BITMAP");
729 }
730 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(filen);
731 strcpy(bmpdesc.filenamecxx . . $ TCBMPDESC#filename., filen);
732 if (AddBmpEffectcxx . . $ CBriefParse#AddBmpEffect.)
733 (*AddBmpEffectcxx . . $ CBriefParse#AddBmpEffect.)(&bmpdesc, d);
734 } break;
735 case K_MOVIEcxx . . $ `Descent3/BriefingParse.cpp:129:9`!: {
736 int x = 0, y = 0;
737 char movie_name[128];
738 char d[128];
739 d[0] = '\0';
740 float fps = 20.0;
741 TCMOVIEDESCcxx . . $ TCMOVIEDESC# moviedesc;
742 float starttime = 0;
743 moviedesc.capscxx . . $ TCMOVIEDESC#caps. = 0;
744 bool done = false;
745 char buffer[30];
746 moviedesc.capscxx . . $ TCMOVIEDESC#caps. = 0;
747 moviedesc.mission_mask_setcxx . . $ TCMOVIEDESC#mission_mask_set. = 0;
748 moviedesc.mission_mask_unsetcxx . . $ TCMOVIEDESC#mission_mask_unset. = 0;
749 moviedesc.typecxx . . $ TCMOVIEDESC#type. = TC_MOVIE_STATICcxx . . $ `Descent3/TelComEfxStructs.h:145:9`!;
750 while (!done) {
751 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(buffer);
752
753 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "show")) {
754 done = 1;
755 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "position")) {
756 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(x);
757 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
758 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(y);
759 moviedesc.xcxx . . $ TCMOVIEDESC#x. = x;
760 moviedesc.ycxx . . $ TCMOVIEDESC#y. = y;
761 moviedesc.capscxx . . $ TCMOVIEDESC#caps. |= TCMD_XYcxx . . $ `Descent3/TelComEfxStructs.h:120:9`!;
762 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "fps")) {
763 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(fps);
764 moviedesc.fpscxx . . $ TCMOVIEDESC#fps. = fps;
765 moviedesc.capscxx . . $ TCMOVIEDESC#caps. |= TCMD_FPScxx . . $ `Descent3/TelComEfxStructs.h:123:9`!;
766 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "looping")) {
767 moviedesc.loopingcxx . . $ TCMOVIEDESC#looping. = true;
768 moviedesc.capscxx . . $ TCMOVIEDESC#caps. |= TCMD_LOOPINGcxx . . $ `Descent3/TelComEfxStructs.h:121:9`!;
769 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "starttime")) {
770 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(starttime);
771 moviedesc.waittimecxx . . $ TCMOVIEDESC#waittime. = starttime;
772 moviedesc.capscxx . . $ TCMOVIEDESC#caps. |= TCMD_WAITTIMEcxx . . $ `Descent3/TelComEfxStructs.h:122:9`!;
773 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isset")) {
774 int value, bit = 0x01;
775 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
776 if (value >= 0 && value < 32) {
777 bit = bit << value;
778 moviedesc.mission_mask_setcxx . . $ TCMOVIEDESC#mission_mask_set. |= bit;
779 }
780 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isnset")) {
781 int value, bit = 0x01;
782 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
783 if (value >= 0 && value < 32) {
784 bit = bit << value;
785 moviedesc.mission_mask_unsetcxx . . $ TCMOVIEDESC#mission_mask_unset. |= bit;
786 }
787 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "desc")) {
788 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(d);
789 } else
790 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Illegal parameter in $MOVIE");
791 }
792
793 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(movie_name);
794 strcpy(moviedesc.filenamecxx . . $ TCMOVIEDESC#filename., movie_name);
795 if (AddMovieEffectcxx . . $ CBriefParse#AddMovieEffect.)
796 (*AddMovieEffectcxx . . $ CBriefParse#AddMovieEffect.)(&moviedesc, d);
797 } break;
798 case K_NONEcxx . . $ `Descent3/BriefingParse.cpp:122:9`!:
799 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Unknown keyword", p);
800 break;
801 default:
802 Int3cxx . . $ `misc/pserror.h:247:9`!(); // Programming error: unknown keyword ID
803 }
804 continue;
805 } else if (reading_text && text_ptr) { // a line of text
806 if (text_ptr != text_buf)
807 *text_ptr++ = '\n';
808 if (text_ptr - text_buf + strlen(linebuf) > sizeof(text_buf))
809 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Text buffer overflow");
810 else {
811 strcpy(text_ptr, linebuf);
812 text_ptr += strlen(text_ptr);
813 }
814 } else if ((linebuf[0] == ';') || (linebuf[0] == 0)) // Check for comment or blank line
815 continue;
816 else {
817 // Not a comment, keyword, or text, so it's an error
818 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Unexpected text on line", p);
819 }
820 }
821
822 done_parsing:;
823
824 if (abort) {
825 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Parse aborted\n");
826 } else if (!parse_errorcxx . . $ CBriefParse#parse_error.) {
827 if (reading_text) {
828 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Missing '$endtext'");
829 } else {
•830 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Parse successful\n");
831 }
832 }
833
834 // Close the file
835 cfclosecxx . . $ cfclose(3639e799710acb68).(ifile);
836
837 if (linebuf) {
838 // make sure all memory is freed
839 mem_freecxx . . $ `mem/mem.h:80:9`!(linebuf);
840 linebuf = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
841 }
842
843 return PBERR_NOERRcxx . . $ `Descent3/BriefingParse.h:62:9`!;
844 }
845
846 // Parses the keyword description for an OnScreenButton
847 bool CBriefParsecxx . . $ CBriefParse#::ParseButtonEffectcxx . . $ CBriefParse#ParseButtonEffect(c5f7da30cbc0f4e9).(const char *p) {
848 int type = osbPREV_PAGEcxx . . $ `Descent3/BriefingParse.cpp:185:9`!, ctype = oscCLICK_UPcxx . . $ `Descent3/BriefingParse.cpp:195:9`!;
849 // creates an input button
850 int x, y, screen;
851 int osflags = 0;
852 char buffer[20];
853 bool show = false, flasher = false;
854 int p_id = -1, s_id = -1;
855 int id = -1;
856 float flash_time = -1;
857 char flash_name[256];
858 char flash_name_focus[256];
859 char d[128];
860 uint32_tcxx . . $ uint32_t# mission_mask_set = 0, mission_mask_unset = 0;
861 d[0] = '\0';
862
863 strcpy(flash_name, " ");
864 strcpy(flash_name_focus, " ");
865 screen = -1;
866
867 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(x);
868 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
869 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(y);
870 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(buffer);
871
872 while (!show) {
873 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "show"))
874 show = true;
875 else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "flash")) {
876 flasher = true;
877 osflags |= OBF_FLASHcxx . . $ `Descent3/TelComEfxStructs.h:305:9`!;
878 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(flash_time);
879 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(flash_name);
880 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(flash_name_focus);
881 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "id")) {
882 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(id);
883 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "parent_id")) {
884 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(p_id);
885 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "sibling_id")) {
886 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(s_id);
887 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "desc")) {
888 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(d);
889 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "type")) {
890 char btype_buf[30];
891 bool found = false;
892 int i = 0;
893
894 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(btype_buf);
895 while (!found) {
896 if (!OnScreenButtonTypescxx . . $ OnScreenButtonTypes.[i])
897 found = true;
898 else if (!strnicmpcxx . . $ `linux/linux_fix.h:44:9`!(OnScreenButtonTypes[i], btype_buf, strlen(OnScreenButtonTypes[i]))) {
899 type = i;
900 found = true;
901 }
902 i++;
903 }
904 if (type == osbJUMP_PAGEcxx . . $ `Descent3/BriefingParse.cpp:187:9`!) {
905 // parse what screen to jump to
906 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(screen);
907 }
908 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "click")) {
909 char ctype_buf[30];
910 bool found = false;
911 int i = 0;
912
913 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(ctype_buf);
914 while (!found) {
915 if (!OnScreenButtonClickTypescxx . . $ OnScreenButtonClickTypes.[i])
916 found = true;
917 else if (!strnicmpcxx . . $ `linux/linux_fix.h:44:9`!(OnScreenButtonClickTypes[i], ctype_buf, strlen(OnScreenButtonClickTypes[i]))) {
918 ctype = i;
919 found = true;
920 }
921 i++;
922 }
923 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isset")) {
924 int value, bit = 0x01;
925 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
926 if (value >= 0 && value < 32) {
927 bit = bit << value;
928 mission_mask_set |= bit;
929 }
930 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isnset")) {
931 int value, bit = 0x01;
932 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
933 if (value >= 0 && value < 32) {
934 bit = bit << value;
935 mission_mask_unset |= bit;
936 }
937 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "glow")) {
938 flasher = true;
939 osflags |= OBF_GLOWcxx . . $ `Descent3/TelComEfxStructs.h:306:9`!;
940 } else
941 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Illegal parameter in $BUTTON");
942
943 if (!show)
944 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(buffer);
945 }
946
947 char name[256];
948 char name_focus[256];
949 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(name);
950 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(name_focus);
951
952 if (flasher && osflags == OBF_GLOWcxx . . $ `Descent3/TelComEfxStructs.h:306:9`!) {
953 // see if user specified a glow, but gave no flash, so we need to get a filename
954 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(flash_name);
955 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(flash_name_focus);
956 flash_time = -1;
957 }
958
959 // Fill in the button description struct
960 TCBUTTONDESCcxx . . $ TCBUTTONDESC# desc;
961 desc.sibling_idcxx . . $ TCBUTTONDESC#sibling_id. = s_id;
962 desc.parent_idcxx . . $ TCBUTTONDESC#parent_id. = p_id;
963 desc.mission_mask_setcxx . . $ TCBUTTONDESC#mission_mask_set. = mission_mask_set;
964 desc.mission_mask_unsetcxx . . $ TCBUTTONDESC#mission_mask_unset. = mission_mask_unset;
965
966 // determine what type of button this is
967 switch (type) {
968 case osbDOWN_ARROWcxx . . $ `Descent3/BriefingParse.cpp:182:9`!:
969 desc.button_typecxx . . $ TCBUTTONDESC#button_type. = BUTT_DOWNARROWcxx . . $ `Descent3/TelComEffects.h:179:9`!;
970 break;
971 case osbUP_ARROWcxx . . $ `Descent3/BriefingParse.cpp:183:9`!:
972 desc.button_typecxx . . $ TCBUTTONDESC#button_type. = BUTT_UPARROWcxx . . $ `Descent3/TelComEffects.h:178:9`!;
973 break;
974 case osbNEXT_PAGEcxx . . $ `Descent3/BriefingParse.cpp:184:9`!:
975 desc.button_typecxx . . $ TCBUTTONDESC#button_type. = BUTT_NEXTPAGEcxx . . $ `Descent3/TelComEffects.h:180:9`!;
976 break;
977 case osbPREV_PAGEcxx . . $ `Descent3/BriefingParse.cpp:185:9`!:
978 desc.button_typecxx . . $ TCBUTTONDESC#button_type. = BUTT_PREVPAGEcxx . . $ `Descent3/TelComEffects.h:181:9`!;
979 break;
980 case osbQUITcxx . . $ `Descent3/BriefingParse.cpp:186:9`!:
981 desc.button_typecxx . . $ TCBUTTONDESC#button_type. = BUTT_QUITcxx . . $ `Descent3/TelComEffects.h:182:9`!;
982 break;
983 case osbJUMP_PAGEcxx . . $ `Descent3/BriefingParse.cpp:187:9`!:
984 desc.button_typecxx . . $ TCBUTTONDESC#button_type. = BUTT_JUMPcxx . . $ `Descent3/TelComEffects.h:184:9`!;
985 desc.jump_pagecxx . . $ TCBUTTONDESC#jump_page. = screen;
986 break;
987 default:
988 Int3cxx . . $ `misc/pserror.h:247:9`!(); // Illegal button type
989 desc.button_typecxx . . $ TCBUTTONDESC#button_type. = BUTT_NEXTPAGEcxx . . $ `Descent3/TelComEffects.h:180:9`!;
990 break;
991 };
992
993 // determine what type of click the button wants
994 switch (ctype) {
995 case oscHOLD_DOWNcxx . . $ `Descent3/BriefingParse.cpp:193:9`!:
996 desc.click_typecxx . . $ TCBUTTONDESC#click_type. = CLICKTYPE_DOWNcxx . . $ `Descent3/TelComEffects.h:189:9`!;
997 break;
998 case oscCLICK_DOWNcxx . . $ `Descent3/BriefingParse.cpp:194:9`!:
999 desc.click_typecxx . . $ TCBUTTONDESC#click_type. = CLICKTYPE_CLICKDOWNcxx . . $ `Descent3/TelComEffects.h:187:9`!;
1000 break;
1001 case oscCLICK_UPcxx . . $ `Descent3/BriefingParse.cpp:195:9`!:
1002 desc.click_typecxx . . $ TCBUTTONDESC#click_type. = CLICKTYPE_CLICKUPcxx . . $ `Descent3/TelComEffects.h:188:9`!;
1003 break;
1004 default:
1005 Int3cxx . . $ `misc/pserror.h:247:9`!(); // Illegal click type
1006 desc.click_typecxx . . $ TCBUTTONDESC#click_type. = CLICKTYPE_CLICKUPcxx . . $ `Descent3/TelComEffects.h:188:9`!;
1007 break;
1008 };
1009
1010 // fill in the rest of the information and create the button
1011 desc.xcxx . . $ TCBUTTONDESC#x. = x;
1012 desc.ycxx . . $ TCBUTTONDESC#y. = y;
1013 strcpy(desc.filenamecxx . . $ TCBUTTONDESC#filename., name);
1014 strcpy(desc.filename_focuscxx . . $ TCBUTTONDESC#filename_focus., name_focus);
1015 strcpy(desc.flash_filenamecxx . . $ TCBUTTONDESC#flash_filename., flash_name);
1016 strcpy(desc.flash_filename_focuscxx . . $ TCBUTTONDESC#flash_filename_focus., flash_name_focus);
1017 desc.flash_timecxx . . $ TCBUTTONDESC#flash_time. = flash_time;
1018 desc.osflagscxx . . $ TCBUTTONDESC#osflags. = osflags;
1019 desc.flashercxx . . $ TCBUTTONDESC#flasher. = flasher;
1020
1021 if (AddButtonEffectcxx . . $ CBriefParse#AddButtonEffect.)
1022 (*AddButtonEffectcxx . . $ CBriefParse#AddButtonEffect.)(&desc, d, id);
1023 return true;
1024
1025 done_parsing:
1026 return false;
1027 }
1028
1029 // Parses a text keyword description
1030 bool CBriefParsecxx . . $ CBriefParse#::ParseTextEffectcxx . . $ CBriefParse#ParseTextEffect(7303da5f26e915b1).(const char *p, tTextBufferDesccxx . . $ tTextBufferDesc# *tbd) {
1031 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..capscxx . . $ TCTEXTDESC#caps. = 0;
1032 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..typecxx . . $ TCTEXTDESC#type. = TC_TEXT_STATICcxx . . $ `Descent3/TelComEfxStructs.h:135:9`!;
1033 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..flagscxx . . $ TCTEXTDESC#flags. = 0;
1034 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..mission_mask_setcxx . . $ TCTEXTDESC#mission_mask_set. = 0;
1035 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..mission_mask_unsetcxx . . $ TCTEXTDESC#mission_mask_unset. = 0;
1036 char buffer[64];
1037 bool done = 0;
1038 bool found;
1039 float speed, starttime;
1040 int i, lx, rx, ty, by;
1041 tbd->descriptioncxx . . $ tTextBufferDesc#description.[0] = '\0';
1042
1043 while (!done) {
1044 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(buffer);
1045
1046 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "show")) {
1047 done = 1;
1048 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "id")) {
1049 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(tbd->text_id);
1050 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "desc")) {
1051 PARSE_STRINGcxx . . $ `Descent3/BriefingParse.cpp:217:9`!(tbd->description);
1052 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isset")) {
1053 int value, bit = 0x01;
1054 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
1055 if (value >= 0 && value < 32) {
1056 bit = bit << value;
1057 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..mission_mask_setcxx . . $ TCTEXTDESC#mission_mask_set. |= bit;
1058 }
1059 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "isnset")) {
1060 int value, bit = 0x01;
1061 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(value);
1062 if (value >= 0 && value < 32) {
1063 bit = bit << value;
1064 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..mission_mask_unsetcxx . . $ TCTEXTDESC#mission_mask_unset. |= bit;
1065 }
1066 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "tabstop")) {
1067 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..capscxx . . $ TCTEXTDESC#caps. |= TCTD_TABSTOPcxx . . $ `Descent3/TelComEfxStructs.h:113:9`!;
1068 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "effect")) {
1069 found = false;
1070 i = 0;
1071 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(buffer);
1072 while (!found) {
1073 if (!TextEffectstrcxx . . $ TextEffectstr.[i])
1074 found = true;
1075 else if (!strnicmpcxx . . $ `linux/linux_fix.h:44:9`!(TextEffectstr[i], buffer, strlen(TextEffectstr[i]))) {
1076 tbd->teffectcxx . . $ tTextBufferDesc#teffect. = i;
1077 found = true;
1078 }
1079 i++;
1080 }
1081 switch (tbd->teffectcxx . . $ tTextBufferDesc#teffect.) {
1082 case tfxFLASHcxx . . $ `Descent3/BriefingParse.cpp:149:9`!:
1083 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..typecxx . . $ TCTEXTDESC#type. = TC_TEXT_FLASHcxx . . $ `Descent3/TelComEfxStructs.h:138:9`!;
1084 break;
1085 case tfxSCROLL_L2Rcxx . . $ `Descent3/BriefingParse.cpp:150:9`!:
1086 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..typecxx . . $ TCTEXTDESC#type. = TC_TEXT_SCROLLcxx . . $ `Descent3/TelComEfxStructs.h:136:9`!;
1087 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..flagscxx . . $ TCTEXTDESC#flags. = TC_TEXTF_L2Rcxx . . $ `Descent3/TelComEfxStructs.h:150:9`!;
1088 break;
1089 case tfxSCROLL_R2Lcxx . . $ `Descent3/BriefingParse.cpp:151:9`!:
1090 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..typecxx . . $ TCTEXTDESC#type. = TC_TEXT_SCROLLcxx . . $ `Descent3/TelComEfxStructs.h:136:9`!;
1091 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..flagscxx . . $ TCTEXTDESC#flags. = TC_TEXTF_R2Lcxx . . $ `Descent3/TelComEfxStructs.h:151:9`!;
1092 break;
1093 case tfxSCROLL_T2Bcxx . . $ `Descent3/BriefingParse.cpp:152:9`!:
1094 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..typecxx . . $ TCTEXTDESC#type. = TC_TEXT_SCROLLcxx . . $ `Descent3/TelComEfxStructs.h:136:9`!;
1095 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..flagscxx . . $ TCTEXTDESC#flags. = TC_TEXTF_T2Bcxx . . $ `Descent3/TelComEfxStructs.h:152:9`!;
1096 break;
1097 case tfxSCROLL_B2Tcxx . . $ `Descent3/BriefingParse.cpp:153:9`!:
1098 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..typecxx . . $ TCTEXTDESC#type. = TC_TEXT_SCROLLcxx . . $ `Descent3/TelComEfxStructs.h:136:9`!;
1099 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..flagscxx . . $ TCTEXTDESC#flags. = TC_TEXTF_B2Tcxx . . $ `Descent3/TelComEfxStructs.h:153:9`!;
1100 break;
1101 case tfxFADE_INcxx . . $ `Descent3/BriefingParse.cpp:155:9`!:
1102 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..typecxx . . $ TCTEXTDESC#type. = TC_TEXT_FADEcxx . . $ `Descent3/TelComEfxStructs.h:137:9`!;
1103 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..flagscxx . . $ TCTEXTDESC#flags. = TC_TEXTF_INcxx . . $ `Descent3/TelComEfxStructs.h:154:9`!;
1104 break;
1105 case tfxFADE_OUTcxx . . $ `Descent3/BriefingParse.cpp:156:9`!:
1106 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..typecxx . . $ TCTEXTDESC#type. = TC_TEXT_FADEcxx . . $ `Descent3/TelComEfxStructs.h:137:9`!;
1107 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..flagscxx . . $ TCTEXTDESC#flags. = TC_TEXTF_OUTcxx . . $ `Descent3/TelComEfxStructs.h:155:9`!;
1108 break;
1109 case tfxFADE_IN_AND_OUTcxx . . $ `Descent3/BriefingParse.cpp:154:9`!:
1110 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..typecxx . . $ TCTEXTDESC#type. = TC_TEXT_FADEcxx . . $ `Descent3/TelComEfxStructs.h:137:9`!;
1111 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..flagscxx . . $ TCTEXTDESC#flags. = TC_TEXTF_PINGPONGcxx . . $ `Descent3/TelComEfxStructs.h:156:9`!;
1112 break;
1113 default:
1114 break;
1115 }
1116 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "scroll")) {
1117 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..capscxx . . $ TCTEXTDESC#caps. |= TCTD_SCROLLcxx . . $ `Descent3/TelComEfxStructs.h:112:9`!;
1118 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "speed")) {
1119 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(speed);
1120 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..speedcxx . . $ TCTEXTDESC#speed. = speed;
1121 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..capscxx . . $ TCTEXTDESC#caps. |= TCTD_SPEEDcxx . . $ `Descent3/TelComEfxStructs.h:108:9`!;
1122 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "color")) {
1123 int r, g, b;
1124 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(r);
1125 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
1126 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(g);
1127 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
1128 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(b);
1129 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..colorcxx . . $ TCTEXTDESC#color. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(r, g, b);
1130 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..capscxx . . $ TCTEXTDESC#caps. |= TCTD_COLORcxx . . $ `Descent3/TelComEfxStructs.h:107:9`!;
1131 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "font")) {
1132 char buffer[20];
1133 bool found = false;
1134 int i = 0;
1135 int feffect = 0;
1136 int text_font;
1137
1138 PARSE_TOKENcxx . . $ `Descent3/BriefingParse.cpp:223:9`!(buffer);
1139 while (!found) {
1140 if (!FontNamescxx . . $ FontNames.[i])
1141 found = true;
1142 else if (!strnicmpcxx . . $ `linux/linux_fix.h:44:9`!(FontNames[i], buffer, strlen(FontNames[i]))) {
1143 feffect = i;
1144 found = true;
1145 }
1146 i++;
1147 }
1148 switch (feffect) {
1149 case fntSMBRIEFcxx . . $ `Descent3/BriefingParse.cpp:158:9`!:
1150 text_font = BRIEF_FONT_INDEXcxx . . $ `Descent3/gamefont.h:113:9`!;
1151 break;
1152 case fntLGBRIEFcxx . . $ `Descent3/BriefingParse.cpp:159:9`!:
1153 text_font = BBRIEF_FONT_INDEXcxx . . $ `Descent3/gamefont.h:114:9`!;
1154 break;
1155 }
1156
1157 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..fontcxx . . $ TCTEXTDESC#font. = text_font;
1158 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..capscxx . . $ TCTEXTDESC#caps. |= TCTD_FONTcxx . . $ `Descent3/TelComEfxStructs.h:106:9`!;
1159 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "starttime")) {
1160 PARSE_FLOATcxx . . $ `Descent3/BriefingParse.cpp:205:9`!(starttime);
1161 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..waittimecxx . . $ TCTEXTDESC#waittime. = starttime;
1162 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..capscxx . . $ TCTEXTDESC#caps. |= TCTD_WAITTIMEcxx . . $ `Descent3/TelComEfxStructs.h:110:9`!;
1163 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "box")) {
1164 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(lx);
1165 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
1166 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(rx);
1167 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
1168 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(ty);
1169 PARSE_COMMAcxx . . $ `Descent3/BriefingParse.cpp:211:9`!();
1170 PARSE_INTcxx . . $ `Descent3/BriefingParse.cpp:199:9`!(by);
1171 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..textboxcxx . . $ TCTEXTDESC#textbox..leftcxx . . $ tc_text#left. = lx;
1172 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..textboxcxx . . $ TCTEXTDESC#textbox..rightcxx . . $ tc_text#right. = rx;
1173 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..textboxcxx . . $ TCTEXTDESC#textbox..topcxx . . $ tc_text#top. = ty;
1174 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..textboxcxx . . $ TCTEXTDESC#textbox..bottomcxx . . $ tc_text#bottom. = by;
1175 tbd->textdesccxx . . $ tTextBufferDesc#textdesc..capscxx . . $ TCTEXTDESC#caps. |= TCTD_TEXTBOXcxx . . $ `Descent3/TelComEfxStructs.h:111:9`!;
1176 } else
1177 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Illegal parameter in $TEXT");
1178 }
1179
1180 return true;
1181
1182 done_parsing:
1183 return false;
1184 }
1185
1186 // Generates an parsing error
1187 void CBriefParsecxx . . $ CBriefParse#::ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).(const char *msg, const char *p) {
1188 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "ERROR, line %d: %s\n", linenum, msg);
1189 if (p) {
1190 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, " %s\n", p);
1191 }
1192
1193 parse_errorcxx . . $ CBriefParse#parse_error. = 1;
1194 }
1195
1196 // Parses a keyword
1197 const char *CBriefParsecxx . . $ CBriefParse#::ParseKeywordcxx . . $ CBriefParse#ParseKeyword(6a735779416056db).(const char *p, int *keyword_id) {
1198 int i;
1199
1200 *keyword_id = K_NONEcxx . . $ `Descent3/BriefingParse.cpp:122:9`!;
1201
1202 ASSERTcxx . . $ `misc/pserror.h:246:9`!(*p == '$');
1203
1204 for (i = 0, p++; i < NUM_KEYWORDScxx . . $ `Descent3/BriefingParse.cpp:136:9`!; i++) {
1205 int len = strlen(keywordscxx . . $ keywords.[i]);
1206
1207 if (!strnicmpcxx . . $ `linux/linux_fix.h:44:9`!(p, keywords[i], len)) {
1208 if (!isalnum(p[len])) {
1209 *keyword_id = i;
1210 return p + strlen(keywordscxx . . $ keywords.[i]);
1211 }
1212 }
1213 }
1214 // Error -- return initial pointer
1215 return p;
1216 }
1217
1218 // Removes whitespace from the start of the given string.
1219 // Returns a pointer to the first non-white character
1220 const char *CBriefParsecxx . . $ CBriefParse#::SkipWhitecxx . . $ CBriefParse#SkipWhite(fb58d2e09a2a1ce6).(const char *p) {
1221 while (isspace(*p))
1222 p++;
1223
1224 return p;
1225 }
1226
1227 // Parses a sequence of non-space characters
1228 const char *CBriefParsecxx . . $ CBriefParse#::ParseTokencxx . . $ CBriefParse#ParseToken(7e82c60a547522db).(const char *p, char *buf, int bufsize) {
1229 const char *save_p;
1230
1231 p = SkipWhitecxx . . $ CBriefParse#SkipWhite(fb58d2e09a2a1ce6).(p);
1232
1233 save_p = p;
1234
1235 while (!isspace(*p) && (*p != ',') && *p && --bufsize)
1236 *buf++ = *p++;
1237
1238 *buf = 0;
1239
1240 // Check for buffer overflow
1241 if (bufsize <= 0) {
1242 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Token too long", save_p);
1243 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1244 }
1245
1246 return p;
1247 }
1248
1249 // Parses a quoted string
1250 // Returns true if got string ok, else false
1251 const char *CBriefParsecxx . . $ CBriefParse#::ParseStringcxx . . $ CBriefParse#ParseString(7e82c60a547522db).(const char *p, char *buf, int bufsize) {
1252 const char *save_p;
1253
1254 p = SkipWhitecxx . . $ CBriefParse#SkipWhite(fb58d2e09a2a1ce6).(p);
1255
1256 save_p = p;
1257
1258 if (*p != '"') {
1259 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Missing quote", p);
1260 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1261 } else
1262 p++; // skip initial quote
1263
1264 // Copy chars until endquote or out of space
1265 while (*p && (*p != '"') && --bufsize)
1266 *buf++ = *p++;
1267
1268 // Check for buffer overflow
1269 if (bufsize <= 0) {
1270 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("String too long", save_p);
1271 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1272 }
1273
1274 // Check for missing endquote
1275 if (!*p) {
1276 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Missing endquote", save_p);
1277 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1278 }
1279
1280 // Write terminator
1281 *buf = 0;
1282
1283 // Return new pointer (move over a char for end quote)
1284 return p + 1;
1285 }
1286
1287 // Parses an integer value
1288 const char *CBriefParsecxx . . $ CBriefParse#::ParseIntcxx . . $ CBriefParse#ParseInt(6a735779416056db).(const char *p, int *i) {
1289 const char *t;
1290 bool got_digit = 0;
1291
1292 t = p = SkipWhitecxx . . $ CBriefParse#SkipWhite(fb58d2e09a2a1ce6).(p);
1293
1294 // Check for negative sign
1295 if (*t == '-')
1296 t++;
1297
1298 // Check for valid characters in number
1299 while (isdigit(*t)) {
1300 t++;
1301 got_digit = 1;
1302 }
1303
1304 // Make sure at least one digit
1305 if (!got_digit)
1306 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Expecting digit", p);
1307
1308 // Check for valid seperator, and convert
1309 if ((*t == 0) || isspace(*t) || (*t == ',')) { // valid number
1310 *i = atoi(p);
1311 return t;
1312 } else {
1313 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Invalid character in integer", p);
1314 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1315 }
1316 }
1317
1318 // Parses a floating-point value
1319 const char *CBriefParsecxx . . $ CBriefParse#::ParseFloatcxx . . $ CBriefParse#ParseFloat(2db94096432b516).(const char *p, float *f) {
1320 const char *t;
1321 bool got_digit = 0;
1322
1323 t = p = SkipWhitecxx . . $ CBriefParse#SkipWhite(fb58d2e09a2a1ce6).(p);
1324
1325 // Check for negative sign
1326 if (*t == '-')
1327 t++;
1328
1329 // Check for valid characters in number
1330 while (isdigit(*t)) {
1331 got_digit = 1;
1332 t++;
1333 }
1334
1335 // Check for decimal point
1336 if (*t == '.') {
1337 t++;
1338
1339 // Check for more digits
1340 while (isdigit(*t)) {
1341 got_digit = 1;
1342 t++;
1343 }
1344 }
1345
1346 // Make sure at least one digit
1347 if (!got_digit) {
1348 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Expecting digit", p);
1349 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1350 }
1351
1352 // Check for valid seperator, and convert
1353 if ((*t == 0) || isspace(*t) || (*t == ',')) { // valid number
1354 *f = atof(p);
1355 return t;
1356 } else {
1357 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Invalid character in floating-point number", p);
1358 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1359 }
1360 }
1361
1362 // Parses a comma
1363 const char *CBriefParsecxx . . $ CBriefParse#::ParseCommacxx . . $ CBriefParse#ParseComma(fb58d2e09a2a1ce6).(const char *p) {
1364 p = SkipWhitecxx . . $ CBriefParse#SkipWhite(fb58d2e09a2a1ce6).(p);
1365
1366 if (*p != ',') {
1367 ParseErrorcxx . . $ CBriefParse#ParseError(2fa786934fe80e24).("Comma expected");
1368 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1369 }
1370
1371 return p + 1;
1372 }