mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-11-10 10:22:20 +00:00
[BUG] Examples have been updated to work with latest version of GRRLIB
This commit is contained in:
parent
fff851b34b
commit
3319a09ccb
5 changed files with 18 additions and 18 deletions
|
@ -20,7 +20,7 @@ LIBS += -lbte -logc
|
||||||
LIBS += -lm
|
LIBS += -lm
|
||||||
|
|
||||||
BINDIR := $(DEVKITPPC)/bin
|
BINDIR := $(DEVKITPPC)/bin
|
||||||
PREFIX := $(BINDIR)/powerpc-gekko-
|
PREFIX := $(BINDIR)/powerpc-eabi-
|
||||||
CC := $(PREFIX)gcc
|
CC := $(PREFIX)gcc
|
||||||
CXX := $(PREFIX)g++
|
CXX := $(PREFIX)g++
|
||||||
AR := $(PREFIX)ar
|
AR := $(PREFIX)ar
|
||||||
|
|
|
@ -60,7 +60,7 @@ int main() {
|
||||||
|
|
||||||
ir_t ir1;
|
ir_t ir1;
|
||||||
u32 wpaddown, wpadheld;
|
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};
|
u32 trianglecolor[] = {GRRLIB_GREEN, GRRLIB_RED, GRRLIB_BLUE};
|
||||||
|
|
||||||
GRRLIB_Init();
|
GRRLIB_Init();
|
||||||
|
|
|
@ -17,13 +17,13 @@
|
||||||
int main() {
|
int main() {
|
||||||
u32 wpaddown;
|
u32 wpaddown;
|
||||||
|
|
||||||
Vector ln[4];
|
guVector ln[4];
|
||||||
Vector d[4];
|
guVector d[4];
|
||||||
float xt,yt,zt;
|
float xt ,yt, zt;
|
||||||
int i;
|
int i;
|
||||||
float a=0.0,b=0.0;
|
float a=0.0, b=0.0;
|
||||||
float c=2;
|
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();
|
GRRLIB_Init();
|
||||||
WPAD_Init();
|
WPAD_Init();
|
||||||
|
|
|
@ -54,17 +54,17 @@ void GRRLIB_addon_Exit(){
|
||||||
* @param toto Text on the button.
|
* @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[]){
|
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;
|
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}};
|
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'))){
|
if((toto[0]=='^') && ((toto[1]=='U') || (toto[1]=='D') || (toto[1]=='L') || (toto[1]=='R'))){
|
||||||
butwidth=1*16+8;
|
butwidth = 1*16+8;
|
||||||
bg[1].x=x+4+1*16;
|
bg[1].x = x+4+1*16;
|
||||||
bg[2].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_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(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);
|
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;
|
*resheld=indice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
if((toto[0]=='^') && (toto[1]=='U')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFF77, 1, "%c", 0xa1);
|
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]=='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);
|
else if((toto[0]=='^') && (toto[1]=='L')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFF77, 1, "%c", 0xa3);
|
||||||
|
|
|
@ -19,7 +19,7 @@ int main() {
|
||||||
ir_t ir1;
|
ir_t ir1;
|
||||||
int wpadx=0, wpady=0;
|
int wpadx=0, wpady=0;
|
||||||
|
|
||||||
int resdown=0,resheld=0;
|
int resdown=0, resheld=0;
|
||||||
|
|
||||||
|
|
||||||
GRRLIB_Init();
|
GRRLIB_Init();
|
||||||
|
@ -36,8 +36,8 @@ int main() {
|
||||||
WPADDown = WPAD_ButtonsDown(0);
|
WPADDown = WPAD_ButtonsDown(0);
|
||||||
WPADHeld = WPAD_ButtonsHeld(0);
|
WPADHeld = WPAD_ButtonsHeld(0);
|
||||||
WPAD_IR(WPAD_CHAN_0, &ir1);
|
WPAD_IR(WPAD_CHAN_0, &ir1);
|
||||||
wpadx=ir1.sx-200;
|
wpadx = ir1.sx-200;
|
||||||
wpady=ir1.sy-250;
|
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(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 ");
|
GRRLIB_addon_Button(2, 100,140,0xFF00FFFF, wpadx, wpady, WPADDown, WPADHeld, WPAD_BUTTON_A, &resdown, &resheld, " My Second Button ");
|
||||||
|
|
Loading…
Reference in a new issue