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

Method OnDraw

ui/UIConsole.cpp:180–204  ·  view source on GitHub ↗

Inheritable operations

Source from the content-addressed store, hash-verified

178
179// Inheritable operations
180void UIConsoleGadget::OnDraw() {
181 int x, y, cy, index;
182 char *linebuf;
183
184 // draw frame
185 if (m_Flags & UIF_BORDER) {
186 ui_DrawBox(GR_GREEN, 1, 1, m_W - 1, m_H - 1);
187 ui_DrawBox(GR_RGB(64, 255, 64), 3, 3, m_W - 3, m_H - 3);
188 }
189
190 // draw text
191 ui_SetCharAlpha(255);
192 ui_DrawSetFont(m_ConsoleFont);
193
194 x = m_OffX;
195 y = m_OffY;
196
197 index = 0;
198
199 for (cy = m_VisRowStart; cy < (m_VisRowStart + m_VisRows); cy++) {
200 linebuf = m_ConsoleBuffer + (m_Rowsize * cy);
201 ui_DrawString(m_ColorRows[cy], x, y, linebuf);
202 y = y + ui_GetFontHeight() + 1;
203 }
204}
205
206// OnUserProcess
207// Takes care of scrolling of text and any keyboard input.

Callers

nothing calls this directly

Calls 6

ui_DrawBoxFunction · 0.85
ui_SetCharAlphaFunction · 0.85
ui_DrawSetFontFunction · 0.85
ui_DrawStringFunction · 0.85
ui_GetFontHeightFunction · 0.85
GR_RGBFunction · 0.50

Tested by

no test coverage detected