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

A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector. More...

#include <sifteo/video/bg1.h>

Public Member Functions

void clear ()
 Erase a TileMask, setting all bits to zero.
 
void fill (UInt2 topLeft, UInt2 size)
 Mark a rectangular region of the bitmap. More...
 
BG1Mask operator& (BG1Mask other) const
 Bitwise AND with another mask.
 
BG1Maskoperator&= (BG1Mask other)
 Bitwise AND with another mask.
 
BG1Mask operator^ (BG1Mask other) const
 Bitwise XOR with another mask.
 
BG1Maskoperator^= (BG1Mask other)
 Bitwise XOR with another mask.
 
BG1Mask operator| (BG1Mask other) const
 Bitwise OR with another mask.
 
BG1Maskoperator|= (BG1Mask other)
 Bitwise OR with another mask.
 
BG1Mask operator~ () const
 Bitwise complement.
 
void plot (unsigned x, unsigned y)
 Mark one tile in the bitmap, given as (x,y) coordinates. More...
 
void plot (UInt2 pos)
 Mark one tile in the bitmap, given as a vector. More...
 
uint16_t * rows ()
 Get a pointer to the rows in this mask, as 16-bit integers.
 

Static Public Member Functions

static BG1Mask empty ()
 Create an empty mask. All bits are zero.
 
static BG1Mask filled (UInt2 topLeft, UInt2 size)
 Create a mask with a filled rectangle it. More...
 

Detailed Description

A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.

It is optimized for compile-time arithmetic, so that it's easy and efficient to build up static masks which correspond to a particular screen layout or asset layout. But these vectors can also be used to easily implement some fairly complex logic at runtime. They support boolean operations, which can be used for geometric union, intersection, and subtraction operations.

Member Function Documentation

void Sifteo::BG1Mask::fill ( UInt2  topLeft,
UInt2  size 
)
inline

Mark a rectangular region of the bitmap.

All coordinates must be in range. This function performs no clipping.

static BG1Mask Sifteo::BG1Mask::filled ( UInt2  topLeft,
UInt2  size 
)
inlinestatic

Create a mask with a filled rectangle it.

This should be used only with values that are constant at compile-time. For dynamic masks, it is significantly better to plot the rectangle dynamically using fill().

All coordinates must be in range. This function performs no clipping.

void Sifteo::BG1Mask::plot ( unsigned  x,
unsigned  y 
)
inline

Mark one tile in the bitmap, given as (x,y) coordinates.

All coordinates must be in range. This function performs no clipping.

void Sifteo::BG1Mask::plot ( UInt2  pos)
inline

Mark one tile in the bitmap, given as a vector.

All coordinates must be in range. This function performs no clipping.


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