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

Function RenderSecondaryMonitor

Descent3/gauges.cpp:569–617  ·  view source on GitHub ↗

renders the secondary monitor gauge

Source from the content-addressed store, hash-verified

567
568// renders the secondary monitor gauge
569void RenderSecondaryMonitor(tGauge *gauge, bool modified) {
570 if (Disable_secondary_monitor)
571 return;
572
573 if (gauge->functional) {
574 float alphas[4];
575
576 alphas[0] = 1.0f;
577 alphas[1] = 1.0f;
578 alphas[2] = 1.0f;
579 alphas[3] = 1.0f;
580
581 int hud_image = get_weapon_hud_image(Player_num, PW_SECONDARY);
582
583 DrawGaugeMonitor(gauge->pts, hud_image, 0.5f, alphas);
584
585 if (!Render_gauge_moving) {
586 int x1, y;
587
588 gauge->pts[0].p3_flags &= (~PF_PROJECTED);
589 g3_ProjectPoint(&gauge->pts[0]);
590 x1 = gauge->pts[0].p3_sx;
591 y = gauge->pts[0].p3_sy;
592
593 grtext_SetFancyColor(GR_RGB(0, 180, 0), GR_RGB(0, 180, 0), GR_RGB(0, 180, 0), GR_RGB(0, 180, 0));
594 grtext_SetFlags(0);
595 grtext_Printf(x1 + HUD_X(5), y + HUD_Y(10), "%s",
596 TXT(Static_weapon_ckpt_names[Players[Player_num].weapon[PW_SECONDARY].index][0]));
597 grtext_SetFlags(GRTEXTFLAG_SATURATE);
598 grtext_Printf(x1 + HUD_X(5), y + HUD_Y(10), "%s",
599 TXT(Static_weapon_ckpt_names[Players[Player_num].weapon[PW_SECONDARY].index][0]));
600 if (strlen(TXT(Static_weapon_ckpt_names[Players[Player_num].weapon[PW_SECONDARY].index][1]))) {
601 grtext_SetFlags(0);
602 grtext_Printf(x1 + HUD_X(5), y + HUD_Y(20), "%s",
603 TXT(Static_weapon_ckpt_names[Players[Player_num].weapon[PW_SECONDARY].index][1]));
604 grtext_SetFlags(GRTEXTFLAG_SATURATE);
605 grtext_Printf(x1 + HUD_X(5), y + HUD_Y(20), "%s",
606 TXT(Static_weapon_ckpt_names[Players[Player_num].weapon[PW_SECONDARY].index][1]));
607 y = y + HUD_Y(10);
608 }
609 grtext_SetFlags(0);
610 grtext_Printf(x1 + HUD_X(15), y + HUD_Y(20), "%d",
611 Players[Player_num].weapon_ammo[Players[Player_num].weapon[PW_SECONDARY].index]);
612 grtext_SetFlags(GRTEXTFLAG_SATURATE);
613 grtext_Printf(x1 + HUD_X(15), y + HUD_Y(20), "%d",
614 Players[Player_num].weapon_ammo[Players[Player_num].weapon[PW_SECONDARY].index]);
615 }
616 }
617}
618
619// renders the shield gauge monitor
620void RenderShieldMonitor(tGauge *gauge, bool modified) {

Callers 1

RenderGaugesFunction · 0.85

Calls 7

get_weapon_hud_imageFunction · 0.85
DrawGaugeMonitorFunction · 0.85
g3_ProjectPointFunction · 0.85
grtext_SetFancyColorFunction · 0.85
grtext_SetFlagsFunction · 0.85
grtext_PrintfFunction · 0.85
GR_RGBFunction · 0.50

Tested by

no test coverage detected