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

Method DrawTexture

ogsr_engine/xrGame/ui/UIStatic.cpp:176–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void CUIStatic::DrawTexture()
177{
178 if (m_bTextureEnable && GetShader() && GetShader()->inited())
179 {
180 Frect rect;
181 GetAbsoluteRect(rect);
182 m_UIStaticItem.SetPos(rect.left + m_TextureOffset.x, rect.top + m_TextureOffset.y);
183
184 if (m_bStretchTexture)
185 {
186 if (Heading())
187 {
188 if (m_UIStaticItem.GetFixedLTWhileHeading())
189 {
190 float t1, t2;
191 t1 = rect.width();
192 t2 = rect.height();
193 rect.y2 = rect.y1 + t1;
194 rect.x2 = rect.x1 + t2;
195 }
196 }
197 m_UIStaticItem.SetRect(0, 0, rect.width(), rect.height());
198 }
199 else
200 {
201 Frect r = {0.0f, 0.0f, m_UIStaticItem.GetOriginalRectScaled().width(), m_UIStaticItem.GetOriginalRectScaled().height()};
202 if (r.width() && r.height())
203 {
204 if (Heading())
205 {
206 float t1, t2;
207 t1 = rect.width();
208 t2 = rect.height();
209 rect.y2 = rect.y1 + t1;
210 rect.x2 = rect.x1 + t2;
211 }
212 m_UIStaticItem.SetRect(r);
213 }
214 }
215
216 if (Heading())
217 {
218 m_UIStaticItem.Render(GetHeading());
219 }
220 else
221 m_UIStaticItem.Render();
222 }
223}
224
225void CUIStatic::Update()
226{

Callers

nothing calls this directly

Calls 10

HeadingFunction · 0.85
GetHeadingFunction · 0.85
initedMethod · 0.80
SetRectMethod · 0.80
GetOriginalRectScaledMethod · 0.80
SetPosMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45
RenderMethod · 0.45

Tested by

no test coverage detected