MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / hud_drawMessage

Function hud_drawMessage

TheForceEngine/TFE_DarkForces/hud.cpp:531–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529 }
530
531 void hud_drawMessage(u8* framebuffer)
532 {
533 if (s_missionMode == MISSION_MODE_MAIN && s_hudMessage[0])
534 {
535 displayHudMessage(s_hudFont, (DrawRect*)vfb_getScreenRect(VFB_RECT_UI), 4, 10, s_hudMessage, framebuffer);
536 if (s_curTick > s_hudMsgExpireTick)
537 {
538 s_hudMessage[0] = 0;
539 s_hudCurrentMsgId = 0;
540 s_hudMsgPriority = HUD_LOWEST_PRIORITY;
541 }
542 }
543
544 if (s_showData && s_playerEye)
545 {
546 fixed16_16 x, z;
547 getCameraXZ(&x, &z);
548
549 s32 xOffset = floor16(div16(intToFixed16(vfb_getWidescreenOffset()), vfb_getXScale()));
550
551 u8 dataStr[64];
552 sprintf((char*)dataStr, "X:%04d Y:%.1f Z:%04d H:%.1f S:%d%%", floor16(x), -fixed16ToFloat(s_playerEye->posWS.y), floor16(z), fixed16ToFloat(s_playerEye->worldHeight), s_secretsPercent);
553 displayHudMessage(s_hudFont, (DrawRect*)vfb_getScreenRect(VFB_RECT_UI), 164 + xOffset, 10, dataStr, framebuffer);
554 }
555 }
556
557 void hud_drawStringGpu(Font* font, fixed16_16 x0, fixed16_16 y0, fixed16_16 xScale, fixed16_16 yScale, const char* str)
558 {

Callers 2

mission_renderFunction · 0.85
mission_mainTaskFuncFunction · 0.85

Calls 9

displayHudMessageFunction · 0.85
vfb_getScreenRectFunction · 0.85
getCameraXZFunction · 0.85
floor16Function · 0.85
div16Function · 0.85
intToFixed16Function · 0.85
vfb_getWidescreenOffsetFunction · 0.85
vfb_getXScaleFunction · 0.85
fixed16ToFloatFunction · 0.85

Tested by

no test coverage detected