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

Function iCSLoadStep

src/SB/Core/gc/iCutscene.cpp:210–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210S32 iCSLoadStep(xCutscene* csn)
211{
212 S32 bytes;
213 XFILE_READSECTOR_STATUS cdstat;
214 U32 skipAccum;
215 U32 tmpSize;
216 void* foundModel;
217 U32 i;
218
219 if (csn->Waiting)
220 {
221 cdstat = xFileReadAsyncStatus(csn->File.ps.asynckey, &bytes);
222
223 if (cdstat == XFILE_RDSTAT_INPROG || cdstat == XFILE_RDSTAT_QUEUED)
224 {
225 return 0;
226 }
227 }
228
229 if (csn->DataLoading >= 0)
230 {
231 skipAccum = 0;
232
233 while (csn->DataLoading < (S32)csn->Info->NumData)
234 {
235 if (csn->Data[csn->DataLoading].DataType == XCUTSCENEDATA_TYPE_JDELTAMODEL)
236 {
237 foundModel = NULL;
238 }
239 else
240 {
241 foundModel = xSTFindAsset(csn->Data[csn->DataLoading].AssetID, &tmpSize);
242 }
243
244 if (foundModel || csn->Data[csn->DataLoading].ChunkSize == 0)
245 {
246 csn->Data[csn->DataLoading].DataPtr = foundModel;
247
248 skipAccum += ALIGN(csn->Data[csn->DataLoading].ChunkSize, 2048);
249
250 csn->DataLoading++;
251 }
252 else
253 {
254 if (skipAccum)
255 {
256 iCSFileAsyncSkip(csn, skipAccum);
257
258 skipAccum = 0;
259 }
260
261 if (csn->GotData)
262 {
263 if (csn->Data[csn->DataLoading].DataType == XCUTSCENEDATA_TYPE_JDELTAMODEL)
264 {
265 csn->Data[csn->DataLoading].DataPtr =
266 RwMalloc(csn->Data[csn->DataLoading].ChunkSize);
267

Callers 2

zCutsceneMgrFinishLoadFunction · 0.50
zCutsceneMgrUpdateFunction · 0.50

Calls 10

xFileReadAsyncStatusFunction · 0.85
iCSFileAsyncSkipFunction · 0.85
memcpyFunction · 0.85
iCSSoundSetupFunction · 0.85
xSndUpdateFunction · 0.85
iModelFileNewFunction · 0.70
iCSFileAsyncReadFunction · 0.70
xSTFindAssetFunction · 0.50
xSndPauseAllFunction · 0.50
xSndPlayFunction · 0.50

Tested by

no test coverage detected