Object Rotation/Scaling Functions


Defines

#define HEL_SUBSYSTEM_OBJROTSCALE_REQUIREDMEMORY
 Required memory for the Object Rotation/Scaling System.

Functions

THandle hel_ObjRotScaleClone (THandle Handle)
 Clone a Rotation/Scaling Set.
THandle hel_ObjRotScaleCreate (u32 Angle, s32 ScaleX, s32 ScaleY)
 Create a new Rotation/Scaling Set.
void hel_ObjRotScaleDelete (THandle Handle)
 Delete a Rotation/Scaling Set.
HEL_INLINE u32 hel_ObjRotScaleGetFreeSlots (void)
 Get amount of free Rotation/Scaling Sets.
void hel_ObjRotScaleInit (void *pBuffer)
 Initialize Object Rotation/Scaling SubSystem.
void hel_ObjRotScaleQuit (void)
 Uninitialize Object Rotation/Scaling SubSystem.
void hel_ObjRotScaleTransmit (void)
 Transmit Rotation/Scaling Parameters to hardware.
void hel_ObjRotScaleUpdate (THandle Handle, u32 Angle, s32 ScaleX, s32 ScaleY)
 Update Rotation/Scaling Parameters.

Detailed Description

The Object Rotation/Scaling Sub-System can be used to create Rotation/Scaling Sets, which can be assigned to Objects, to perform rotation and scaling in hardware. The GBA hardware has a total of 32 Rotation/Scaling Sets available.

The Rotation/Scaling Parameter-Attributes are internally shadowed to avoid screen tearing and should be transmitted to hardware during Vertical Blank.

Please see "demos/ObjRotation" for an example program.


Define Documentation

#define HEL_SUBSYSTEM_OBJROTSCALE_REQUIREDMEMORY

Required memory for the Object Rotation/Scaling System.

This define represents the amount of memory, specified in bytes, the Object Rotation/Scaling System from HEL requires to manage its internal states. When you initialize the Object Rotation/Scaling System, you must pass a buffer which equals the size of HEL_SUBSYSTEM_OBJROTSCALE_REQUIREDMEMORY.

See also:
hel_ObjRotScaleInit


Function Documentation

THandle hel_ObjRotScaleClone ( THandle  Handle  ) 

Clone a Rotation/Scaling Set.

The hel_ObjRotScaleClone function clones an existing Rotation/Scaling Set.

Parameters:
[in] Handle Handle of Rotation/Scaling Set you want to clone
Returns:
Returns the Handle of the cloned Rotation/Scaling Set.

THandle hel_ObjRotScaleCreate ( u32  Angle,
s32  ScaleX,
s32  ScaleY 
)

Create a new Rotation/Scaling Set.

The hel_ObjRotScaleCreate creates a new Rotation/Scaling Set and returns a Handle to it.

Parameters:
[in] Angle Rotation-angle in degree (0..359)
[in] ScaleX Horizontal scaling
[in] ScaleY Vertical scaling
Returns:
Returns a Handle to the created Rotation/Scaling Set.
Note:
ScaleX and ScaleY have to be specified in 8.8 fixed point format. Bigger numbers increase, smaller numbers reduce the size.
See also:
hel_ObjRotScaleClone

void hel_ObjRotScaleDelete ( THandle  Handle  ) 

Delete a Rotation/Scaling Set.

The hel_ObjRotScaleDelete deletes the Rotation/Scaling Set specified by Handle when it's not referenced anymore.

Parameters:
[in] Handle Handle of Rotation/Scaling Set you want to delete
Note:
In case the Rotation/Scaling Set has been cloned, it will not be delete until all clones have been deleted too.

HEL_INLINE u32 hel_ObjRotScaleGetFreeSlots ( void   ) 

Get amount of free Rotation/Scaling Sets.

The hel_ObjRotScaleGetFreeSlots returns the amount of unused/free Rotation/Scaling Sets. This value is between 0..31.

Returns:
The hel_ObjRotScaleGetFreeSlots returns the amount of free/unused Rotation/Scaling Sets.

void hel_ObjRotScaleInit ( void *  pBuffer  ) 

Initialize Object Rotation/Scaling SubSystem.

Call hel_ObjRotScaleInit to initialize the Rotation/Scaling Parameter Sub-System. This function must be called before using any other Object Rotation/Scaling function.

Parameters:
[in] pBuffer Must point to a buffer of at least HEL_SUBSYSTEM_OBJROTSCALE_REQUIREDMEMORY allocated bytes. The buffer must be word-aligned and should be located in EWRAM. It must not be changed after initialization as long as the Object Rotation/Scaling System is running!
// Allocate memory for Object Rotation/Scaling-System
u8 ATTR_EWRAM ATTR_ALIGNED(4) g_ObjRotScaleBuffer[HEL_SUBSYSTEM_OBJROTSCALE_REQUIREDMEMORY];

int main(void)
{
    // Initialize Object Rotation/Scaling Sub-System
    hel_ObjRotScaleInit((void*)g_ObjRotScaleBuffer);

    // ...
}

void hel_ObjRotScaleQuit ( void   ) 

Uninitialize Object Rotation/Scaling SubSystem.

Call hel_ObjRotScaleQuit to uninitialize the Rotation/Scaling Parameter SubSystem.

void hel_ObjRotScaleTransmit ( void   ) 

Transmit Rotation/Scaling Parameters to hardware.

The hel_ObjRotScaleTransmit copies the shadowed Object Rotation/Scaling attributes to hardware (Vram).

This function should be called during Vertical Blank.

void hel_ObjRotScaleUpdate ( THandle  Handle,
u32  Angle,
s32  ScaleX,
s32  ScaleY 
)

Update Rotation/Scaling Parameters.

hel_ObjRotScaleUpdate can be used to update the parameters of an existing Rotation/Scaling Set. This includes the rotation-angle and scale.

Parameters:
[in] Handle Handle of Rotation/Scaling Set
[in] Angle Rotation-angle in degree
[in] ScaleX Horizontal scale
[in] ScaleY Vertical scale
See also:
hel_ObjRotScaleCreate


Generated on Sat Aug 12 13:54:09 2006 for HEL 2 Library by  doxygen 1.4.7