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

An AssetImage in which all tiles are stored sequentially in memory. More...

#include <sifteo/asset/image.h>

Public Member Functions

AssetGroupassetGroup () const
 Access the AssetGroup instance associated with this AssetImage.
 
int numFrames () const
 Access the number of 'frames' in this image.
 
int numTiles () const
 Compute the total number of tiles in the image.
 
int numTilesPerFrame () const
 Compute the total number of tiles per frame (tileWidth * tileHeight)
 
 operator const _SYSAssetImage & () const
 Implicit conversion to system object.
 
 operator const AssetImage & () const
 Implicit conversion to AssetImage base class.
 
Int2 pixelExtent () const
 Half the size of this image, in pixels.
 
int pixelHeight () const
 The height of this image, in pixels.
 
Int2 pixelSize () const
 The (width, height) vector of this image, in pixels.
 
int pixelWidth () const
 The width of this image, in pixels.
 
uint16_t tile (unsigned i) const
 Returns the index of the tile at linear position 'i' in the image. More...
 
uint16_t tile (Int2 pos, unsigned frame=0) const
 Return the index of the tile at the specified (x, y) tile coordinates. More...
 
uint16_t tile (_SYSCubeID cube, unsigned i) const
 Returns the index of the tile at linear position 'i' in the image. More...
 
uint16_t tile (_SYSCubeID cube, Int2 pos, unsigned frame=0) const
 Return the index of the tile at the specified (x, y) tile coordinates. More...
 
Int2 tileExtent () const
 Half the size of this image, in tiles.
 
int tileHeight () const
 The height of this image, in tiles.
 
Int2 tileSize () const
 The (width, height) vector of this image, in tiles.
 
int tileWidth () const
 The width of this image, in tiles.
 

Detailed Description

An AssetImage in which all tiles are stored sequentially in memory.

This doesn't store any separate tilemap information, just the index for the first tile in the sequence.

Generate a PinnedAssetImage by passing the pinned=1 option to image{} in your STIR script.

Pinned assets are required for sprites, since the hardware requires all tiles in a sprite to be sequential.

Pinned assets may also be efficient to use in other cases when there's very little potential for tile deduplication.

Member Function Documentation

uint16_t Sifteo::PinnedAssetImage::tile ( unsigned  i) const
inline

Returns the index of the tile at linear position 'i' in the image.

The returned index is unrelocated; it is relative to the base address of the image's AssetGroup.

uint16_t Sifteo::PinnedAssetImage::tile ( Int2  pos,
unsigned  frame = 0 
) const
inline

Return the index of the tile at the specified (x, y) tile coordinates.

The returned index is unrelocated; it is relative to the base address of the image's AssetGroup.

uint16_t Sifteo::PinnedAssetImage::tile ( _SYSCubeID  cube,
unsigned  i 
) const
inline

Returns the index of the tile at linear position 'i' in the image.

The returned index is relocated to an absolute address for the specified cube. This image's assets must be installed on that cube.

uint16_t Sifteo::PinnedAssetImage::tile ( _SYSCubeID  cube,
Int2  pos,
unsigned  frame = 0 
) const
inline

Return the index of the tile at the specified (x, y) tile coordinates.

The returned index is relocated to an absolute address for the specified cube. This image's assets must be installed on that cube.


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