[CHG] Code formating

This commit is contained in:
Crayon2000 2009-07-18 17:50:31 +00:00
parent 948bf1de99
commit 839240c498
5 changed files with 45 additions and 40 deletions

View file

@ -523,10 +523,9 @@ GRRLIB_texImg *GRRLIB_CreateEmptyTexture(unsigned int w, unsigned int h) {
return my_texture;
}
/**
* Make a snapshot of the screen in a texture.
* @return A pointer to a texture representing the screen or NULL if an error occurs.
* @param tex A pointer to a texture representing the screen or NULL if an error occurs.
*/
void GRRLIB_Screen2Texture(GRRLIB_texImg *tex) {
if(tex->data != NULL) {
@ -538,8 +537,6 @@ void GRRLIB_Screen2Texture(GRRLIB_texImg *tex) {
}
}
/**
* Draw a texture.
* @param xpos Specifies the x-coordinate of the upper-left corner.
@ -551,7 +548,9 @@ void GRRLIB_Screen2Texture(GRRLIB_texImg *tex) {
* @param color Color in RGBA format.
*/
inline void GRRLIB_DrawImg(f32 xpos, f32 ypos, struct GRRLIB_texImg *tex, float degrees, float scaleX, f32 scaleY, u32 color) {
if (tex == NULL || tex->data == NULL) { return; }
if (tex == NULL || tex->data == NULL) {
return;
}
GXTexObj texObj;
u16 width, height;
@ -608,7 +607,9 @@ inline void GRRLIB_DrawImg(f32 xpos, f32 ypos, struct GRRLIB_texImg *tex, float
* @param color Color in RGBA format.
*/
inline void GRRLIB_DrawImgQuad(Vector pos[4], struct GRRLIB_texImg *tex, u32 color) {
if (tex == NULL || tex->data == NULL) { return; }
if (tex == NULL || tex->data == NULL) {
return;
}
GXTexObj texObj;
Mtx m, m1, m2, mv;
@ -666,7 +667,9 @@ inline void GRRLIB_DrawImgQuad(Vector pos[4], struct GRRLIB_texImg *tex, u32 col
* @param frame Specifies the frame to draw.
*/
inline void GRRLIB_DrawTile(f32 xpos, f32 ypos, struct GRRLIB_texImg *tex, float degrees, float scaleX, f32 scaleY, u32 color, int frame) {
if (tex == NULL || tex->data == NULL) { return; }
if (tex == NULL || tex->data == NULL) {
return;
}
GXTexObj texObj;
f32 width, height;
@ -730,9 +733,10 @@ inline void GRRLIB_DrawTile(f32 xpos, f32 ypos, struct GRRLIB_texImg *tex, float
* @param color Color in RGBA format.
* @param frame Specifies the frame to draw.
*/
inline void GRRLIB_DrawTileQuad(Vector pos[4], struct GRRLIB_texImg *tex, u32 color, int frame) {
if (tex == NULL || tex->data == NULL) { return; }
if (tex == NULL || tex->data == NULL) {
return;
}
GXTexObj texObj;
Mtx m, m1, m2, mv;
@ -797,7 +801,9 @@ inline void GRRLIB_DrawTileQuad(Vector pos[4], struct GRRLIB_texImg *tex, u32 co
* @param ... Optional arguments.
*/
void GRRLIB_Printf(f32 xpos, f32 ypos, struct GRRLIB_texImg *tex, u32 color, f32 zoom, const char *text, ...) {
if (tex == NULL || tex->data == NULL) { return; }
if (tex == NULL || tex->data == NULL) {
return;
}
int i, size;
char tmp[1024];
@ -1361,7 +1367,6 @@ void GRRLIB_GetPixelFromFB(int x, int y, u8 *R1, u8 *G1, u8 *B1, u8* R2, u8 *G2,
*B2 = GRRLIB_ClampVar8( 1.164 * (Colors[2] - 16) + 2.017 * (Colors[1] - 128) );
}
/**
* A helper function for the YCbCr -> RGB conversion.
* Clamps the given value into a range of 0 - 255 and thus preventing an overflow.
@ -1382,10 +1387,10 @@ u8 GRRLIB_ClampVar8(float Value) {
/**
* Converts RGBA values to u32 color.
* @param r Amount of Red (0 - 255);
* @param g Amount of Green (0 - 255);
* @param b Amount of Blue (0 - 255);
* @param a Amount of Alpha (0 - 255);
* @param r Amount of red (0 - 255).
* @param g Amount of green (0 - 255).
* @param b Amount of blue (0 - 255).
* @param a Amount of alpha (0 - 255).
* @return Returns the color in u32 format.
*/
u32 GRRLIB_GetColor(u8 r, u8 g, u8 b, u8 a) {

View file

@ -168,7 +168,7 @@ int main() {
FPS = CalculateFrameRate();
if(wpaddown & WPAD_BUTTON_HOME) {
exit(0);
break;
}
if(wpadheld & WPAD_BUTTON_LEFT) {
if(wpadheld & WPAD_BUTTON_B || page == 1)

View file

@ -180,7 +180,7 @@ int main() {
GRRLIB_Render();
if(wpaddown & WPAD_BUTTON_HOME) {
exit(0);
break;
}
if(wpaddown & WPAD_BUTTON_MINUS) {
page--;

View file

@ -24,7 +24,7 @@ int main() {
GRRLIB_Render();
if(WPADDown & WPAD_BUTTON_HOME) {
exit(0);
break;
}
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB