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

Method Draw

Descent3/hudmessage.cpp:1721–1793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1719}
1720
1721void MsgListConsole::Draw() {
1722 g3Point *pntlist[4], points[4];
1723 int y, i;
1724
1725 if (!m_opened || !m_list)
1726 return;
1727
1728 // change in buffer, do 'slow' update
1729 if (m_curmsgs != m_list->m_nmsg) {
1730 char buf[32];
1731 strcpy(buf, m_title);
1732 this->Close();
1733 this->Open(buf, m_x, m_y, m_w, m_h);
1734 }
1735
1736 // draw background window.
1737 points[0].p3_sx = m_x;
1738 points[0].p3_sy = m_y;
1739 points[1].p3_sx = m_x + m_w;
1740 points[1].p3_sy = m_y;
1741 points[2].p3_sx = m_x + m_w;
1742 points[2].p3_sy = m_y + m_h;
1743 points[3].p3_sx = m_x;
1744 points[3].p3_sy = m_y + m_h;
1745
1746 for (i = 0; i < 4; i++) {
1747 points[i].p3_z = 0;
1748 points[i].p3_flags = PF_PROJECTED;
1749 pntlist[i] = &points[i];
1750 }
1751
1752 rend_SetZBufferState(0);
1753 rend_SetTextureType(TT_FLAT);
1754 rend_SetAlphaType(AT_CONSTANT);
1755 rend_SetLighting(LS_NONE);
1756 rend_SetFlatColor(GR_BLACK);
1757 rend_SetAlphaValue(192);
1758 rend_DrawPolygon2D(0, pntlist, 4);
1759
1760 // set up text rendering.
1761 grtext_Reset();
1762 grtext_SetParameters(m_x + MSGL_BORDER_THICKNESS, m_y + MSGL_BORDER_THICKNESS - 1, m_x + m_w - MSGL_BORDER_THICKNESS,
1763 m_y + m_h - MSGL_BORDER_THICKNESS);
1764 grtext_SetFont(HUD_FONT);
1765 grtext_SetColor(GR_RGB(0, 255, 0));
1766 grtext_Puts(m_x + MSGL_BORDER_THICKNESS + 4, m_y + MSGL_BORDER_THICKNESS - 1, m_title);
1767
1768 y = m_y + grfont_GetHeight(HUD_FONT) + MSGL_BORDER_THICKNESS + 1;
1769 rend_SetFlatColor(GR_RGB(0, 255, 0));
1770 rend_DrawLine(m_x + MSGL_BORDER_THICKNESS, y, m_x + m_w - MSGL_BORDER_THICKNESS, y);
1771
1772 // draw all lines until bottom
1773 y += 2;
1774 for (i = 0; i < n_conlines; i++) {
1775 char *sptr = NULL;
1776 if (i < (n_conlines - 1)) {
1777 sptr = m_conlines[i + 1];
1778 }

Callers 3

DrawItemMethod · 0.45
DrawItemMethod · 0.45
RenderAuxHUDFrameFunction · 0.45

Calls 15

CloseMethod · 0.95
OpenMethod · 0.95
rend_DrawPolygon2DFunction · 0.85
grtext_ResetFunction · 0.85
grtext_SetParametersFunction · 0.85
grtext_SetFontFunction · 0.85
grtext_SetColorFunction · 0.85
grtext_PutsFunction · 0.85
grfont_GetHeightFunction · 0.85
grtext_FlushFunction · 0.85
rend_SetZBufferStateFunction · 0.50
rend_SetTextureTypeFunction · 0.50

Tested by

no test coverage detected