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

Method Update

ogsr_engine/xrGame/ui/UIGameTutorialVideoItem.cpp:110–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110void CUISequenceVideoItem::Update()
111{
112 // deferred start
113 if (Device.dwTimeContinual >= m_time_start)
114 {
115 if (m_flags.test(etiDelayed))
116 {
117 m_owner->MainWnd()->AttachChild(m_wnd);
118 m_wnd->Show(true);
119 m_flags.set(etiDelayed, FALSE);
120 }
121 }
122 else
123 return;
124
125 u32 sync_tm = (0 == m_sounds[0]._handle()) ? Device.dwTimeContinual : (m_sounds[0]._feedback() ? m_sounds[0]._feedback()->play_time() : m_sync_time);
126 m_sync_time = sync_tm;
127 // processing A&V
128 if (m_texture->HasTexture())
129 {
130 const BOOL is_playing = m_sounds[0]._handle() ? !!m_sounds[0]._feedback() : m_texture->video_IsPlaying();
131 if (is_playing)
132 {
133 m_texture->video_Sync(m_sync_time);
134 }
135 else
136 {
137 // sync start
138 if (m_flags.test(etiNeedStart))
139 {
140 if (!stereo)
141 {
142 m_sounds[0].play_at_pos(NULL, Fvector().set(-0.5f, 0.f, 0.3f), sm_2D);
143 m_sounds[1].play_at_pos(NULL, Fvector().set(+0.5f, 0.f, 0.3f), sm_2D);
144 }
145 else
146 m_sounds[0].play_at_pos(NULL, Fvector().set(0.f, 0.f, 0.3f), sm_2D);
147 m_texture->video_Play(FALSE, m_sync_time);
148 m_flags.set(etiNeedStart, FALSE);
149 CUIWindow* w = m_owner->MainWnd()->FindChild("back");
150 if (w)
151 w->Show(!!m_flags.test(etiBackVisible));
152 }
153 else
154 {
155 m_flags.set(etiPlaying, FALSE);
156 }
157 }
158 }
159}
160
161void CUISequenceVideoItem::OnRender()
162{

Callers

nothing calls this directly

Calls 14

AttachChildMethod · 0.80
MainWndMethod · 0.80
_handleMethod · 0.80
_feedbackMethod · 0.80
play_timeMethod · 0.80
HasTextureMethod · 0.80
video_SyncMethod · 0.80
FindChildMethod · 0.80
testMethod · 0.45
ShowMethod · 0.45
setMethod · 0.45
video_IsPlayingMethod · 0.45

Tested by

no test coverage detected