[CHG] Formating the code

This commit is contained in:
Crayon2000 2009-02-25 05:29:47 +00:00
parent 8cc6db8605
commit 0862cb893b
2 changed files with 7 additions and 9 deletions

View file

@ -260,8 +260,7 @@ void GRRLIB_PrintBMF(f32 xpos, f32 ypos, GRRLIB_bytemapFont bmf, f32 zoom, const
size = vsprintf(tmp, text, argp); size = vsprintf(tmp, text, argp);
va_end(argp); va_end(argp);
GRRLIB_texImg tex_BMfont = GRRLIB_CreateEmptyTexture(800, 600); GRRLIB_texImg tex_BMfont = GRRLIB_CreateEmptyTexture(640, 480);
for(i=0; i<size; i++) { for(i=0; i<size; i++) {
for(j=0; j<bmf.nbChar; j++) { for(j=0; j<bmf.nbChar; j++) {
@ -409,7 +408,7 @@ GRRLIB_texImg GRRLIB_CreateEmptyTexture(unsigned int w, unsigned int h) {
* @param scaleY * @param scaleY
* @param color * @param color
*/ */
inline void GRRLIB_DrawImg(f32 xpos, f32 ypos, GRRLIB_texImg tex, float degrees, float scaleX, f32 scaleY, u32 color ) { inline void GRRLIB_DrawImg(f32 xpos, f32 ypos, GRRLIB_texImg tex, float degrees, float scaleX, f32 scaleY, u32 color) {
GXTexObj texObj; GXTexObj texObj;
u16 width, height; u16 width, height;
Mtx m, m1, m2, mv; Mtx m, m1, m2, mv;
@ -426,7 +425,7 @@ inline void GRRLIB_DrawImg(f32 xpos, f32 ypos, GRRLIB_texImg tex, float degrees,
guMtxIdentity (m1); guMtxIdentity (m1);
guMtxScaleApply(m1, m1, scaleX, scaleY, 1.0); guMtxScaleApply(m1, m1, scaleX, scaleY, 1.0);
Vector axis = (Vector) {0, 0, 1 }; Vector axis = (Vector) {0, 0, 1 };
guMtxRotAxisDeg (m2, &axis, degrees); guMtxRotAxisDeg(m2, &axis, degrees);
guMtxConcat(m2, m1, m); guMtxConcat(m2, m1, m);
guMtxTransApply(m, m, xpos+width, ypos+height, 0); guMtxTransApply(m, m, xpos+width, ypos+height, 0);
@ -491,7 +490,7 @@ inline void GRRLIB_DrawTile(f32 xpos, f32 ypos, GRRLIB_texImg tex, float degrees
guMtxIdentity (m1); guMtxIdentity (m1);
guMtxScaleApply(m1, m1, scaleX, scaleY, 1.0f); guMtxScaleApply(m1, m1, scaleX, scaleY, 1.0f);
Vector axis = (Vector) {0, 0, 1 }; Vector axis = (Vector) {0, 0, 1 };
guMtxRotAxisDeg (m2, &axis, degrees); guMtxRotAxisDeg(m2, &axis, degrees);
guMtxConcat(m2, m1, m); guMtxConcat(m2, m1, m);
guMtxTransApply(m, m, xpos+width, ypos+height, 0); guMtxTransApply(m, m, xpos+width, ypos+height, 0);
guMtxConcat (GXmodelView2D, m, mv); guMtxConcat (GXmodelView2D, m, mv);
@ -865,8 +864,7 @@ void GRRLIB_Init() {
GX_Init(gp_fifo, DEFAULT_FIFO_SIZE); GX_Init(gp_fifo, DEFAULT_FIFO_SIZE);
// clears the bg to color and clears the z buffer // clears the bg to color and clears the z buffer
GXColor background = { 0, 0, 0, 0xff }; GX_SetCopyClear((GXColor){ 0, 0, 0, 0xff }, GX_MAX_Z24);
GX_SetCopyClear (background, GX_MAX_Z24);
// other gx setup // other gx setup
yscale = GX_GetYScaleFactor(rmode->efbHeight, rmode->xfbHeight); yscale = GX_GetYScaleFactor(rmode->efbHeight, rmode->xfbHeight);
@ -925,7 +923,7 @@ void GRRLIB_Init() {
* Call this function after drawing. * Call this function after drawing.
*/ */
void GRRLIB_Render() { void GRRLIB_Render() {
GX_DrawDone (); GX_DrawDone();
fb ^= 1; // flip framebuffer fb ^= 1; // flip framebuffer
GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE); GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);

View file

@ -50,7 +50,7 @@ typedef struct GRRLIB_bytemapChar{
* Structure to hold the bytemap font informations. * Structure to hold the bytemap font informations.
*/ */
typedef struct GRRLIB_bytemapFont{ typedef struct GRRLIB_bytemapFont{
u8 version; /**< Version . */ u8 version; /**< Version. */
s8 addSpace; /**< Add-space after each char (-128..127). */ s8 addSpace; /**< Add-space after each char (-128..127). */
u32 *palette; /**< Font palette. */ u32 *palette; /**< Font palette. */
char *name; /**< Font name. */ char *name; /**< Font name. */