2009-09-13 14:27:01 +00:00
|
|
|
/*===========================================
|
|
|
|
NoNameNo FAKE Unlimited Sprites rout ;)
|
|
|
|
Bugged since Screen2texture conversion
|
|
|
|
loose color precision.
|
|
|
|
============================================*/
|
|
|
|
#include <grrlib.h>
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
#include <wiiuse/wpad.h>
|
|
|
|
|
|
|
|
#include "gfx/ball.h"
|
|
|
|
|
|
|
|
extern GXRModeObj *rmode;
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
u32 WPADDown;
|
2009-11-23 19:50:36 +00:00
|
|
|
float sinx[4]={0,0,0,0}, siny[4]={0,0,0,0};
|
2009-09-13 14:27:01 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
|
|
GRRLIB_Init();
|
|
|
|
WPAD_Init();
|
|
|
|
|
|
|
|
|
|
|
|
GRRLIB_texImg *tex_screen[10];
|
2009-11-23 19:50:36 +00:00
|
|
|
for(i=0; i<10; i++) {
|
|
|
|
tex_screen[i] = GRRLIB_CreateEmptyTexture(rmode->fbWidth, rmode->efbHeight);
|
2009-09-13 14:27:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GRRLIB_texImg *tex_ball = GRRLIB_LoadTexture(ball);
|
|
|
|
|
|
|
|
while(1) {
|
|
|
|
WPAD_ScanPads();
|
|
|
|
WPADDown = WPAD_ButtonsDown(0);
|
|
|
|
|
2009-11-23 19:50:36 +00:00
|
|
|
for(i=0; i<10; i++) {
|
2009-11-25 19:38:04 +00:00
|
|
|
GRRLIB_DrawImg(0, 0, tex_screen[i]);
|
|
|
|
GRRLIB_DrawImg(((640-64)/2)+sin(sinx[0])*160+sin(sinx[1])*sin(sinx[2])*50,((480-64)/2)+sin(siny[0])*120+sin(siny[1])*sin(siny[2])*50, tex_ball);
|
2009-09-13 14:27:01 +00:00
|
|
|
sinx[0]+=0.02;sinx[1]+=0.03;sinx[2]+=0.05;siny[0]+=0.03;siny[1]+=0.01;siny[2]+=0.06;
|
2009-11-23 19:50:36 +00:00
|
|
|
GRRLIB_Screen2Texture(0, 0, tex_screen[i], false);
|
2009-09-13 14:27:01 +00:00
|
|
|
GRRLIB_Render();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(WPADDown & WPAD_BUTTON_HOME) {
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
|
|
|
|
return 0;
|
|
|
|
}
|