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

Function RenderZoomReticle

Descent3/hud.cpp:2061–2084  ·  view source on GitHub ↗

renders missile reticle

Source from the content-addressed store, hash-verified

2059
2060// renders missile reticle
2061void RenderZoomReticle() {
2062 // Crosshair reticle
2063 int cx = Game_window_w / 2;
2064 int cy = Game_window_h / 2;
2065 int text_height = grfont_GetHeight(HUD_FONT);
2066 char str[255];
2067
2068 RenderHUDTextFlags(HUDTEXT_CENTERED, GR_RED, HUD_ALPHA, 0, 10, cy - 50, TXT_HUD_ZOOM);
2069
2070 snprintf(str, sizeof(str), TXT_HUD_ZOOM_UNITS, Players[Player_num].zoom_distance);
2071
2072 RenderHUDTextFlags(HUDTEXT_CENTERED, GR_RED, HUD_ALPHA, 0, 10, cy - 50 + text_height, str);
2073 grtext_Flush();
2074
2075 rend_SetZBufferState(0);
2076
2077 if (Players[Player_num].flags & PLAYER_FLAGS_BULLSEYE)
2078 rend_SetFlatColor(GR_RED);
2079 else
2080 rend_SetFlatColor(GR_GREEN);
2081
2082 rend_DrawLine(cx - 8, cy, cx + 8, cy);
2083 rend_DrawLine(cx, cy - 8, cx, cy + 8);
2084}
2085
2086/*
2087// HUD FILE FUNCTIONS

Callers 1

RenderHUDFrameFunction · 0.85

Calls 6

grfont_GetHeightFunction · 0.85
RenderHUDTextFlagsFunction · 0.85
grtext_FlushFunction · 0.85
rend_SetZBufferStateFunction · 0.50
rend_SetFlatColorFunction · 0.50
rend_DrawLineFunction · 0.50

Tested by

no test coverage detected