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

Function InitHUD

Descent3/hud.cpp:510–549  ·  view source on GitHub ↗

initializes hud.

Source from the content-addressed store, hash-verified

508
509// initializes hud.
510void InitHUD() {
511 int i;
512 extern bool HUD_disabled; // from gameloop.cpp
513
514 for (i = 0; i < MAX_HUD_ITEMS; i++) {
515 HUD_array[i].stat = 0;
516 HUD_array[i].flags = 0;
517 HUD_array[i].id = HUD_INVALID_ID;
518 }
519
520 // load static hud image resources to be used by HudDisplay.cpp
521 HUD_resources.arrow_bmp = -1;
522 HUD_resources.goal_bmp = -1;
523 HUD_resources.goal_complete_bmp = -1;
524 HUD_resources.lock_bmp[0] = -1;
525 HUD_resources.lock_bmp[1] = -1;
526 HUD_resources.wpn_bmp = -1;
527 HUD_resources.dot_bmp = -1;
528 HUD_resources.antigrav_bmp[0] = -1;
529 HUD_resources.antigrav_bmp[1] = -1;
530 strcpy(HUD_resources.hud_inf_name, "hud.inf");
531
532 strcpy(Reticle_prefix, "ret");
533 Ret_x_off = 0;
534 Ret_y_off = 0;
535
536 for (i = 0; i < NUM_SHIELD_GAUGE_FRAMES; i++)
537 HUD_resources.shield_bmp[i] = -1;
538 HUD_resources.energy_bmp = -1;
539 HUD_resources.afterburn_bmp = -1;
540 HUD_resources.invpulse_bmp = -1;
541
542 // this call may be unnecessary since it's called again in InitCockpit.
543 // InitReticle(-1,-1); // initialize reticle system
544
545 // scrollback windows
546 ResetGameMessages(); // resets game message rollback screen.
547 ResetHUDMessages();
548 HUD_disabled = 0;
549}
550
551// closes hud.
552void CloseHUD() {

Callers 1

InitGameFunction · 0.85

Calls 2

ResetGameMessagesFunction · 0.85
ResetHUDMessagesFunction · 0.85

Tested by

no test coverage detected