MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / PaintPLRSinglePlayerText

Function PaintPLRSinglePlayerText

Descent3/screens.cpp:565–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563char line_replace[MAX_PLR_LINES]; // The character we replaced with a NULL. Draw this bright
564
565void PaintPLRSinglePlayerText() {
566
567 const int TEXT_HEIGHT = 14;
568 const int LEFT_COL = 50;
569 const int RIGHT_COL = 450;
570 char hi[3] = "\0\0";
571
572#define PLR_TXT_HEADER TXT_PLRTITLE
573 int i;
574
575 // Put everything back where it was...
576 for (i = 0; i < MAX_PLR_LINES; i++) {
577 if (line_replace[i]) {
578 PLRText[i][line_progress[i]] = line_replace[i];
579 }
580 line_progress[i] = 0;
581 line_replace[i] = 0;
582 }
583
584 paint_progress = 25 * ((timer_GetTime() - paint_start) / PLR_PAINT_TIME);
585
586 bool all_done_painting = true;
587
588 for (i = 0; i < MAX_PLR_LINES; i++) {
589 int curpos = paint_progress + (-2 * i);
590 if (curpos < 0)
591 curpos = 0;
592 int tlen = strlen(PLRText[i]);
593 if (tlen > curpos) {
594 line_progress[i] = curpos;
595 line_replace[i] = PLRText[i][curpos];
596 PLRText[i][curpos] = '\0';
597 all_done_painting = false;
598 }
599 }
600
601 if (all_done_painting) {
602 if (paint_in_sound_handle != -1) {
603 mprintf(0, "Stopping paint in sound\n");
604 Sound_system.StopSoundImmediate(paint_in_sound_handle);
605 paint_in_sound_handle = -1;
606 }
607 }
608
609 grtext_SetAlpha(255);
610
611 grtext_SetFlags(GRTEXTFLAG_SHADOW);
612
613 grtext_SetColor(UICOL_TEXT_NORMAL);
614 grtext_SetFont(BIG_BRIEFING_FONT);
615 int centerx = (Max_window_w / 2) - (grtext_GetTextLineWidth(PLR_TXT_HEADER) / 2);
616 if (centerx < 0)
617 centerx = 0;
618 grtext_Printf(centerx, 30, PLR_TXT_HEADER);
619
620 grtext_SetColor(UICOL_WINDOW_TITLE);
621 centerx = (Max_window_w / 2) - (grtext_GetTextLineWidth(PLRLevel) / 2);
622 if (centerx < 0)

Callers 1

PLResultsFrameFunction · 0.85

Calls 8

grtext_SetAlphaFunction · 0.85
grtext_SetFlagsFunction · 0.85
grtext_SetColorFunction · 0.85
grtext_SetFontFunction · 0.85
grtext_GetTextLineWidthFunction · 0.85
grtext_PrintfFunction · 0.85
StopSoundImmediateMethod · 0.80
Play2dSoundMethod · 0.80

Tested by

no test coverage detected