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

Function RenderHUDFrame

Descent3/hud.cpp:1207–1262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1205// render internal gauges too.
1206
1207void RenderHUDFrame() {
1208 extern bool Guided_missile_smallview; // from smallviews.cpp
1209
1210 rend_SetOverlayType(OT_NONE);
1211
1212 // determine hud rendering properties.
1213 Hud_aspect_x = (float)Game_window_w / DEFAULT_HUD_WIDTH;
1214 Hud_aspect_y = (float)Game_window_h / DEFAULT_HUD_HEIGHT;
1215 Small_hud_flag = (((float)Game_window_w / (float)Max_window_w) <= 0.80f) ? true : false;
1216
1217 // render special missile hud if available
1218 if (Players[Player_num].guided_obj && !Guided_missile_smallview) {
1219 if (!Cinematic_inuse)
1220 RenderMissileReticle();
1221 } else if (Players[Player_num].flags & PLAYER_FLAGS_ZOOMED) {
1222 if (!Cinematic_inuse)
1223 RenderZoomReticle();
1224 } else if (!(Players[Player_num].flags & PLAYER_FLAGS_REARVIEW)) {
1225 switch (GetHUDMode()) {
1226 case HUD_FULLSCREEN:
1227 RenderHUDItems(Hud_stat_mask);
1228 RenderCockpit(); // needed to render animated deactivation sequence and should be dormant
1229 if (Game_toggles.show_reticle) {
1230 RenderReticle();
1231 }
1232 break;
1233
1234 case HUD_COCKPIT:
1235 RenderHUDItems(Hud_stat_mask);
1236 RenderCockpit(); // called when cockpit is activating and functioning.
1237 if (Game_toggles.show_reticle) {
1238 RenderReticle();
1239 }
1240 break;
1241
1242 case HUD_LETTERBOX:
1243 if (!Cinematic_inuse)
1244 RenderHUDItems(Hud_stat_mask);
1245 break;
1246
1247 case HUD_OBSERVER:
1248 if (!Cinematic_inuse)
1249 RenderHUDItems(Hud_stat_mask);
1250 break;
1251
1252 default:
1253 Int3();
1254 }
1255 }
1256
1257 // Do dll stuff
1258 CallGameDLL(EVT_CLIENT_HUD_INTERVAL, &DLLInfo);
1259
1260 rend_SetZBufferState(1);
1261 mprintf_at(2, 0, 0, "FPS: %f", GetFPS());
1262}
1263
1264// renders hud frame before any graphics are drawn

Callers 1

GameDrawHudFunction · 0.85

Calls 10

RenderMissileReticleFunction · 0.85
RenderZoomReticleFunction · 0.85
GetHUDModeFunction · 0.85
RenderHUDItemsFunction · 0.85
RenderCockpitFunction · 0.85
RenderReticleFunction · 0.85
CallGameDLLFunction · 0.85
GetFPSFunction · 0.85
rend_SetOverlayTypeFunction · 0.50
rend_SetZBufferStateFunction · 0.50

Tested by

no test coverage detected