9 # error This is a userspace-only header, not allowed by the current build.
12 #include <sifteo/asset/group.h>
13 #include <sifteo/math.h>
14 #include <sifteo/array.h>
15 #include <sifteo/abi.h>
34 _SYSAssetConfiguration sys;
50 sys.pGroup =
reinterpret_cast<uintptr_t
>(&
group);
69 return reinterpret_cast<AssetGroup*
>(sys.pGroup);
92 return roundup<unsigned>(
numTiles(), _SYS_ASSET_GROUP_SIZE_UNIT);
118 template <
unsigned tCapacity>
214 operator const _SYSAssetLoader& ()
const {
return sys; }
215 operator _SYSAssetLoader& () {
return sys; }
216 operator const _SYSAssetLoader* ()
const {
return &sys; }
217 operator _SYSAssetLoader* () {
return &sys; }
241 _SYS_asset_loadFinish(*
this);
261 void cancel(_SYSCubeIDVector cubes = -1) {
262 _SYS_asset_loadCancel(*
this, cubes);
297 template <
typename T >
298 void start(T& configuration, _SYSCubeIDVector cubes = -1)
303 _SYS_asset_loadStart(*
this, &configuration.begin()->sys, configuration.count(), cubes);
322 return cubes[cubeID].progress * max / cubes[cubeID].total;
336 unsigned progress = cubes[cubeID].progress;
337 unsigned total = cubes[cubeID].total;
338 return total ? (progress / float(total)) : 0.0f;
355 unsigned progress = 0, total = 0;
357 progress += cubes[i].progress;
358 total += cubes[i].total;
360 return progress * max / total;
373 unsigned progress = 0, total = 0;
375 progress += cubes[i].progress;
376 total += cubes[i].total;
378 return total ? (progress / float(total)) : 0.0f;
385 return sys.busyCubes;
400 return (sys.busyCubes & vec) == 0;
409 return isComplete(_SYSCubeIDVector(0x80000000 >> cubeID));
416 return sys.busyCubes == 0;