[NEW] GRRLIB_HotZone to detect if the wpad is in a specific zone

This commit is contained in:
N0NameN0 2009-01-21 13:30:44 +00:00
parent 00ffc71ed0
commit 8aea904788
3 changed files with 23 additions and 0 deletions

View file

@ -50,6 +50,8 @@ ChangeLog :
* InitVideo() and GRRLIB_Start() merge into GRRLIB_Init(). * 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 ;) 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... 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...

View file

@ -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 * @param v

View file

@ -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, ...); 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); void GRRLIB_GXEngine(Vector v[], u32 color, long count, u8 fmt);