CircleOS  1
Functions
pointer.c File Reference

Various utilities for the pointer management. More...

Go to the source code of this file.

Functions

void POINTER_SetCurrentPointer (coord_t width, coord_t height, const u8 *bmp)
 
s16 POINTER_GetCurrentAngleStart (void)
 
void POINTER_SetCurrentAngleStart (u16 newangle)
 
u16 POINTER_GetCurrentSpeedOnAngle (void)
 
void POINTER_SetCurrentSpeedOnAngle (u16 newspeed)
 
void POINTER_SetCurrentAreaStore (u8 *ptr)
 
void POINTER_SetMode (enum POINTER_mode mode)
 
enum POINTER_mode POINTER_GetMode (void)
 
enum POINTER_state POINTER_GetState (void)
 
void POINTER_SetRect (coord_t x, coord_t y, coord_t width, coord_t height)
 
void POINTER_SetRectScreen (void)
 
u16 POINTER_GetPos (void)
 
void POINTER_SetPos (coord_t x, coord_t y)
 
void POINTER_Draw (coord_t x, coord_t y, coord_t width, coord_t height, const u8 *bmp)
 
void POINTER_Save (coord_t x, coord_t y, coord_t width, coord_t height)
 
void POINTER_Restore (coord_t x, coord_t y, coord_t width, coord_t height)
 
void POINTER_SetApplication_Pointer_Mgr (tAppPtrMgr mgr)
 
void POINTER_SetColor (color_t color)
 
color_t POINTER_GetColor (void)
 
tPointer_InfoPOINTER_GetInfo (void)
 

Detailed Description

Author
FL
Date
07/2007
Version
1.1
Date
10/2007
Version
1.5 various corrections reported by Ron Miller to suppress jittery
Date
10/2008
Version
3.0 Add joystick use for Primer 2
Date
10/2009
Version
4.0 Add Open4 Primer

Definition in file pointer.c.

Function Documentation

void POINTER_Draw ( coord_t  x,
coord_t  y,
coord_t  width,
coord_t  height,
const u8 *  bmp 
)

Draw pointer.

Parameters
[in]xHorizontal coordinate of the bottom left corner of the pointer.
[in]yVertical coordinate of the bottom left corner of the pointer.
[in]widthPointer bitmap width.
[in]heightPointer bitmap height.
[in]bmpPointer to width * height bit array. If null used default pointer bitmap.
Note
The provided bitmap is a monochrome one.
Warning
The (0x0) point in on the low left corner.

Definition at line 863 of file pointer.c.

color_t POINTER_GetColor ( void  )

Return the current pointer color.

Returns
Current pointer color.

Definition at line 1056 of file pointer.c.

s16 POINTER_GetCurrentAngleStart ( void  )

Get the current minimal angle to move pointer

Returns
current minimal angle.

Definition at line 550 of file pointer.c.

u16 POINTER_GetCurrentSpeedOnAngle ( void  )

Return the current speed/angle ratio.

Returns
current ratio.

Definition at line 586 of file pointer.c.

tPointer_Info* POINTER_GetInfo ( void  )

Get pointer informations.

Returns
A pointer to a pointer information structure.

Definition at line 1074 of file pointer.c.

enum POINTER_mode POINTER_GetMode ( void  )

Return the current mode of the pointer management

Returns
Current pointer management mode.

Definition at line 713 of file pointer.c.

u16 POINTER_GetPos ( void  )

Return the current position of the pointer (on the screen).

Returns
The current pointer screen position with X in the LSB and Y in the MSB.
Warning
The (0x0) point in on the low left corner.

Definition at line 815 of file pointer.c.

enum POINTER_state POINTER_GetState ( void  )

Return current pointer state.

Returns
Current pointer state.

Definition at line 731 of file pointer.c.

void POINTER_Restore ( coord_t  x,
coord_t  y,
coord_t  width,
coord_t  height 
)

Restore the background of the pointer with data saved in the current store area.

Parameters
[in]xHorizontal coordinate of the bottom left corner of the area to restore.
[in]yVertical coordinate of the bottom left corner of the area to restore.
[in]widthWidth of the area to restore.
[in]heightHeight of the area to restore.
Warning
The (0x0) point in on the low left corner.
See Also
POINTER_Save
POINTER_SetCurrentAreaStore

Definition at line 977 of file pointer.c.

void POINTER_Save ( coord_t  x,
coord_t  y,
coord_t  width,
coord_t  height 
)

Save the background of the pointer.

Parameters
[in]xHorizontal coordinate of the bottom left corner of the area to save.
[in]yVertical coordinate of the bottom left corner of the area to save.
[in]widthWidth of the area to save.
[in]heightHeight of the area to save.
Note
The store area must be large enough to store all the pixels (16 bits).
Warning
The (0x0) point in on the low left corner.
See Also
POINTER_Restore
POINTER_SetCurrentAreaStore

Definition at line 945 of file pointer.c.

void POINTER_SetApplication_Pointer_Mgr ( tAppPtrMgr  mgr)

Provides an user defined pointer manager.

Parameters
[in]mgrPointer to the user defined pointer manager.

Definition at line 1020 of file pointer.c.

void POINTER_SetColor ( color_t  color)

Set the pointer color.

Parameters
[in]colorThe new pointer color.

Definition at line 1038 of file pointer.c.

void POINTER_SetCurrentAngleStart ( u16  newangle)

Set the current minimal angle to move pointer

Parameters
[in]newangleThe new minimal angle to move pointer.

Definition at line 568 of file pointer.c.

void POINTER_SetCurrentAreaStore ( u8 *  ptr)

Change the current storage area. If the provided value is NULL, the default storage area will be used.

Parameters
[in]ptrNew storage area (may be null).
Warning
Memory space pointed by the provided pointer must be large enough to store a color bitmap corresponding to the pointer area. In other words, space must be width * height * 2 bytes large.

Definition at line 627 of file pointer.c.

void POINTER_SetCurrentPointer ( coord_t  width,
coord_t  height,
const u8 *  bmp 
)

Set the dimension and the bitmap of the pointer.

Note
The bitmap is a monochrome one!
Parameters
[in]widthwidth of the pointer (u8)
[in]heightheight of the pointer (u8)
[in]bmppointer to an array of width * height bits.

Definition at line 520 of file pointer.c.

void POINTER_SetCurrentSpeedOnAngle ( u16  newspeed)

Set the current speed/angle ratio.

Parameters
[in]newspeedNew speed/angle ratio.

Definition at line 604 of file pointer.c.

void POINTER_SetMode ( enum POINTER_mode  mode)

Change the current mode of the pointer management.

Note
Must be called only ONCE!!
Parameters
[in]modeNew pointer management mode.

Definition at line 647 of file pointer.c.

void POINTER_SetPos ( coord_t  x,
coord_t  y 
)

Force the screen position of the pointer.

Parameters
[in]xNew horizontal coordinate.
[in]yNew vertical coordinate.
Warning
The (0x0) point in on the low left corner.

Definition at line 836 of file pointer.c.

void POINTER_SetRect ( coord_t  x,
coord_t  y,
coord_t  width,
coord_t  height 
)

Set new limits for the move of the pointer

Parameters
[in]xHorizontal coordinate of the bottom left corner of the new area.
[in]yVertical coordinate of the bottom left corner of the new are.
[in]widthNew area width.
[in]heightNew area height.
Warning
The (0x0) point in on the low left corner.

Definition at line 754 of file pointer.c.

void POINTER_SetRectScreen ( void  )

Allow the pointer to move on the whole screen.

Definition at line 796 of file pointer.c.