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

Function AddHUDMessage

Descent3/hudmessage.cpp:614–633  ·  view source on GitHub ↗

Adds a message to the HUD message list. If the list is already full, punt the top one and move the others up Returns true if message added, or false if message not (because the previous message was the same)

Source from the content-addressed store, hash-verified

612// top one and move the others up
613// Returns true if message added, or false if message not (because the previous message was the same)
614bool AddHUDMessage(const char *format, ...) {
615 std::va_list args;
616 char *message = NULL;
617 char *last_message = NULL;
618 char temp_message[HUD_MESSAGE_LENGTH * 2];
619
620 va_start(args, format);
621 std::vsnprintf(temp_message, HUD_MESSAGE_LENGTH * 2, format, args);
622 va_end(args);
623
624 if (Demo_flags == DF_RECORDING) {
625 DemoWriteHudMessage(0, false, temp_message);
626 }
627
628 if (Dedicated_server) {
629 return AddLineToHUDMessages(temp_message);
630 }
631
632 return AddMultipleLinesToHUDMessages(temp_message);
633}
634
635// Adds a blinking message to the HUD message list. If the list is already full, punt the
636// top one and move the others up

Callers 15

collide_weapon_and_wallFunction · 0.85
RunGameMenuFunction · 0.85
DoKeyboardMiscFunction · 0.85
DoControllerMiscFunction · 0.85
ProcessTestKeysFunction · 0.85
QuickSaveGameFunction · 0.85
SaveGameDialogFunction · 0.85
LoadCurrentSaveGameFunction · 0.85
MultiDoLeaveGameFunction · 0.85
MultiDoDisconnectFunction · 0.85

Calls 3

DemoWriteHudMessageFunction · 0.85
AddLineToHUDMessagesFunction · 0.85

Tested by

no test coverage detected