v1.1.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
Public Member Functions | List of all members
Sifteo::AssetGroup Struct Reference

A bundle of compressed tile data, for use by AssetImages. More...

#include <sifteo/asset/group.h>

Public Member Functions

uint16_t baseAddress (_SYSCubeID cube) const
 Return the base address of this asset group, as loaded onto the specified cube. More...
 
unsigned compressedSize () const
 Get the compressed size of this asset group, in bytes.
 
bool isInstalled (_SYSCubeIDVector vec)
 Is this AssetGroup installed on all cubes in the given vector? More...
 
bool isInstalled (_SYSCubeID cube)
 Is this AssetGroup installed on a particular cube? More...
 
unsigned numTiles () const
 Get the size of this asset group, in tiles.
 
 operator const _SYSAssetGroup & () const
 Implicit conversion to system object.
 
ALWAYS_INLINE const
_SYSAssetGroupHeader * 
sysHeader (bool requireConst=false) const
 Get a pointer to the read-only system data for this asset group. More...
 
unsigned tileAllocation () const
 How many tiles will this group use up in its AssetSlot? More...
 

Detailed Description

A bundle of compressed tile data, for use by AssetImages.

At build time, STIR creates a statically initialized instance of the AssetGroup class for every asset group in the game.

At runtime, AssetGroup objects track the load state of a particular group across all cubes. AssetGroups must be loaded at runtime using an AssetLoader object.

Member Function Documentation

uint16_t Sifteo::AssetGroup::baseAddress ( _SYSCubeID  cube) const
inline

Return the base address of this asset group, as loaded onto the specified cube.

The result is only valid if the asset group is already installed on that cube.

It is an error to rely on the value of baseAddress() before using either AssetSlot::bootstrap() or AssetLoader to load a group.

bool Sifteo::AssetGroup::isInstalled ( _SYSCubeIDVector  vec)
inline

Is this AssetGroup installed on all cubes in the given vector?

Cube vectors are sets of CubeID::bit() values bitwise-OR'ed together.

Assets can be installed either explicitly using an AssetLoader, or they may be already marked as installed on game entry due to asset bootstrapping, or due to a cached AssetSlot from a previous invocation of the game.

This function should be used only as a hint. Don't use it to make decisions about whether or not to include this group in an AssetConfiguration! If you will need to use a group, it belongs in the AssetConfiguration regardless of whether or not it's already loaded.

bool Sifteo::AssetGroup::isInstalled ( _SYSCubeID  cube)
inline

Is this AssetGroup installed on a particular cube?

This function should be used only as a hint. Don't use it to make decisions about whether or not to include this group in an AssetConfiguration! If you will need to use a group, it belongs in the AssetConfiguration regardless of whether or not it's already loaded.

ALWAYS_INLINE const _SYSAssetGroupHeader* Sifteo::AssetGroup::sysHeader ( bool  requireConst = false) const
inline

Get a pointer to the read-only system data for this asset group.

The resulting value is constant at compile-time, if possible. If the optional 'requireConst' argument is true, this will result in a link failure if the header cannot be determined to be constant at compile time.

unsigned Sifteo::AssetGroup::tileAllocation ( ) const
inline

How many tiles will this group use up in its AssetSlot?

This is numTiles(), rounded up to the nearest AssetSlot allocation unit.


The documentation for this struct was generated from the following file: