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

Method Update

ogsr_engine/xrGame/ui/UIStatic.cpp:225–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225void CUIStatic::Update()
226{
227 inherited::Update();
228 // update light animation if defined
229 if (m_lanim_clr.m_lanim)
230 {
231 if (m_lanim_clr.m_lanim_start_time < 0.0f)
232 {
233 ResetClrAnimation();
234 }
235
236 float t = Device.dwTimeContinual / 1000.0f;
237
238 if (t < m_lanim_clr.m_lanim_start_time) // consider animation delay
239 return;
240
241 u32 clr = 0;
242 bool apply = false;
243
244 if (m_lanim_clr.m_lanimFlags.test(LA_CYCLIC) || t - m_lanim_clr.m_lanim_start_time < m_lanim_clr.m_lanim->Length_sec())
245 {
246 int frame;
247 clr = m_lanim_clr.m_lanim->CalculateRGB(t - m_lanim_clr.m_lanim_start_time, frame);
248 apply = true;
249 }
250 else if (!m_lanim_clr_completed)
251 {
252 int frame = m_lanim_clr.m_lanim->LastKeyFrame();
253 clr = m_lanim_clr.m_lanim->InterpolateRGB(frame);
254 apply = true;
255
256 m_lanim_clr_completed = true;
257 }
258
259 if (apply)
260 {
261 if (m_lanim_clr.m_lanimFlags.test(LA_TEXTURECOLOR))
262 if (m_lanim_clr.m_lanimFlags.test(LA_ONLYALPHA))
263 SetColor(subst_alpha(GetColor(), color_get_A(clr)));
264 else
265 SetColor(clr);
266
267 if (m_lanim_clr.m_lanimFlags.test(LA_TEXTCOLOR))
268 if (m_lanim_clr.m_lanimFlags.test(LA_ONLYALPHA))
269 SetTextColor(subst_alpha(GetTextColor(), color_get_A(clr)));
270 else
271 SetTextColor(clr);
272 }
273 }
274
275 if (m_lanim_xform.m_lanim)
276 {
277 if (m_lanim_xform.m_lanim_start_time < 0.0f)
278 {
279 ResetXformAnimation();
280 }
281
282 float t = Device.dwTimeContinual / 1000.0f;

Callers

nothing calls this directly

Calls 15

UpdateFunction · 0.85
subst_alphaFunction · 0.85
GetColorFunction · 0.85
color_get_AFunction · 0.85
GetTextColorFunction · 0.85
EnableHeading_intFunction · 0.85
SetHeadingFunction · 0.85
color_get_RFunction · 0.85
UIFunction · 0.85
CalculateRGBMethod · 0.80
InterpolateRGBMethod · 0.80
get_current_kxMethod · 0.80

Tested by

no test coverage detected