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

Function rend_DrawFontCharacter

renderer/HardwareBaseGPU.cpp:153–178  ·  view source on GitHub ↗

Sets up a font character to draw. We draw our fonts as pieces of textures

Source from the content-addressed store, hash-verified

151
152// Sets up a font character to draw. We draw our fonts as pieces of textures
153void rend_DrawFontCharacter(int bm_handle, int x1, int y1, int x2, int y2, float u, float v, float w, float h) {
154 g3Point *ptr_pnts[4];
155 g3Point pnts[4];
156 for (int i = 0; i < 4; i++) {
157 pnts[i].p3_z = 1; // Make REALLY close!
158 pnts[i].p3_flags = PF_PROJECTED;
159 ptr_pnts[i] = &pnts[i];
160 }
161 pnts[0].p3_sx = x1;
162 pnts[0].p3_sy = y1;
163 pnts[0].p3_u = u;
164 pnts[0].p3_v = v;
165 pnts[1].p3_sx = x2;
166 pnts[1].p3_sy = y1;
167 pnts[1].p3_u = u + w;
168 pnts[1].p3_v = v;
169 pnts[2].p3_sx = x2;
170 pnts[2].p3_sy = y2;
171 pnts[2].p3_u = u + w;
172 pnts[2].p3_v = v + h;
173 pnts[3].p3_sx = x1;
174 pnts[3].p3_sy = y2;
175 pnts[3].p3_u = u;
176 pnts[3].p3_v = v + h;
177 rend_DrawPolygon2D(bm_handle, ptr_pnts, 4);
178}
179
180// Sets the alpha value for constant alpha
181void rend_SetAlphaValue(uint8_t val) {

Callers 2

draw_charMethod · 0.50
grfont_BltCharFunction · 0.50

Calls 1

rend_DrawPolygon2DFunction · 0.85

Tested by

no test coverage detected