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

Function TCAMDrawMenu

Descent3/TelComAutoMap.cpp:727–784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

725#include "hud.h"
726
727void TCAMDrawMenu() {
728 char str[255];
729 g3Point *pntlist[4], points[4];
730 grtext_SetFont(BRIEFING_FONT);
731 int fontheight = grfont_GetHeight(BRIEFING_FONT);
732
733 points[0].p3_sx = AM_tcs->Monitor_coords[MONITOR_MAIN].left;
734 points[0].p3_sy = AM_tcs->Monitor_coords[MONITOR_MAIN].bottom - (fontheight * 3);
735
736 points[1].p3_sx = AM_tcs->Monitor_coords[MONITOR_MAIN].right;
737 points[1].p3_sy = AM_tcs->Monitor_coords[MONITOR_MAIN].bottom - (fontheight * 3);
738
739 points[2].p3_sx = AM_tcs->Monitor_coords[MONITOR_MAIN].right;
740 points[2].p3_sy = AM_tcs->Monitor_coords[MONITOR_MAIN].bottom;
741
742 points[3].p3_sx = AM_tcs->Monitor_coords[MONITOR_MAIN].left;
743 points[3].p3_sy = AM_tcs->Monitor_coords[MONITOR_MAIN].bottom;
744
745 for (int i = 0; i < 4; i++) {
746 points[i].p3_z = 0;
747 points[i].p3_flags = PF_PROJECTED;
748 pntlist[i] = &points[i];
749 }
750
751 rend_SetZBufferState(0);
752 rend_SetTextureType(TT_FLAT);
753 rend_SetAlphaType(AT_CONSTANT);
754 rend_SetLighting(LS_NONE);
755 rend_SetFlatColor(GR_BLACK);
756 rend_SetAlphaValue(192);
757 rend_DrawPolygon2D(0, pntlist, 4);
758
759 grtext_SetAlpha(250);
760 grtext_SetColor(GR_RGB(255, 255, 255));
761
762 snprintf(str, sizeof(str), TXT_TCAM_TERRAIN, AM_terrain ? TXT_STRING_OFF : TXT_STRING_ON);
763 grtext_CenteredPrintf(0, AM_tcs->Monitor_coords[MONITOR_MAIN].bottom - (fontheight * 3) + (fontheight / 2), str);
764 snprintf(str, sizeof(str), "%s", TXT_TCAM_INSTRUCTIONS);
765 grtext_CenteredPrintf(0, AM_tcs->Monitor_coords[MONITOR_MAIN].bottom - (fontheight * 2) + (fontheight / 2), str);
766
767 // Use HUD font for part that overlays the 3D
768 fontheight = grfont_GetHeight(HUD_FONT);
769 grtext_SetFont(HUD_FONT);
770 grtext_SetColor(HUD_COLOR);
771
772 snprintf(str, sizeof(str), "%s", Level_info.name);
773 grtext_CenteredPrintf(0, AM_tcs->Monitor_coords[MONITOR_MAIN].top + (fontheight / 2), str);
774
775 if (AM_current_marker != -1) {
776 int markernum = (Game_mode & GM_MULTI) ? (Player_num * 2 + AM_current_marker) : AM_current_marker;
777 snprintf(str, sizeof(str), TXT_VIEW_MARKER, AM_current_marker + 1);
778 strncat(str, ": ", sizeof(str) - strlen(str) - 1);
779 strncat(str, MarkerMessages[markernum], sizeof(str) - strlen(str) - 1);
780 grtext_CenteredPrintf(0, AM_tcs->Monitor_coords[MONITOR_MAIN].top + (fontheight / 2) + fontheight, str);
781 }
782
783 grtext_Flush();
784}

Callers 1

TCAMCallbackFunction · 0.85

Calls 14

grtext_SetFontFunction · 0.85
grfont_GetHeightFunction · 0.85
rend_DrawPolygon2DFunction · 0.85
grtext_SetAlphaFunction · 0.85
grtext_SetColorFunction · 0.85
grtext_CenteredPrintfFunction · 0.85
grtext_FlushFunction · 0.85
rend_SetZBufferStateFunction · 0.50
rend_SetTextureTypeFunction · 0.50
rend_SetAlphaTypeFunction · 0.50
rend_SetLightingFunction · 0.50
rend_SetFlatColorFunction · 0.50

Tested by

no test coverage detected