MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / zUIFont_Render

Function zUIFont_Render

src/SB/Game/zUIFont.cpp:328–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326}
327
328void zUIFont_Render(xEnt* e)
329{
330 zUIFont* ent = (zUIFont*)e;
331
332 if (!xEntIsVisible(ent))
333 {
334 return;
335 }
336
337 iColor_tag var_104;
338 var_104.r = ent->fasset->color[0];
339 var_104.g = ent->fasset->color[1];
340 var_104.b = ent->fasset->color[2];
341 var_104.a = ent->fasset->color[3];
342
343 if (ent->uiFontFlags & 0x10)
344 {
345 if (ent->uiFontFlags & 0x80)
346 {
347 ent->uiFontFlags ^= 0x80;
348 }
349
350 if (ent->uiFontFlags & 0x20 && !(ent->uiFlags & 0x2))
351 {
352 ent->uiFontFlags |= 0x80;
353 var_104.a >>= 1;
354 }
355
356 if (ent->uiFontFlags & 0x40 && !(ent->uiFlags & 0x8))
357 {
358 ent->uiFontFlags |= 0x80;
359 var_104.a >>= 1;
360 }
361 }
362
363 if (!(ent->uiFlags & 0x4))
364 {
365 return;
366 }
367
368 zUIFontAsset& a = *ent->fasset;
369
370 if (!ent->text || ent->text[0] == '\0')
371 {
372 if (ent->uiFontFlags & 0x8)
373 {
374 iColor_tag c = xColorFromRGBA(a.bcolor[0], a.bcolor[1], a.bcolor[2], a.bcolor[3]);
375 basic_rect<F32> r = { NSCREENX(a.pos.x), NSCREENY(a.pos.y), NSCREENX(a.dim[0]),
376 NSCREENY(a.dim[1]) };
377
378 render_fill_rect(r, c);
379 }
380 }
381 else
382 {
383 xtextbox tb;
384
385 tb.font.id = a.fontID;

Callers 1

zUIRenderAllFunction · 0.70

Calls 8

xEntIsVisibleFunction · 0.85
xColorFromRGBAFunction · 0.85
NSCREENXFunction · 0.85
NSCREENYFunction · 0.85
render_fill_rectFunction · 0.50
set_textMethod · 0.45
yextentMethod · 0.45
renderMethod · 0.45

Tested by

no test coverage detected