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

Function PKR_findNextLayerToLoad

src/SB/Core/x/xpkrsvc.cpp:520–570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520S32 PKR_findNextLayerToLoad(st_PACKER_READ_DATA** work_on_pkg, st_PACKER_LTOC_NODE** next_layer)
521{
522 st_PACKER_READ_DATA* tmppr;
523 st_PACKER_LTOC_NODE* tmplay;
524
525 *next_layer = NULL;
526 if (*work_on_pkg != NULL)
527 {
528 tmppr = *work_on_pkg;
529 for (S32 i = 0; i < tmppr->laytoc.cnt; i++)
530 {
531 tmplay = (st_PACKER_LTOC_NODE*)tmppr->laytoc.list[i];
532 if (!(tmplay->flg_ldstat & 0x2000000))
533 {
534 *next_layer = tmplay;
535 *work_on_pkg = tmppr;
536 break;
537 }
538 }
539 }
540
541 if (*next_layer == NULL)
542 {
543 tmppr = g_readdatainst;
544 for (S32 i = 0; i < 16; i++, tmppr++)
545 {
546 if ((g_loadlock & 1 << i) == 0 || tmppr == *work_on_pkg)
547 {
548 continue;
549 }
550
551 for (S32 j = 0; j < tmppr->laytoc.cnt; j++)
552 {
553 tmplay = (st_PACKER_LTOC_NODE*)tmppr->laytoc.list[j];
554 if (!(tmplay->flg_ldstat & 0x2000000))
555 {
556 *next_layer = tmplay;
557 *work_on_pkg = tmppr;
558 break;
559 }
560 }
561
562 if (*next_layer != NULL)
563 {
564 break;
565 }
566 }
567 }
568
569 return *next_layer != NULL;
570}
571
572void PKR_updateLayerAssets(st_PACKER_LTOC_NODE* laynode)
573{

Callers 1

PKR_LoadStep_AsyncFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected