From 3319a09ccb27ebe56149f658f451b98f460ea347 Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Fri, 16 Oct 2009 21:24:17 +0000 Subject: [PATCH] [BUG] Examples have been updated to work with latest version of GRRLIB --- examples/composition/Makefile | 2 +- examples/lesson1/source/main.c | 2 +- examples/nonameno01/source/main.c | 10 +++++----- examples/nonameno03/GRRLIB_addon/GRRLIB_addon.c | 16 ++++++++-------- examples/nonameno03/source/main.c | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/composition/Makefile b/examples/composition/Makefile index 881a631..6ab3e80 100644 --- a/examples/composition/Makefile +++ b/examples/composition/Makefile @@ -20,7 +20,7 @@ LIBS += -lbte -logc LIBS += -lm BINDIR := $(DEVKITPPC)/bin -PREFIX := $(BINDIR)/powerpc-gekko- +PREFIX := $(BINDIR)/powerpc-eabi- CC := $(PREFIX)gcc CXX := $(PREFIX)g++ AR := $(PREFIX)ar diff --git a/examples/lesson1/source/main.c b/examples/lesson1/source/main.c index 61eacec..ecd5fae 100644 --- a/examples/lesson1/source/main.c +++ b/examples/lesson1/source/main.c @@ -60,7 +60,7 @@ int main() { ir_t ir1; u32 wpaddown, wpadheld; - Vector triangle[] = {{400,200,0.0f}, {500,400,0.0f}, {300,400,0.0f}}; + guVector triangle[] = {{400,200,0.0f}, {500,400,0.0f}, {300,400,0.0f}}; u32 trianglecolor[] = {GRRLIB_GREEN, GRRLIB_RED, GRRLIB_BLUE}; GRRLIB_Init(); diff --git a/examples/nonameno01/source/main.c b/examples/nonameno01/source/main.c index 3d70b81..8c82e0b 100644 --- a/examples/nonameno01/source/main.c +++ b/examples/nonameno01/source/main.c @@ -17,13 +17,13 @@ int main() { u32 wpaddown; - Vector ln[4]; - Vector d[4]; - float xt,yt,zt; + guVector ln[4]; + guVector d[4]; + float xt ,yt, zt; int i; - float a=0.0,b=0.0; + float a=0.0, b=0.0; float c=2; - Vector l[4]={{-0.8,-0.8,0},{0.8,-0.8,0},{0.8,0.8,0},{-0.8,0.8,0}}; + guVector l[4]={{-0.8,-0.8,0},{0.8,-0.8,0},{0.8,0.8,0},{-0.8,0.8,0}}; GRRLIB_Init(); WPAD_Init(); diff --git a/examples/nonameno03/GRRLIB_addon/GRRLIB_addon.c b/examples/nonameno03/GRRLIB_addon/GRRLIB_addon.c index 7e54472..c2c0fed 100644 --- a/examples/nonameno03/GRRLIB_addon/GRRLIB_addon.c +++ b/examples/nonameno03/GRRLIB_addon/GRRLIB_addon.c @@ -54,17 +54,17 @@ void GRRLIB_addon_Exit(){ * @param toto Text on the button. */ void GRRLIB_addon_Button(int indice, int x,int y,u32 col, int wpadx, int wpady, u32 WPADDown, u32 WPADHeld, int but, int *resdown, int *resheld, char toto[]){ - int butwidth=strlen(toto)*16+8; - Vector bg[]={{x+4,y,0},{x+4+strlen(toto)*16,y,0},{x+4+strlen(toto)*16,y+24,0},{x+4,y+24,0}}; + int butwidth = strlen(toto)*16+8; + guVector bg[] = {{x+4,y,0},{x+4+strlen(toto)*16,y,0},{x+4+strlen(toto)*16,y+24,0},{x+4,y+24,0}}; if((toto[0]=='^') && ((toto[1]=='U') || (toto[1]=='D') || (toto[1]=='L') || (toto[1]=='R'))){ - butwidth=1*16+8; - bg[1].x=x+4+1*16; - bg[2].x=x+4+1*16; + butwidth = 1*16+8; + bg[1].x = x+4+1*16; + bg[2].x = x+4+1*16; } - GRRLIB_DrawTile(x,y, tex_GRRLIBbutton , 0, 1, 1, col,0 ); + GRRLIB_DrawTile(x, y, tex_GRRLIBbutton , 0, 1, 1, col,0 ); GRRLIB_DrawTileQuad(bg, tex_GRRLIBbutton, col,1 ); - GRRLIB_DrawTile(bg[1].x,y, tex_GRRLIBbutton , 0, 1, 1, col,2); + GRRLIB_DrawTile(bg[1].x, y, tex_GRRLIBbutton , 0, 1, 1, col,2); if(GRRLIB_PtInRect(x, y, butwidth, 24, wpadx, wpady)) { if((toto[0]=='^') && (toto[1]=='U')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFFFF, 1, "%c", 0xa1); @@ -79,7 +79,7 @@ void GRRLIB_addon_Button(int indice, int x,int y,u32 col, int wpadx, int wpady, *resheld=indice; } } - else{ + else { if((toto[0]=='^') && (toto[1]=='U')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFF77, 1, "%c", 0xa1); else if((toto[0]=='^') && (toto[1]=='D')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFF77, 1, "%c", 0xa2); else if((toto[0]=='^') && (toto[1]=='L')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFF77, 1, "%c", 0xa3); diff --git a/examples/nonameno03/source/main.c b/examples/nonameno03/source/main.c index 4bf6fd8..29bcfa3 100644 --- a/examples/nonameno03/source/main.c +++ b/examples/nonameno03/source/main.c @@ -19,7 +19,7 @@ int main() { ir_t ir1; int wpadx=0, wpady=0; - int resdown=0,resheld=0; + int resdown=0, resheld=0; GRRLIB_Init(); @@ -36,8 +36,8 @@ int main() { WPADDown = WPAD_ButtonsDown(0); WPADHeld = WPAD_ButtonsHeld(0); WPAD_IR(WPAD_CHAN_0, &ir1); - wpadx=ir1.sx-200; - wpady=ir1.sy-250; + wpadx = ir1.sx-200; + wpady = ir1.sy-250; GRRLIB_addon_Button(1, 100,100,0xFFFF00FF, wpadx, wpady, WPADDown, WPADHeld, WPAD_BUTTON_A, &resdown, &resheld, " My First Button "); GRRLIB_addon_Button(2, 100,140,0xFF00FFFF, wpadx, wpady, WPADDown, WPADHeld, WPAD_BUTTON_A, &resdown, &resheld, " My Second Button ");