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

Function InitMessage

Descent3/init.cpp:1675–1750  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1673}
1674
1675void InitMessage(const char *c, float progress) {
1676 int x = Game_window_w / 2 - Title_bitmap.pw / 2;
1677 int y = Game_window_h / 2 - Title_bitmap.ph / 2;
1678 int i, rx, ry, rw, rh;
1679
1680 if (Dedicated_server) {
1681 PrintDedicatedMessage("%s\n", c);
1682 return;
1683 }
1684
1685 if (!Graphics_init)
1686 return;
1687
1688 StartFrame();
1689
1690 if (Title_bitmap_init) {
1691 rend_ClearScreen(GR_BLACK);
1692 rend_DrawChunkedBitmap(&Title_bitmap, x, y, 255);
1693 }
1694
1695 if (c) {
1696 g3Point *pntlist[4], points[4];
1697 // Set our four corners to cover the screen
1698 grtext_SetFont(MONITOR9_NEWUI_FONT);
1699 rw = Game_window_w;
1700 rh = grfont_GetHeight(MONITOR9_NEWUI_FONT) + 8;
1701 rx = 0;
1702 ry = Game_window_h - rh;
1703 points[0].p3_sx = rx;
1704 points[0].p3_sy = ry;
1705 points[1].p3_sx = rx + rw;
1706 points[1].p3_sy = ry;
1707 points[2].p3_sx = rx + rw;
1708 points[2].p3_sy = ry + rh;
1709 points[3].p3_sx = rx;
1710 points[3].p3_sy = ry + rh;
1711
1712 for (i = 0; i < 4; i++) {
1713 points[i].p3_z = 0;
1714 points[i].p3_flags = PF_PROJECTED;
1715 pntlist[i] = &points[i];
1716 }
1717
1718 rend_SetZBufferState(0);
1719 rend_SetTextureType(TT_FLAT);
1720 rend_SetAlphaType(AT_CONSTANT);
1721 rend_SetLighting(LS_NONE);
1722 rend_SetFlatColor(GR_BLACK);
1723 rend_SetAlphaValue(230);
1724 rend_DrawPolygon2D(0, pntlist, 4);
1725
1726 if (progress >= 0) {
1727 points[0].p3_sx = rx;
1728 points[0].p3_sy = ry + rh - (rh / 2) + 2;
1729 points[1].p3_sx = rx + ((float)rw * progress);
1730 points[1].p3_sy = ry + rh - (rh / 2) + 2;
1731 points[2].p3_sx = rx + ((float)rw * progress);
1732 points[2].p3_sy = ry + rh;

Callers 3

mng_LoadNetPagesFunction · 0.85
UpdateInitMessageFunction · 0.85
IntroScreenFunction · 0.85

Calls 15

PrintDedicatedMessageFunction · 0.85
StartFrameFunction · 0.85
grtext_SetFontFunction · 0.85
grfont_GetHeightFunction · 0.85
rend_DrawPolygon2DFunction · 0.85
grtext_SetAlphaFunction · 0.85
grtext_SetColorFunction · 0.85
grtext_PutsFunction · 0.85
grtext_FlushFunction · 0.85
EndFrameFunction · 0.85
rend_ClearScreenFunction · 0.50
rend_DrawChunkedBitmapFunction · 0.50

Tested by

no test coverage detected