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

Function xCutscene_Update

src/SB/Core/x/xCutscene.cpp:181–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181S32 xCutscene_Update(xCutscene* csn, F32 dt)
182{
183 if ((csn->SndStarted == FALSE) && (csn->SndNumChannel != 0))
184 {
185 if (csn->SndNumChannel == 1)
186 {
187 xSndSetPitch(csn->SndHandle[0], 0.0f);
188 }
189 else if (csn->SndNumChannel == 2)
190 {
191 xSndStartStereo(csn->SndHandle[0], csn->SndHandle[1], 0.0f);
192 }
193 csn->SndStarted = TRUE;
194 }
195
196 csn->Time = csn->PlaybackSpeed * dt + csn->Time;
197 csn->CamTime = xCutsceneConvertBreak(csn->Time, csn->BreakList, csn->Info->BreakCount, -1);
198
199 if (csn->Time > csn->Play->EndTime || csn->BadReadPause)
200 {
201 if (csn->PlayIndex == csn->Info->NumTime - 1)
202 {
203 csn->Time = csn->Play->EndTime;
204 return 0;
205 }
206
207 if (csn->BadReadPause && csn->Waiting == FALSE)
208 {
209 csn->BadReadPause = FALSE;
210 xCutscene_SetSpeed(csn, csn->BadReadSpeed);
211 }
212
213 if (csn->CamTime != csn->Time)
214 {
215 return 1;
216 }
217
218 if (csn->Waiting)
219 {
220 csn->Time = csn->Play->EndTime;
221 csn->CamTime =
222 xCutsceneConvertBreak(csn->Time, csn->BreakList, csn->Info->BreakCount, -1);
223
224 if (csn->BadReadPause == FALSE)
225 {
226 csn->BadReadSpeed = csn->PlaybackSpeed;
227 xCutscene_SetSpeed(csn, 0.0f);
228 csn->BadReadPause = TRUE;
229 }
230
231 return 1;
232 }
233
234 xCutsceneTime* oldChunk = csn->Play;
235 csn->Play = csn->Stream;
236 csn->Stream = oldChunk;
237 csn->PlayIndex = csn->PlayIndex + 1;
238

Callers 1

zCutsceneMgrUpdateFunction · 0.50

Calls 5

xSndSetPitchFunction · 0.85
xSndStartStereoFunction · 0.85
xCutsceneConvertBreakFunction · 0.85
xCutscene_SetSpeedFunction · 0.70
iCSFileAsyncReadFunction · 0.50

Tested by

no test coverage detected