From c63ad06ac9805e9a78b5e65c80cc46fdcae5a2f1 Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Tue, 15 Dec 2009 22:51:39 +0000 Subject: [PATCH] [CHG] Function should start with upper case character --- GRRLIB/GRRLIB/GRRLIB_3D.c | 28 ++++++++++++------------- GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h | 8 +++---- examples/3D_CubedTileDemo/source/main.c | 8 +++---- examples/3D_sample1/source/main.c | 6 +++--- examples/3D_sample2/source/main.c | 8 +++---- examples/3D_sample3/source/main.c | 8 +++---- examples/3D_sample4/source/main.c | 6 +++--- examples/unlimited3d/source/main.c | 12 +++++------ 8 files changed, 41 insertions(+), 43 deletions(-) diff --git a/GRRLIB/GRRLIB/GRRLIB_3D.c b/GRRLIB/GRRLIB/GRRLIB_3D.c index a21e68a..e0144c8 100644 --- a/GRRLIB/GRRLIB/GRRLIB_3D.c +++ b/GRRLIB/GRRLIB/GRRLIB_3D.c @@ -22,6 +22,15 @@ THE SOFTWARE. #include +// User should not directly modify these +static Mtx _GRR_view; +static guVector _GRR_cam = {0.0F, 0.0F, 0.0F}, + _GRR_up = {0.0F, 1.0F, 0.0F}, + _GRR_look = {0.0F, 0.0F, -100.0F}; +static guVector _GRRaxisx = (guVector){1, 0, 0}; // DO NOT MODIFY!!! +static guVector _GRRaxisy = (guVector){0, 1, 0}; // Even at runtime +static guVector _GRRaxisz = (guVector){0, 0, 1}; // NOT ever! + /** * Set the background parameter when screen is cleared. * @param r Red component. @@ -29,16 +38,10 @@ THE SOFTWARE. * @param b Blue component. * @param a Alpha component. */ -void GRRLIB_setBackgroundColour(u8 r, u8 g, u8 b, u8 a) { +void GRRLIB_SetBackgroundColour(u8 r, u8 g, u8 b, u8 a) { GX_SetCopyClear((GXColor){ r, g, b, a }, GX_MAX_Z24); } -// user should not directly modify these -guVector _GRR_cam = {0.0F, 0.0F, 0.0F}, - _GRR_up = {0.0F, 1.0F, 0.0F}, - _GRR_look = {0.0F, 0.0F, -100.0F}; -Mtx _GRR_view; - /** * Set the camera parameter (contributed my chris_c aka DaShAmAn). * @param posx x posision of the cam. @@ -51,7 +54,7 @@ Mtx _GRR_view; * @param looky y up posision of the cam. * @param lookz z up posision of the cam. */ -void GRRLIB_camera3dSettings(f32 posx, f32 posy, f32 posz, +void GRRLIB_Camera3dSettings(f32 posx, f32 posy, f32 posz, f32 upx, f32 upy, f32 upz, f32 lookx, f32 looky, f32 lookz) { @@ -128,10 +131,6 @@ void GRRLIB_2dMode() { GX_SetTevOp (GX_TEVSTAGE0, GX_PASSCLR); } -static guVector _GRRaxisx = (guVector){1,0,0}; // DO NOT MODIFY!!! -static guVector _GRRaxisy = (guVector){0,1,0}; // Even at runtime -static guVector _GRRaxisz = (guVector){0,0,1}; // NOT ever! - /** * Set the view matrix to draw object (contributed my chris_c aka DaShAmAn). * @param posx x posision of the object. @@ -141,7 +140,7 @@ static guVector _GRRaxisz = (guVector){0,0,1}; // NOT ever! * @param angy y rotation angle of the object. * @param angz z rotation angle of the object. */ -void GRRLIB_objectView(f32 posx, f32 posy, f32 posz, f32 angx, f32 angy, f32 angz) { +void GRRLIB_ObjectView(f32 posx, f32 posy, f32 posz, f32 angx, f32 angy, f32 angz) { Mtx m, mv, rx, ry, rz; Mtx mvi ; @@ -166,7 +165,7 @@ void GRRLIB_objectView(f32 posx, f32 posy, f32 posz, f32 angx, f32 angy, f32 ang * @param tex poiter to an image texture (GRRLIB_texImg format). * @param rep Texture Repeat Mode, True will repeat it, False won't. */ -void GRRLIB_setTexture(GRRLIB_texImg *tex, bool rep) { +void GRRLIB_SetTexture(GRRLIB_texImg *tex, bool rep) { GXTexObj texObj; if (rep) { @@ -187,4 +186,3 @@ void GRRLIB_setTexture(GRRLIB_texImg *tex, bool rep) { GX_SetTevOp (GX_TEVSTAGE0, GX_MODULATE); GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT); } - diff --git a/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h b/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h index 9d965b3..e645db0 100644 --- a/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h +++ b/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h @@ -140,12 +140,12 @@ void GRRLIB_GeckoPrintf (const char *text, ...); //------------------------------------------------------------------------------ // GRRLIB_3D.c - 3D functions for GRRLIB -void GRRLIB_setBackgroundColour(u8 r, u8 g, u8 b, u8 a); -void GRRLIB_camera3dSettings(f32 posx, f32 posy, f32 posz, f32 upx, f32 upy, f32 upz, f32 lookx, f32 looky, f32 lookz); +void GRRLIB_SetBackgroundColour(u8 r, u8 g, u8 b, u8 a); +void GRRLIB_Camera3dSettings(f32 posx, f32 posy, f32 posz, f32 upx, f32 upy, f32 upz, f32 lookx, f32 looky, f32 lookz); void GRRLIB_3dMode(f32 minDist, f32 maxDist, f32 fov, bool texturemode); void GRRLIB_2dMode(); -void GRRLIB_objectView(f32 posx, f32 posy, f32 posz, f32 angx, f32 angy, f32 angz); -void GRRLIB_setTexture(GRRLIB_texImg *tex, bool rep); +void GRRLIB_ObjectView(f32 posx, f32 posy, f32 posz, f32 angx, f32 angy, f32 angz); +void GRRLIB_SetTexture(GRRLIB_texImg *tex, bool rep); #endif // __GRRLIB_FNLIB_H__ diff --git a/examples/3D_CubedTileDemo/source/main.c b/examples/3D_CubedTileDemo/source/main.c index 16f5c78..565b17f 100644 --- a/examples/3D_CubedTileDemo/source/main.c +++ b/examples/3D_CubedTileDemo/source/main.c @@ -155,7 +155,7 @@ int main() { GRRLIB_texImg *tex_screen = GRRLIB_CreateEmptyTexture(rmode->fbWidth, rmode->efbHeight); - GRRLIB_setBackgroundColour(0x00, 0x00, 0x00, 0xFF); + GRRLIB_SetBackgroundColour(0x00, 0x00, 0x00, 0xFF); while(1) { GRRLIB_2dMode(); @@ -276,10 +276,10 @@ int main() { GRRLIB_Screen2Texture(0, 0, tex_screen, GX_TRUE); - GRRLIB_camera3dSettings(0.0f,0.0f,camZ, 0,1,0, 0,0,0); + GRRLIB_Camera3dSettings(0.0f,0.0f,camZ, 0,1,0, 0,0,0); GRRLIB_3dMode(0.1,3000,45,1); - GRRLIB_setTexture(tex_screen,0); - GRRLIB_objectView(0,0,0, a,a*2,a*3); + GRRLIB_SetTexture(tex_screen,0); + GRRLIB_ObjectView(0,0,0, a,a*2,a*3); GX_Begin(GX_QUADS, GX_VTXFMT0, 16); GX_Position3f32(-rmode->fbWidth/2,rmode->efbHeight/2,rmode->fbWidth/2); GX_Color1u32(col[0]); diff --git a/examples/3D_sample1/source/main.c b/examples/3D_sample1/source/main.c index 31fc326..662d717 100644 --- a/examples/3D_sample1/source/main.c +++ b/examples/3D_sample1/source/main.c @@ -24,8 +24,8 @@ int main() { GRRLIB_Settings.antialias = true; - GRRLIB_setBackgroundColour(0x00, 0x00, 0x00, 0xFF); - GRRLIB_camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0); + GRRLIB_SetBackgroundColour(0x00, 0x00, 0x00, 0xFF); + GRRLIB_Camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0); while(1) { GRRLIB_2dMode(); @@ -35,7 +35,7 @@ int main() { if(WPAD_ButtonsHeld(0) & WPAD_BUTTON_B) cubeZ--; GRRLIB_3dMode(0.1,1000,45,0); - GRRLIB_objectView(0,0,cubeZ, a,a*2,a*3); + GRRLIB_ObjectView(0,0,cubeZ, a,a*2,a*3); GX_Begin(GX_QUADS, GX_VTXFMT0, 24); GX_Position3f32(-1.0f,1.0f,-1.0f); GX_Color1u32(col[0]); diff --git a/examples/3D_sample2/source/main.c b/examples/3D_sample2/source/main.c index 7d87f28..8910fcf 100644 --- a/examples/3D_sample2/source/main.c +++ b/examples/3D_sample2/source/main.c @@ -29,8 +29,8 @@ int main() { GRRLIB_Settings.antialias = true; - GRRLIB_setBackgroundColour(0x00, 0x00, 0x00, 0xFF); - GRRLIB_camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0); + GRRLIB_SetBackgroundColour(0x00, 0x00, 0x00, 0xFF); + GRRLIB_Camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0); while(1) { GRRLIB_2dMode(); @@ -40,8 +40,8 @@ int main() { if(WPAD_ButtonsHeld(0) & WPAD_BUTTON_B) cubeZ--; GRRLIB_3dMode(0.1,1000,45,1); - GRRLIB_setTexture(tex_girl,0); - GRRLIB_objectView(0,0,cubeZ, a,a*2,a*3); + GRRLIB_SetTexture(tex_girl,0); + GRRLIB_ObjectView(0,0,cubeZ, a,a*2,a*3); GX_Begin(GX_QUADS, GX_VTXFMT0, 24); GX_Position3f32(-1.0f,1.0f,1.0f); GX_Color1u32(col[0]); diff --git a/examples/3D_sample3/source/main.c b/examples/3D_sample3/source/main.c index e01ba4a..f8d6d65 100644 --- a/examples/3D_sample3/source/main.c +++ b/examples/3D_sample3/source/main.c @@ -37,8 +37,8 @@ int main() { GRRLIB_Settings.antialias = true; - GRRLIB_setBackgroundColour(0x00, 0x00, 0x00, 0xFF); - GRRLIB_camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0); + GRRLIB_SetBackgroundColour(0x00, 0x00, 0x00, 0xFF); + GRRLIB_Camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0); while(1) { GRRLIB_2dMode(); @@ -48,8 +48,8 @@ int main() { if(WPAD_ButtonsHeld(0) & WPAD_BUTTON_B) cubeZ--; GRRLIB_3dMode(0.1,1000,45,1); - GRRLIB_setTexture(tex_girl,0); - GRRLIB_objectView(0,0,cubeZ, a,a*2,a*3); + GRRLIB_SetTexture(tex_girl,0); + GRRLIB_ObjectView(0,0,cubeZ, a,a*2,a*3); GX_Begin(GX_QUADS, GX_VTXFMT0, 24); GX_Position3f32(-1.0f,1.0f,1.0f); GX_Color1u32(col[0]); diff --git a/examples/3D_sample4/source/main.c b/examples/3D_sample4/source/main.c index c8d0907..94e57d8 100644 --- a/examples/3D_sample4/source/main.c +++ b/examples/3D_sample4/source/main.c @@ -23,8 +23,8 @@ int main() { GRRLIB_Settings.antialias = true; - GRRLIB_setBackgroundColour(0x00, 0x00, 0x00, 0xFF); - GRRLIB_camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0); + GRRLIB_SetBackgroundColour(0x00, 0x00, 0x00, 0xFF); + GRRLIB_Camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0); while(1) { GRRLIB_2dMode(); @@ -33,7 +33,7 @@ int main() { GRRLIB_3dMode(0.1,1000,45,0); - GRRLIB_objectView(0,0,-30, a,a*2,a*3); + GRRLIB_ObjectView(0,0,-30, a,a*2,a*3); GX_Begin(GX_TRIANGLES, GX_VTXFMT0, logoNbFace * 3); for(i=0; in*2*PI){ + if(t>n*2*PI) { n++; f+=0.01f; } - if(f>2*PI){ + if(f>2*PI) { f=0; ff+=0.02f; }