MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / Render

Method Render

ogsr_engine/xrGame/UIStaticItem.cpp:47–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void CUIStaticItem::Render()
48{
49 VERIFY(g_bRendering);
50
51 UIRender->SetShader(*hShader);
52 if (alpha_ref != -1)
53 UIRender->SetAlphaRef(alpha_ref);
54
55 // convert&set pos
56 Fvector2 bp;
57 UI()->ClientToScreenScaled(bp, float(iPos.x), float(iPos.y));
58 //bp.x = (float)iFloor(bp.x);
59 //bp.y = (float)iFloor(bp.y);
60
61 // actual rendering
62 Fvector2 pos;
63 Fvector2 f_len;
64 UI()->ClientToScreenScaled(f_len, iVisRect.x2, iVisRect.y2);
65
66 int tile_x = fis_zero(iRemX) ? iTileX : iTileX + 1;
67 int tile_y = fis_zero(iRemY) ? iTileY : iTileY + 1;
68 if (!(tile_x && tile_y))
69 return;
70
71 // render
72 UIRender->StartPrimitive(8 * tile_x * tile_y, IUIRender::ptTriList, UI()->m_currentPointType);
73 for (int x = 0; x < tile_x; ++x)
74 {
75 for (int y = 0; y < tile_y; ++y)
76 {
77 pos.set(bp.x + f_len.x * x, bp.y + f_len.y * y);
78 inherited::Render(pos, dwColor);
79 }
80 }
81
82 // set scissor
83 Frect clip_rect = {iPos.x, iPos.y, iPos.x + iVisRect.x2 * iTileX + iRemX, iPos.y + iVisRect.y2 * iTileY + iRemY};
84 UI()->PushScissor(clip_rect);
85
86 UIRender->FlushPrimitive();
87
88 UI()->PopScissor();
89
90 if (alpha_ref != -1)
91 UIRender->SetAlphaRef(0);
92}
93
94void CUIStaticItem::Render(float angle)
95{

Callers

nothing calls this directly

Calls 11

UIFunction · 0.85
fis_zeroFunction · 0.85
RenderFunction · 0.85
ClientToScreenScaledMethod · 0.80
StartPrimitiveMethod · 0.80
PushScissorMethod · 0.80
FlushPrimitiveMethod · 0.80
PopScissorMethod · 0.80
SetShaderMethod · 0.45
SetAlphaRefMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected