Debian Codegraph @

Descent3/credits.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 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/main/credits.cpp $
21 * $Revision: 17 $
22 * $Date: 10/05/99 3:00p $
23 * $Author: Kevin $
24 *
25 * Credits system
26 *
27 * $Log: /DescentIII/main/credits.cpp $
28 *
29 * 17 10/05/99 3:00p Kevin
30 * No longer display static credits for demo
31 *
32 * 16 5/13/99 6:41p Samir
33 * don't reset mouse when ending credits. causes problems.
34 *
35 * 15 5/08/99 1:43p Jason
36 * made credits scroll a little faster
37 *
38 * 14 5/05/99 7:38p Jason
39 * added scrolling credits system
40 *
41 * 13 5/02/99 12:08a Jason
42 * changes to credits
43 *
44 * 12 4/30/99 5:42p Jason
45 * more updates to credits system
46 *
47 * 11 4/29/99 11:57a Samir
48 * added music.
49 *
50 * 10 4/19/99 12:46p Jason
51 * fixed credits
52 *
53 * 9 4/17/99 3:29p Jason
54 * first pass at credit system
55 *
56 * 8 4/15/99 2:32p Kevin
57 * Added some code for the Demo
58 *
59 * 7 4/14/99 4:19a Jeff
60 * more case mismatch fixes in #includes
61 *
62 * 6 4/13/99 12:24p Jason
63 * made credits warp faster
64 *
65 * 5 4/02/99 5:47p Jeff
66 * text effect in
67 *
68 * 4 4/02/99 6:03a Jeff
69 * testing a new text effect...not done yet
70 *
71 * 3 3/31/99 3:04p Jeff
72 * added _real_ temporary credits system...
73 *
74 * 2 3/31/99 12:11p Jeff
75 * added empty credits file
76 *
77 * $NoKeywords: $
78 */
79
80 #include "mono.h"cxx . . $ `<file>/ddebug/mono.h`/
81 #include "pstypes.h"cxx . . $ `<file>/lib/pstypes.h`/
82 #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/
83 #include "grtext.h"cxx . . $ `<file>/grtext/grtext.h`/
84 #include "renderer.h"cxx . . $ `<file>/lib/renderer.h`/
85 #include "gamefont.h"cxx . . $ `<file>/Descent3/gamefont.h`/
86 #include "game.h"cxx . . $ `<file>/Descent3/game.h`/
87 #include "bitmap.h"cxx . . $ `<file>/lib/bitmap.h`/
88 #include "descent.h"cxx . . $ `<file>/Descent3/descent.h`/
89 #include "mem.h"cxx . . $ `<file>/mem/mem.h`/
90 #include "3d.h"cxx . . $ `<file>/lib/3d.h`/
91 #include "d3music.h"cxx . . $ `<file>/Descent3/d3music.h`/
92 #include "hlsoundlib.h"cxx . . $ `<file>/sndlib/hlsoundlib.h`/
93 #include <string.h>
94 #include <math.h>
95 #include "psrand.h"cxx . . $ `<file>/misc/psrand.h`/
96
97 #if defined(POSIXcxx . . $ `<built-in>:480:9`!)
98 #include "linux_fix.h"cxx . . $ `<file>/linux/linux_fix.h`/
99 #endif
100
101 /*
102 $$TABLE_GAMEFILE "GameCredits.txt"
103 $$TABLE_GAMEFILE "credits.omf"
104 */
105
106 // music regions for credits
107 #define CREDITS1_MUSIC_REGIONcxx . . $ `Descent3/credits.cpp:107:9`! 0
108
109 // other stuff
110 #define CLTYPE_HEADINGcxx . . $ `Descent3/credits.cpp:110:9`! 0
111 #define CLTYPE_TEXTcxx . . $ `Descent3/credits.cpp:111:9`! 1
112 #define CLTYPE_ENDcxx . . $ `Descent3/credits.cpp:112:9`! 2
113 #define CLTYPE_BLANKcxx . . $ `Descent3/credits.cpp:113:9`! 3
114
115 struct creditlinecxx . . $ creditline# {
116 ddgr_colorcxx . . $ ddgr_color# colorcxx . . $ creditline#color.;
117 uint8_tcxx . . $ uint8_t# typecxx . . $ creditline#type.;
118 char *textcxx . . $ creditline#text.;
119 creditlinecxx . . $ creditline# *nextcxx . . $ creditline#next.;
120 uint16_tcxx . . $ uint16_t# startxcxx . . $ creditline#startx., startycxx . . $ creditline#starty., endxcxx . . $ creditline#endx., endycxx . . $ creditline#endy.;
121 float displaytimecxx . . $ creditline#displaytime.;
122 };
123
124 static void Credits_Rendercxx . . $ Credits_Render(7f50fdcbec098d61).(creditlinecxx . . $ creditline# *, float);
125 static creditlinecxx . . $ creditline# Creditlinescxx . . $ Creditlines.;
126
127 static ddgr_colorcxx . . $ ddgr_color# CreditTextColorcxx . . $ CreditTextColor., CreditHeadingColorcxx . . $ CreditHeadingColor.;
128 static int CreditStartXcxx . . $ CreditStartX., CreditStartYcxx . . $ CreditStartY., CreditEndXcxx . . $ CreditEndX., CreditEndYcxx . . $ CreditEndY.;
129 static float CreditDisplayTimecxx . . $ CreditDisplayTime.;
130 static chunked_bitmapcxx . . $ chunked_bitmap# Credits_bmcxx . . $ Credits_bm.;
131
132 #define MAX_CREDIT_LENcxx . . $ `Descent3/credits.cpp:132:9`! 200
133
134 static bool Credits_IsKeyPressedcxx . . $ Credits_IsKeyPressed(c9857a73d68e59ba).(void) {
135 if (ddio_KeyInKeycxx . . $ ddio_KeyInKey(b126dc7c1de90089).())
136 return true;
137
138 return false;
139 }
140
141 // Parses a credit line
142 // Returns 1 if new text was read, else 0
143 static int Credits_ParseLinecxx . . $ Credits_ParseLine(8165dbdc19189d8a).(char *line, creditlinecxx . . $ creditline# *credit) {
144 int line_len = strlen(line);
145 int new_text = 0;
146
147 if (line_len < 1) {
148 ASSERTcxx . . $ `misc/pserror.h:246:9`!(credit->next == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
149 ASSERTcxx . . $ `misc/pserror.h:246:9`!(credit->text == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
150
151 credit->textcxx . . $ creditline#text. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
152
153 credit->typecxx . . $ creditline#type. = CLTYPE_BLANKcxx . . $ `Descent3/credits.cpp:113:9`!;
154 new_text = 1;
155
156 } else if (line[0] == ';') // Comment
157 return 0;
158 else if (line[0] == '*') // Movement data
159 {
160 int x1, x2, y1, y2;
161 float timedelay;
162
163 int num_found = sscanf(line, "*%d %d %d %d %f", &x1, &y1, &x2, &y2, &timedelay);
164 if (num_found != 5) {
165 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Bad movement data in credit text (%s)\n", line);
166 return 0;
167 } else {
168 CreditStartXcxx . . $ CreditStartX. = x1;
169 CreditStartYcxx . . $ CreditStartY. = y1;
170 CreditEndXcxx . . $ CreditEndX. = x2;
171 CreditEndYcxx . . $ CreditEndY. = y2;
172 CreditDisplayTimecxx . . $ CreditDisplayTime. = timedelay;
173 }
174
175 } else if (line[0] == '!') // Heading
176 {
177 ASSERTcxx . . $ `misc/pserror.h:246:9`!(credit->next == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
178 ASSERTcxx . . $ `misc/pserror.h:246:9`!(credit->text == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
179
180 credit->textcxx . . $ creditline#text. = (char *)mem_malloccxx . . $ `mem/mem.h:79:9`!(line_len + 1);
181 ASSERTcxx . . $ `misc/pserror.h:246:9`!(credit->text);
182
183 strcpy(credit->textcxx . . $ creditline#text., &line[1]);
184 credit->startxcxx . . $ creditline#startx. = CreditStartXcxx . . $ CreditStartX.;
185 credit->startycxx . . $ creditline#starty. = CreditStartYcxx . . $ CreditStartY.;
186 credit->endxcxx . . $ creditline#endx. = CreditEndXcxx . . $ CreditEndX.;
187 credit->endycxx . . $ creditline#endy. = CreditEndYcxx . . $ CreditEndY.;
188 credit->displaytimecxx . . $ creditline#displaytime. = CreditDisplayTimecxx . . $ CreditDisplayTime.;
189 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Read header %s\n", line);
190
191 credit->colorcxx . . $ creditline#color. = CreditHeadingColorcxx . . $ CreditHeadingColor.;
192 credit->typecxx . . $ creditline#type. = CLTYPE_HEADINGcxx . . $ `Descent3/credits.cpp:110:9`!;
193 new_text = 1;
194
195 } else if (line[0] == '$') // text color
196 {
197 int r, g, b;
198 int num_found = sscanf(line, "$%d %d %d", &r, &g, &b);
199 if (num_found != 3) {
200 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Bad color in credit text (%s)\n", line);
201 return 0;
202 } else {
203 CreditTextColorcxx . . $ CreditTextColor. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(r, g, b);
204 }
205
206 } else if (line[0] == '^') // heading color
207 {
208 int r, g, b;
209 int num_found = sscanf(line, "^%d %d %d", &r, &g, &b);
210 if (num_found != 3) {
211 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Bad color in credit text (%s)\n", line);
212 return 0;
213 } else {
214 CreditHeadingColorcxx . . $ CreditHeadingColor. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(r, g, b);
215 }
216
217 } else {
218 ASSERTcxx . . $ `misc/pserror.h:246:9`!(credit->next == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
219 ASSERTcxx . . $ `misc/pserror.h:246:9`!(credit->text == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
220
221 if (!strnicmpcxx . . $ `linux/linux_fix.h:44:9`!("Jason Leighton", line, 14) && (ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 100) == 0) {
222 strcat(line, " (Hi mom!)");
223 line_len += 10;
224 }
225
226 credit->textcxx . . $ creditline#text. = (char *)mem_malloccxx . . $ `mem/mem.h:79:9`!(line_len + 1);
227 ASSERTcxx . . $ `misc/pserror.h:246:9`!(credit->text);
228
229 strcpy(credit->textcxx . . $ creditline#text., line);
230 credit->colorcxx . . $ creditline#color. = CreditTextColorcxx . . $ CreditTextColor.;
231 credit->typecxx . . $ creditline#type. = CLTYPE_TEXTcxx . . $ `Descent3/credits.cpp:111:9`!;
232 // mprintf(0,"Read textline %s\n",line);
233 new_text = 1;
234 }
235
236 return new_text;
237 }
238
239 // Given a filename, attempts to load that filename as credit text
240 static bool Credits_LoadCreditscxx . . $ Credits_LoadCredits(c5f7da30cbc0f4e9).(const char *filename) {
241 CFILEcxx . . $ CFILE# *infile;
242 char curline[MAX_CREDIT_LENcxx . . $ `Descent3/credits.cpp:132:9`!];
243
244 // Reset our data
245 CreditTextColorcxx . . $ CreditTextColor. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 128, 255);
246 CreditHeadingColorcxx . . $ CreditHeadingColor. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(255, 255, 255);
247 CreditStartXcxx . . $ CreditStartX. = CreditEndXcxx . . $ CreditEndX. = 320;
248 CreditStartYcxx . . $ CreditStartY. = CreditEndYcxx . . $ CreditEndY. = 50;
249 CreditDisplayTimecxx . . $ CreditDisplayTime. = 10;
250
251 creditlinecxx . . $ creditline# *cur_credit = &Creditlinescxx . . $ Creditlines.;
252 Creditlinescxx . . $ Creditlines..nextcxx . . $ creditline#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
253 Creditlinescxx . . $ Creditlines..textcxx . . $ creditline#text. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
254
255 // Open the file, bail on failure
256 infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(filenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rt");
257
258 if (!infile) {
259 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't open credit file to read credits!\n");
260 return false;
261 }
262
263 for (int i = 0; i < 27; i++) {
264 // Generate blank lines for the start
265 cur_credit->textcxx . . $ creditline#text. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
266 cur_credit->typecxx . . $ creditline#type. = CLTYPE_BLANKcxx . . $ `Descent3/credits.cpp:113:9`!;
267 cur_credit->nextcxx . . $ creditline#next. = (creditlinecxx . . $ creditline# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(creditline));
268 ASSERTcxx . . $ `misc/pserror.h:246:9`!(cur_credit->next);
269 cur_credit = cur_credit->nextcxx . . $ creditline#next.;
270 cur_credit->nextcxx . . $ creditline#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
271 cur_credit->textcxx . . $ creditline#text. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
272 }
273
274 // Read in each line of the credit file, allocing memory and putting it into a correct category
275 int done = 0;
276 while (!done) {
277 if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) {
278 done = 1;
279 continue;
280 }
281
282 // Read a line and parse it
283 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(curline, MAX_CREDIT_LENcxx . . $ `Descent3/credits.cpp:132:9`!, infile);
284 // mprintf(0,"Read string %s\n",curline);
285
286 if (!strnicmpcxx . . $ `linux/linux_fix.h:44:9`!("END", curline, 3)) {
287 done = 1;
288 continue;
289 }
290
291 if (Credits_ParseLinecxx . . $ Credits_ParseLine(8165dbdc19189d8a).(curline, cur_credit)) {
292 // Make a new line
293 cur_credit->nextcxx . . $ creditline#next. = (creditlinecxx . . $ creditline# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(creditline));
294 ASSERTcxx . . $ `misc/pserror.h:246:9`!(cur_credit->next);
295 cur_credit = cur_credit->nextcxx . . $ creditline#next.;
296 cur_credit->nextcxx . . $ creditline#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
297 cur_credit->textcxx . . $ creditline#text. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
298 }
299 }
300
301 cur_credit->typecxx . . $ creditline#type. = CLTYPE_ENDcxx . . $ `Descent3/credits.cpp:112:9`!;
302
303 cfclosecxx . . $ cfclose(3639e799710acb68).(infile);
304 return true;
305 }
306
307 extern void ShowStaticScreencxx . . $ ShowStaticScreen(a47e1dae55ed58c9).(char *bitmap_filename, bool timed = false, float delay_time = 0.0f);
308
309 #define CREDIT_PIXELS_PER_SECONDcxx . . $ `Descent3/credits.cpp:309:9`! 22
310
311 void Credits_Displaycxx . . $ Credits_Display(49f6e7a06ebc5aa8).(void) {
312 #ifdef DEMO
313 // ShowStaticScreen("democredits1.ogf");
314 // ShowStaticScreen("democredits2.ogf");
315 // return;
316 #else
317 // Load background image
318 int bm_handle = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("CreditsBackground.tga", 0);
319
320 if (bm_handle < 0) {
321 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Failed to load background credit screen!\n");
322 return;
323 }
324
325 if (!bm_CreateChunkedBitmapcxx . . $ bm_CreateChunkedBitmap(b9fa1b176cbdfaf1).(bm_handle, &Credits_bmcxx . . $ Credits_bm.)) {
326 Errorcxx . . $ Error(326aeb464d16410c).("Failed to slice up credits screen!");
327 }
328
329 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(bm_handle);
330
331 // start up the music
332 D3MusicStartcxx . . $ D3MusicStart(85c52e162fed56f9).("credits.omf");
333 D3MusicSetRegioncxx . . $ D3MusicSetRegion(472b8ebd11b2ca81).(CREDITS1_MUSIC_REGIONcxx . . $ `Descent3/credits.cpp:107:9`!);
334
335 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Chillin in credits\n");
336
337 // Load our credits
338 if (!Credits_LoadCreditscxx . . $ Credits_LoadCredits(c5f7da30cbc0f4e9).("GameCredits.txt")) {
339 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "There was an error loading game credits!\n");
340 } else {
341 // First count how many headers there are so we know how many to allocate
342 int count = 0;
343 int done = 0;
344 creditlinecxx . . $ creditline# *credit = &Creditlinescxx . . $ Creditlines.;
345
346 while (!done) {
347 if (credit->typecxx . . $ creditline#type. != CLTYPE_ENDcxx . . $ `Descent3/credits.cpp:112:9`!)
348 count++;
349 credit = credit->nextcxx . . $ creditline#next.;
350 if (!credit || credit->typecxx . . $ creditline#type. == CLTYPE_ENDcxx . . $ `Descent3/credits.cpp:112:9`!)
351 done = 1;
352 }
353
354 int font_height = grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(BIG_BRIEFING_FONTcxx . . $ `Descent3/gamefont.h:112:9`!);
355 int total_pixel_height = font_height * count;
356
357 int cur_line = 0;
358 float total_pixel_count = 0;
359 float cur_pixel_count = 0;
360 float last_time = timer_GetTimecxx . . $ `ddio/ddio.h:236:9`!();
361
362 // Now show these guys
363 done = 0;
364 credit = &Creditlinescxx . . $ Creditlines.;
365 while (cur_line < count) {
366 StartFramecxx . . $ StartFrame(3285c9bef785d51c).(0, 0, Game_window_wcxx . . $ Game_window_w., Game_window_hcxx . . $ Game_window_h.);
367 rend_DrawChunkedBitmapcxx . . $ rend_DrawChunkedBitmap(529c7906ea1e7bf7).(&Credits_bmcxx . . $ Credits_bm., 0, 0, 255);
368 Credits_Rendercxx . . $ Credits_Render(7f50fdcbec098d61).(credit, cur_pixel_count);
369 EndFramecxx . . $ EndFrame(49f6e7a06ebc5aa8).();
370 rend_Flipcxx . . $ rend_Flip(49f6e7a06ebc5aa8).();
371
372 float frametime = timer_GetTimecxx . . $ `ddio/ddio.h:236:9`!() - last_time;
373 last_time = timer_GetTimecxx . . $ `ddio/ddio.h:236:9`!();
374
375 cur_pixel_count += frametime * CREDIT_PIXELS_PER_SECONDcxx . . $ `Descent3/credits.cpp:309:9`!;
376
377 while (cur_pixel_count >= font_height) {
378 credit = credit->nextcxx . . $ creditline#next.;
379 cur_line++;
380 if (credit == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! || credit->typecxx . . $ creditline#type. == CLTYPE_ENDcxx . . $ `Descent3/credits.cpp:112:9`!) {
381 cur_pixel_count = -1;
382 cur_line = count;
383 } else {
384 cur_pixel_count -= font_height;
385 }
386 }
387
388 // Player music for this frame
389 tMusicSeqInfocxx . . $ tMusicSeqInfo# music_info;
390 Sound_systemcxx . . $ Sound_system..BeginSoundFramecxx . . $ hlsSystem#BeginSoundFrame(b45ddcbc8423892c).(false);
391 music_info.frametimecxx . . $ tMusicSeqInfo#frametime. = frametime;
392 music_info.player_deadcxx . . $ tMusicSeqInfo#player_dead. = false;
393 music_info.started_levelcxx . . $ tMusicSeqInfo#started_level. = false;
394 D3MusicDoFramecxx . . $ D3MusicDoFrame(54ecf43cdccad508).(&music_info);
395 Sound_systemcxx . . $ Sound_system..EndSoundFramecxx . . $ hlsSystem#EndSoundFrame(49f6e7a06ebc5aa8).();
396
397 // Check for keys
398 Descentcxx . . $ Descent.->defercxx . . $ oeApplication#defer(db52760e79bf9054).();
399 if (Credits_IsKeyPressedcxx . . $ Credits_IsKeyPressed(c9857a73d68e59ba).()) {
400 cur_line = count;
401 }
402 }
403 }
404
405 // Free credit text memory
406 creditlinecxx . . $ creditline# *cur_credit = &Creditlinescxx . . $ Creditlines.;
407 while (cur_credit) {
408 if (cur_credit->textcxx . . $ creditline#text.)
409 mem_freecxx . . $ `mem/mem.h:80:9`!(cur_credit->text);
410
411 creditlinecxx . . $ creditline# *next_credit = cur_credit->nextcxx . . $ creditline#next.;
412
413 if (cur_credit != &Creditlinescxx . . $ Creditlines.) {
414 mem_freecxx . . $ `mem/mem.h:80:9`!(cur_credit);
415 }
416
417 cur_credit = next_credit;
418 }
419
420 // Free bitmaps
421 bm_DestroyChunkedBitmapcxx . . $ bm_DestroyChunkedBitmap(1635f60f4d3c1317).(&Credits_bmcxx . . $ Credits_bm.);
422
423 // end the music.
424 D3MusicStopcxx . . $ D3MusicStop(49f6e7a06ebc5aa8).();
425 ddio_KeyFlushcxx . . $ ddio_KeyFlush(49f6e7a06ebc5aa8).();
426 // ddio_MouseReset(); // -mouse shouldn't be reset. ui system gets hosed
427 // unfortunately under NT.
428 #endif
429 }
430
431 void Credits_Rendercxx . . $ Credits_Render(7f50fdcbec098d61).(creditlinecxx . . $ creditline# *header, float pixels_in) {
432 bool done = false;
433 creditlinecxx . . $ creditline# *credit = header;
434
435 grtext_Resetcxx . . $ grtext_Reset(49f6e7a06ebc5aa8).();
436 grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(BIG_BRIEFING_FONTcxx . . $ `Descent3/gamefont.h:112:9`!);
437 grtext_SetFontScalecxx . . $ grtext_SetFontScale(9364e6e7bff7660).(1.0);
438 int text_height = grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(BIG_BRIEFING_FONTcxx . . $ `Descent3/gamefont.h:112:9`!);
439
440 float pixels_this_frame = 0;
441 int cur_pixel = -pixels_in;
442 int cur_line = 0;
443 while ((pixels_this_frame < 480 + text_height) && !done) {
444 if (credit->typecxx . . $ creditline#type. == CLTYPE_BLANKcxx . . $ `Descent3/credits.cpp:113:9`!) {
445 credit = credit->nextcxx . . $ creditline#next.;
446 cur_line++;
447
448 pixels_this_frame += text_height;
449 cur_pixel += text_height;
450
451 if (credit == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
452 done = 1;
453 else if (credit->typecxx . . $ creditline#type. == CLTYPE_ENDcxx . . $ `Descent3/credits.cpp:112:9`!)
454 done = 1;
455
456 continue;
457 }
458 grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(credit->colorcxx . . $ creditline#color.);
459
460 // Figure out alpha
461 if (cur_pixel < 0) {
462 float norm = 1.0 - ((-cur_pixel) / (float)text_height);
463 grtext_SetAlphacxx . . $ grtext_SetAlpha(ac50b47256ae7414).(norm * 255);
464 } else if ((cur_pixel + text_height) > 480) {
465 float norm = 1.0 - (((cur_pixel + text_height) - 480) / (float)text_height);
466 grtext_SetAlphacxx . . $ grtext_SetAlpha(ac50b47256ae7414).(norm * 255);
467 } else
468 grtext_SetAlphacxx . . $ grtext_SetAlpha(ac50b47256ae7414).(255);
469
470 // Figure out text placement
471 int texty = cur_pixel;
472
473 grtext_CenteredPrintfcxx . . $ grtext_CenteredPrintf(9514e36549094170).(0, texty, "%s", credit->textcxx . . $ creditline#text.);
474
475 credit = credit->nextcxx . . $ creditline#next.;
476
477 if (credit == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
478 done = 1;
479 else if (credit->typecxx . . $ creditline#type. == CLTYPE_ENDcxx . . $ `Descent3/credits.cpp:112:9`!)
480 done = 1;
481
482 cur_line++;
483 pixels_this_frame += text_height;
484 cur_pixel += text_height;
485 }
486
487 grtext_Flushcxx . . $ grtext_Flush(49f6e7a06ebc5aa8).();
488 }