Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _Methods_H_
- #define _Methods_H_
- #include <grrlib.h>
- #include <stdlib.h>
- #include <math.h>
- #include <wiiuse/wpad.h>
- #define byte unsigned char
- #define PI 3.1415926536f
- //Image-Draw
- //Loads an image from a file
- #define LoadImage GRRLIB_LoadTextureFromFile
- //Draws an image passing all the parameters
- #define DrawImg GRRLIB_DrawImg
- //Draws an image passing X and Y
- void DrawImageXY(const float x, const float y, const GRRLIB_texImg *tex);
- //Draws an image passing one scale
- void DrawImageScale(const float x, const float y, const GRRLIB_texImg *tex, const float degrees, const float scale, const u32 color);
- //Center an image
- void CenterImage(GRRLIB_texImg *tex);
- //Math
- //2 Power of a number
- float Pow2(float x);
- //Distance between 2 pixels
- float PtDistance(float x1, float y1, float x2, float y2);
- //Distance between 2 circles
- bool CircleCollision(float x1, float y1, float radius1, float x2, float y2, float radius2);
- //If a pixel is in a circle
- bool PtInCircle(float x1, float y1, float x2, float y2, float radius);
- //Collision between a circle and a annulus
- bool CircleOnAnnulus(float x1, float y1, float r1, float x2, float y2, float r2_R, float r2_r);
- //Angle between 2 pixels
- float PtAngle(float x1, float y1, float x2, float y2);
- //Simple degree to radian conversion
- float toRad(float angle);
- //Simple radian to degree conversion
- float toDeg(float angle);
- //Returns a random float between two floats
- float RandomFloat(float a, float b);
- //Returns a random int between two int
- int RandomInt(int min, int max);
- //Converts the negative angle system to the normal system
- float toNormalDeg(float deg);
- //Wii
- //Returns de nunchuk angle
- float NunchukAng(int pad);
- //Returns de nunchuk magnitude
- float NunchukMag(int pad);
- //Gets de nunchuk angle and magnitude
- void NunchukAngMag(int pad, float *ang, float *mag);
- //Returns if nunchunk joystick is moving
- bool NunJoyMoving(int pad);
- //Angle between wiimote ir and a plot
- float WiimoteIrAngle(int pad, float x, float y);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement