[CHG] Cleanup

This commit is contained in:
Crayon2000 2009-12-06 23:12:49 +00:00
parent 9b73645f0e
commit 73e5367e4b
3 changed files with 147 additions and 147 deletions

View file

@ -11,12 +11,12 @@
#include "gfx/font.h" #include "gfx/font.h"
int main() { int main() {
float a=0; float a=0;
u32 col[3]; u32 col[3];
col[0]=0xFFFFFFFF; col[0]=0xFFFFFFFF;
col[1]=0xAAAAAAFF; col[1]=0xAAAAAAFF;
col[2]=0x666666FF; col[2]=0x666666FF;
int cubeZ=0; int cubeZ=0;
GRRLIB_Init(); GRRLIB_Init();
WPAD_Init(); WPAD_Init();
@ -30,70 +30,70 @@ int cubeZ=0;
GRRLIB_camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0); GRRLIB_camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0);
while(1) { while(1) {
GRRLIB_2dMode(); GRRLIB_2dMode();
WPAD_ScanPads(); WPAD_ScanPads();
if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0); if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0);
if(WPAD_ButtonsHeld(0) & WPAD_BUTTON_A) cubeZ++; if(WPAD_ButtonsHeld(0) & WPAD_BUTTON_A) cubeZ++;
if(WPAD_ButtonsHeld(0) & WPAD_BUTTON_B) cubeZ--; if(WPAD_ButtonsHeld(0) & WPAD_BUTTON_B) cubeZ--;
GRRLIB_3dMode(0.1,1000,45,0); 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_Begin(GX_QUADS, GX_VTXFMT0, 24);
GX_Position3f32(-1.0f,1.0f,-1.0f); GX_Position3f32(-1.0f,1.0f,-1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_Position3f32(-1.0f,-1.0f,-1.0f); GX_Position3f32(-1.0f,-1.0f,-1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_Position3f32(1.0f,-1.0f,-1.0f); GX_Position3f32(1.0f,-1.0f,-1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_Position3f32(1.0f,1.0f,-1.0f); GX_Position3f32(1.0f,1.0f,-1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_Position3f32(-1.0f,1.0f,1.0f); GX_Position3f32(-1.0f,1.0f,1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_Position3f32(-1.0f,-1.0f,1.0f); GX_Position3f32(-1.0f,-1.0f,1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_Position3f32(1.0f,-1.0f,1.0f); GX_Position3f32(1.0f,-1.0f,1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_Position3f32(1.0f,1.0f,1.0f); GX_Position3f32(1.0f,1.0f,1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_Position3f32(-1.0f,1.0f,1.0f); GX_Position3f32(-1.0f,1.0f,1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_Position3f32(1.0f,1.0f,1.0f); GX_Position3f32(1.0f,1.0f,1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_Position3f32(1.0f,1.0f,-1.0f); GX_Position3f32(1.0f,1.0f,-1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_Position3f32(-1.0f,1.0f,-1.0f); GX_Position3f32(-1.0f,1.0f,-1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_Position3f32(-1.0f,-1.0f,1.0f); GX_Position3f32(-1.0f,-1.0f,1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_Position3f32(1.0f,-1.0f,1.0f); GX_Position3f32(1.0f,-1.0f,1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_Position3f32(1.0f,-1.0f,-1.0f); GX_Position3f32(1.0f,-1.0f,-1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_Position3f32(-1.0f,-1.0f,-1.0f); GX_Position3f32(-1.0f,-1.0f,-1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_Position3f32(-1.0f,1.0f,1.0f); GX_Position3f32(-1.0f,1.0f,1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_Position3f32(-1.0f,1.0f,-1.0f); GX_Position3f32(-1.0f,1.0f,-1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_Position3f32(-1.0f,-1.0f,-1.0f); GX_Position3f32(-1.0f,-1.0f,-1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_Position3f32(-1.0f,-1.0f,1.0f); GX_Position3f32(-1.0f,-1.0f,1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_Position3f32(1.0f,1.0f,1.0f); GX_Position3f32(1.0f,1.0f,1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_Position3f32(1.0f,1.0f,-1.0f); GX_Position3f32(1.0f,1.0f,-1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_Position3f32(1.0f,-1.0f,-1.0f); GX_Position3f32(1.0f,-1.0f,-1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_Position3f32(1.0f,-1.0f,1.0f); GX_Position3f32(1.0f,-1.0f,1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_End(); GX_End();
a+=0.5f; a+=0.5f;
// Switch To 2D Mode to display text // Switch To 2D Mode to display text
GRRLIB_2dMode(); GRRLIB_2dMode();

View file

@ -13,12 +13,12 @@
#include "gfx/girl.h" #include "gfx/girl.h"
int main() { int main() {
float a=0; float a=0;
u32 col[3]; u32 col[3];
col[0]=0xFFFFFFFF; col[0]=0xFFFFFFFF;
col[1]=0xFFFFFFFF; col[1]=0xFFFFFFFF;
col[2]=0xFFFFFFFF; col[2]=0xFFFFFFFF;
int cubeZ=0; int cubeZ=0;
GRRLIB_Init(); GRRLIB_Init();
WPAD_Init(); WPAD_Init();
@ -35,99 +35,99 @@ int cubeZ=0;
GRRLIB_camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0); GRRLIB_camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0);
while(1) { while(1) {
GRRLIB_2dMode(); GRRLIB_2dMode();
WPAD_ScanPads(); WPAD_ScanPads();
if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0); if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0);
if(WPAD_ButtonsHeld(0) & WPAD_BUTTON_A) cubeZ++; if(WPAD_ButtonsHeld(0) & WPAD_BUTTON_A) cubeZ++;
if(WPAD_ButtonsHeld(0) & WPAD_BUTTON_B) cubeZ--; if(WPAD_ButtonsHeld(0) & WPAD_BUTTON_B) cubeZ--;
GRRLIB_3dMode(0.1,1000,45,1); GRRLIB_3dMode(0.1,1000,45,1);
GRRLIB_setTexture(tex_girl,0); GRRLIB_setTexture(tex_girl,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_Begin(GX_QUADS, GX_VTXFMT0, 24);
GX_Position3f32(-1.0f,1.0f,1.0f); GX_Position3f32(-1.0f,1.0f,1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_TexCoord2f32(0.0f,0.0f); GX_TexCoord2f32(0.0f,0.0f);
GX_Position3f32(1.0f,1.0f,1.0f); GX_Position3f32(1.0f,1.0f,1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_TexCoord2f32(1.0f,0.0f); GX_TexCoord2f32(1.0f,0.0f);
GX_Position3f32(1.0f,-1.0f,1.0f); GX_Position3f32(1.0f,-1.0f,1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_TexCoord2f32(1.0f,1.0f); GX_TexCoord2f32(1.0f,1.0f);
GX_Position3f32(-1.0f,-1.0f,1.0f); GX_Position3f32(-1.0f,-1.0f,1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_TexCoord2f32(0.0f,1.0f); GX_TexCoord2f32(0.0f,1.0f);
GX_Position3f32(1.0f,1.0f,-1.0f); GX_Position3f32(1.0f,1.0f,-1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_TexCoord2f32(0.0f,0.0f); GX_TexCoord2f32(0.0f,0.0f);
GX_Position3f32(-1.0f,1.0f,-1.0f); GX_Position3f32(-1.0f,1.0f,-1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_TexCoord2f32(1.0f,0.0f); GX_TexCoord2f32(1.0f,0.0f);
GX_Position3f32(-1.0f,-1.0f,-1.0f); GX_Position3f32(-1.0f,-1.0f,-1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_TexCoord2f32(1.0f,1.0f); GX_TexCoord2f32(1.0f,1.0f);
GX_Position3f32(1.0f,-1.0f,-1.0f); GX_Position3f32(1.0f,-1.0f,-1.0f);
GX_Color1u32(col[0]); GX_Color1u32(col[0]);
GX_TexCoord2f32(0.0f,1.0f); GX_TexCoord2f32(0.0f,1.0f);
GX_Position3f32(1.0f,1.0f,1.0f); GX_Position3f32(1.0f,1.0f,1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_TexCoord2f32(0.0f,0.0f); GX_TexCoord2f32(0.0f,0.0f);
GX_Position3f32(1.0f,1.0f,-1.0f); GX_Position3f32(1.0f,1.0f,-1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_TexCoord2f32(1.0f,0.0f); GX_TexCoord2f32(1.0f,0.0f);
GX_Position3f32(1.0f,-1.0f,-1.0f); GX_Position3f32(1.0f,-1.0f,-1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_TexCoord2f32(1.0f,1.0f); GX_TexCoord2f32(1.0f,1.0f);
GX_Position3f32(1.0f,-1.0f,1.0f); GX_Position3f32(1.0f,-1.0f,1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_TexCoord2f32(0.0f,1.0f); GX_TexCoord2f32(0.0f,1.0f);
GX_Position3f32(-1.0f,1.0f,-1.0f); GX_Position3f32(-1.0f,1.0f,-1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_TexCoord2f32(0.0f,0.0f); GX_TexCoord2f32(0.0f,0.0f);
GX_Position3f32(-1.0f,1.0f,1.0f); GX_Position3f32(-1.0f,1.0f,1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_TexCoord2f32(1.0f,0.0f); GX_TexCoord2f32(1.0f,0.0f);
GX_Position3f32(-1.0f,-1.0f,1.0f); GX_Position3f32(-1.0f,-1.0f,1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_TexCoord2f32(1.0f,1.0f); GX_TexCoord2f32(1.0f,1.0f);
GX_Position3f32(-1.0f,-1.0f,-1.0f); GX_Position3f32(-1.0f,-1.0f,-1.0f);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_TexCoord2f32(0.0f,1.0f); GX_TexCoord2f32(0.0f,1.0f);
GX_Position3f32(-1.0f,1.0f,-1.0f); GX_Position3f32(-1.0f,1.0f,-1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_TexCoord2f32(0.0f,0.0f); GX_TexCoord2f32(0.0f,0.0f);
GX_Position3f32(1.0f,1.0f,-1.0f); GX_Position3f32(1.0f,1.0f,-1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_TexCoord2f32(1.0f,0.0f); GX_TexCoord2f32(1.0f,0.0f);
GX_Position3f32(1.0f,1.0f,1.0f); GX_Position3f32(1.0f,1.0f,1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_TexCoord2f32(1.0f,1.0f); GX_TexCoord2f32(1.0f,1.0f);
GX_Position3f32(-1.0f,1.0f,1.0f); GX_Position3f32(-1.0f,1.0f,1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_TexCoord2f32(0.0f,1.0f); GX_TexCoord2f32(0.0f,1.0f);
GX_Position3f32(1.0f,-1.0f,-1.0f); GX_Position3f32(1.0f,-1.0f,-1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_TexCoord2f32(0.0f,0.0f); GX_TexCoord2f32(0.0f,0.0f);
GX_Position3f32(-1.0f,-1.0f,-1.0f); GX_Position3f32(-1.0f,-1.0f,-1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_TexCoord2f32(1.0f,0.0f); GX_TexCoord2f32(1.0f,0.0f);
GX_Position3f32(-1.0f,-1.0f,1.0f); GX_Position3f32(-1.0f,-1.0f,1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_TexCoord2f32(1.0f,1.0f); GX_TexCoord2f32(1.0f,1.0f);
GX_Position3f32(1.0f,-1.0f,1.0f); GX_Position3f32(1.0f,-1.0f,1.0f);
GX_Color1u32(col[2]); GX_Color1u32(col[2]);
GX_TexCoord2f32(0.0f,1.0f); GX_TexCoord2f32(0.0f,1.0f);
GX_End(); GX_End();
a+=0.5f; a+=0.5f;
// Switch To 2D Mode to display text // Switch To 2D Mode to display text
GRRLIB_2dMode(); GRRLIB_2dMode();
GRRLIB_Printf((640-(16*29))/2, 20, tex_font, 0xFFFFFFFF, 1, "PRESS A OR B TO ZOOM THE CUBE"); GRRLIB_Printf((640-(16*29))/2, 20, tex_font, 0xFFFFFFFF, 1, "PRESS A OR B TO ZOOM THE CUBE");
GRRLIB_Render(); GRRLIB_Render();
} }

View file

@ -15,7 +15,7 @@ extern GXRModeObj *rmode;
int main() { int main() {
float rot=0; float rot=0;
float i=0; float i;
int circsize=150; int circsize=150;
GRRLIB_Init(); GRRLIB_Init();