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

Function ui_DrawRect

ui/UIDraw.cpp:157–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void ui_DrawRect(ddgr_color color, int l, int t, int r, int b) {
158 if (color == TRANSPARENT_COLOR32)
159 return;
160
161 g3Point *pntlist[4], points[4];
162 int i;
163
164 // Set our four corners to cover the screen
165 points[0].p3_sx = l;
166 points[0].p3_sy = t;
167 points[1].p3_sx = r;
168 points[1].p3_sy = t;
169 points[2].p3_sx = r;
170 points[2].p3_sy = b;
171 points[3].p3_sx = l;
172 points[3].p3_sy = b;
173
174 for (i = 0; i < 4; i++) {
175 points[i].p3_z = 0;
176 points[i].p3_flags = PF_PROJECTED;
177 pntlist[i] = &points[i];
178 }
179
180 rend_SetZBufferState(0);
181 rend_SetTextureType(TT_FLAT);
182 rend_SetAlphaType(AT_CONSTANT);
183 rend_SetLighting(LS_NONE);
184 rend_SetFlatColor(color);
185 rend_SetAlphaValue(m_UIDrawAlpha);
186 rend_DrawPolygon2D(0, pntlist, 4);
187}
188
189// draws all textures derived from ui_bm_handle.
190void ui_DrawBitmap(UIBitmapItem *bi, int x, int y, uint8_t alpha) {

Callers 5

OnDrawMethod · 0.85
OnDrawMethod · 0.85
OnDrawMethod · 0.85
drawMethod · 0.85
OnDrawMethod · 0.85

Calls 7

rend_DrawPolygon2DFunction · 0.85
rend_SetZBufferStateFunction · 0.50
rend_SetTextureTypeFunction · 0.50
rend_SetAlphaTypeFunction · 0.50
rend_SetLightingFunction · 0.50
rend_SetFlatColorFunction · 0.50
rend_SetAlphaValueFunction · 0.50

Tested by

no test coverage detected