mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-12-23 02:39:19 +00:00
[NEW] GRRLIB_HotZone to detect if the wpad is in a specific zone
This commit is contained in:
parent
00ffc71ed0
commit
8aea904788
3 changed files with 23 additions and 0 deletions
|
@ -50,6 +50,8 @@ ChangeLog :
|
|||
|
||||
* InitVideo() and GRRLIB_Start() merge into GRRLIB_Init().
|
||||
|
||||
* add GRRLIB_HotZone that return True/False if the wpad is in a specific zone
|
||||
|
||||
have a look at the sample code to see how all this work ;)
|
||||
|
||||
Remember that 3.0.5 is a WIP preview for the soon coming GRRLIB 4.0 and it's not intend to be publicly released...
|
||||
|
|
|
@ -400,6 +400,26 @@ void GRRLIB_Printf(f32 xpos, f32 ypos, GRRLIB_texImg tex, u32 color, f32 zoom, c
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect if the wiimote is in a zone
|
||||
* @param hotx
|
||||
* @param hoty
|
||||
* @param hotw
|
||||
* @param hoth
|
||||
* @param padx
|
||||
* @param pady
|
||||
* @return true/false if you are in or out
|
||||
*/
|
||||
bool GRRLIB_HotZone(int hotx, int hoty, int hotw, int hoth, int wpadx, int wpady) {
|
||||
bool test=false;
|
||||
|
||||
if(((wpadx>hotx) & (wpadx<(hotx+hotw))) & ((wpady>hoty) & (wpady<(hoty+hoth)))){
|
||||
test=true;
|
||||
}
|
||||
|
||||
return(test);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param v
|
||||
|
|
|
@ -58,6 +58,7 @@ inline void GRRLIB_DrawTile(f32 xpos, f32 ypos, GRRLIB_texImg tex, float degrees
|
|||
|
||||
void GRRLIB_Printf(f32 xpos, f32 ypos, GRRLIB_texImg tex, u32 color, f32 zoom, const char *text, ...);
|
||||
|
||||
bool GRRLIB_HotZone(int hotx, int hoty, int hotw, int hoth, int wpadx, int wpady);
|
||||
|
||||
void GRRLIB_GXEngine(Vector v[], u32 color, long count, u8 fmt);
|
||||
|
||||
|
|
Loading…
Reference in a new issue