| 551 | }; |
| 552 | |
| 553 | ContentLoadTask* BinaryAsset::createLoadingTask() |
| 554 | { |
| 555 | ContentLoadTask* loadTask = Asset::createLoadingTask(); |
| 556 | |
| 557 | // Check if asset need any just to be preloaded |
| 558 | auto chunksToPreload = getChunksToPreload(); |
| 559 | if (chunksToPreload != 0) |
| 560 | { |
| 561 | // Inject loading chunks task |
| 562 | auto preLoadChunksTask = New<LoadAssetDataTask>(this, chunksToPreload); |
| 563 | preLoadChunksTask->ContinueWith(loadTask); |
| 564 | loadTask = preLoadChunksTask; |
| 565 | } |
| 566 | |
| 567 | // Before asset loading we have to initialize storage |
| 568 | // TODO: maybe in build game we could do it in place? |
| 569 | // This step is only for opening asset files in background and upgrading them |
| 570 | // In build game we have only a few packages which are ready to use |
| 571 | auto initTask = New<InitAssetTask>(this); |
| 572 | initTask->ContinueWith(loadTask); |
| 573 | loadTask = initTask; |
| 574 | |
| 575 | return loadTask; |
| 576 | } |
| 577 | |
| 578 | Asset::LoadResult BinaryAsset::loadAsset() |
| 579 | { |
nothing calls this directly
no test coverage detected