mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-12-22 18:39:18 +00:00
[CHG] Cleanup examples
This commit is contained in:
parent
d2355216d2
commit
bd928df11b
7 changed files with 203 additions and 217 deletions
|
@ -17,7 +17,7 @@ include $(DEVKITPPC)/wii_rules
|
|||
#---------------------------------------------------------------------------------
|
||||
TARGET := $(notdir $(CURDIR))
|
||||
BUILD := build
|
||||
SOURCES := source source/gfx GRRLIB_addon
|
||||
SOURCES := source source/gfx
|
||||
DATA := data
|
||||
INCLUDES :=
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*===========================================
|
||||
NoNameNo CubedTileDemo
|
||||
A sample code to show how to use Dynamic Texturing
|
||||
Have a look a TileDemo sources for diff ;)
|
||||
NoNameNo CubedTileDemo
|
||||
A sample code to show how to use Dynamic Texturing
|
||||
Have a look a TileDemo sources for diff ;)
|
||||
============================================*/
|
||||
#include <grrlib.h>
|
||||
|
||||
|
@ -129,158 +129,155 @@ signed int Map1Info[53][87] =
|
|||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
|
||||
|
||||
int main() {
|
||||
int startx=0,starty=0;
|
||||
int x=0,y=0;
|
||||
int dirx=0,diry=0;
|
||||
int cptx=0,cpty=0;
|
||||
int bgx=-32,bgy=-32;
|
||||
float idperso=0;
|
||||
int i=0;
|
||||
float sinnonameno=0, oldsinnonameno=0;
|
||||
float camZ=1400.0f;
|
||||
float a=0;
|
||||
u32 col[3];
|
||||
col[0]=0xFFFFFFFF;
|
||||
col[1]=0xFFFFFFFF;
|
||||
col[2]=0xFFFFFFFF;
|
||||
|
||||
|
||||
int startx=0, starty=0;
|
||||
int x=0, y=0;
|
||||
int dirx=0, diry=0;
|
||||
int cptx=0, cpty=0;
|
||||
int bgx=-32, bgy=-32;
|
||||
float idperso=0;
|
||||
int i=0;
|
||||
float sinnonameno=0, oldsinnonameno=0;
|
||||
float camZ=1400.0f;
|
||||
float a=0;
|
||||
u32 col[3] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
|
||||
|
||||
GRRLIB_Init();
|
||||
GRRLIB_Settings.antialias = false;
|
||||
WPAD_Init();
|
||||
GRRLIB_ClipDrawing(0,0,rmode->fbWidth,rmode->efbHeight);
|
||||
GRRLIB_texImg *tex_tile1 = GRRLIB_LoadTexture(tile1);
|
||||
GRRLIB_InitTileSet(tex_tile1, TileMap1Width, TileMap1Height, 0);
|
||||
GRRLIB_InitTileSet(tex_tile1, TileMap1Width, TileMap1Height, 0);
|
||||
GRRLIB_texImg *tex_perso = GRRLIB_LoadTexture(perso);
|
||||
GRRLIB_InitTileSet(tex_perso, 64, 64, 0);
|
||||
GRRLIB_InitTileSet(tex_perso, 64, 64, 0);
|
||||
GRRLIB_texImg *tex_bg = GRRLIB_LoadTexture(bg);
|
||||
GRRLIB_texImg *tex_nonameno = GRRLIB_LoadTexture(nonameno);
|
||||
GRRLIB_InitTileSet(tex_nonameno, 32, 32, 0);
|
||||
GRRLIB_InitTileSet(tex_nonameno, 32, 32, 0);
|
||||
|
||||
GRRLIB_texImg *tex_screen = GRRLIB_CreateEmptyTexture(rmode->fbWidth, rmode->efbHeight);
|
||||
|
||||
|
||||
GRRLIB_setBackgroundColour(0x00, 0x00, 0x00, 0xFF);
|
||||
|
||||
while(1){
|
||||
GRRLIB_2dMode();
|
||||
while(1) {
|
||||
GRRLIB_2dMode();
|
||||
WPAD_ScanPads();
|
||||
if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) break ;
|
||||
if (WPAD_ButtonsHeld(0) & WPAD_BUTTON_PLUS) camZ+=20.0f ;
|
||||
if (WPAD_ButtonsHeld(0) & WPAD_BUTTON_MINUS) camZ-=20.0f ;
|
||||
|
||||
if((dirx==0) && (diry==0)){
|
||||
if (WPAD_ButtonsHeld(0) & WPAD_BUTTON_LEFT){ diry=-4; idperso=15;}
|
||||
else if (WPAD_ButtonsHeld(0) & WPAD_BUTTON_RIGHT){ diry=4; idperso=15;}
|
||||
else if (WPAD_ButtonsHeld(0) & WPAD_BUTTON_DOWN){ dirx=-4 ; idperso=1;}
|
||||
else if (WPAD_ButtonsHeld(0) & WPAD_BUTTON_UP){ dirx=4 ; idperso=8;}
|
||||
if((dirx==0) && (diry==0)) {
|
||||
if (WPAD_ButtonsHeld(0) & WPAD_BUTTON_LEFT) { diry=-4; idperso=15;}
|
||||
else if (WPAD_ButtonsHeld(0) & WPAD_BUTTON_RIGHT) { diry=4; idperso=15;}
|
||||
else if (WPAD_ButtonsHeld(0) & WPAD_BUTTON_DOWN) { dirx=-4 ; idperso=1;}
|
||||
else if (WPAD_ButtonsHeld(0) & WPAD_BUTTON_UP) { dirx=4 ; idperso=8;}
|
||||
}
|
||||
|
||||
if((dirx==0) && (diry==0)){
|
||||
idperso=0;
|
||||
if((dirx==0) && (diry==0)) {
|
||||
idperso=0;
|
||||
}
|
||||
|
||||
if(((Map1Info[9+starty][10+startx]==1) || (Map1Info[9+starty][11+startx]==1)) || ((Map1Info[9+starty][10+startx]==43521) || (Map1Info[9+starty][11+startx]==43521))){
|
||||
}
|
||||
else{
|
||||
dirx=0;
|
||||
if(((Map1Info[9+starty][10+startx]==1) || (Map1Info[9+starty][11+startx]==1)) || ((Map1Info[9+starty][10+startx]==43521) || (Map1Info[9+starty][11+startx]==43521))) {
|
||||
}
|
||||
else{
|
||||
dirx=0;
|
||||
diry=-4;
|
||||
}
|
||||
}
|
||||
|
||||
if(dirx<0){
|
||||
if((Map1Info[7+starty][12+startx]==8) || (Map1Info[7+starty][12+startx]==2) || (Map1Info[8+starty][12+startx]==8) || (Map1Info[8+starty][12+startx]==2)){
|
||||
dirx=0;
|
||||
}
|
||||
else{
|
||||
idperso++;
|
||||
if(idperso>7)
|
||||
idperso=1;
|
||||
if(dirx<0) {
|
||||
if((Map1Info[7+starty][12+startx]==8) || (Map1Info[7+starty][12+startx]==2) || (Map1Info[8+starty][12+startx]==8) || (Map1Info[8+starty][12+startx]==2)) {
|
||||
dirx=0;
|
||||
}
|
||||
else {
|
||||
idperso++;
|
||||
if(idperso>7)
|
||||
idperso=1;
|
||||
}
|
||||
}
|
||||
|
||||
if(dirx>0){
|
||||
if((Map1Info[7+starty][9+startx]==8) || (Map1Info[7+starty][9+startx]==2) || (Map1Info[8+starty][9+startx]==8) || (Map1Info[8+starty][9+startx]==2)){
|
||||
dirx=0;
|
||||
if(dirx>0) {
|
||||
if((Map1Info[7+starty][9+startx]==8) || (Map1Info[7+starty][9+startx]==2) || (Map1Info[8+starty][9+startx]==8) || (Map1Info[8+starty][9+startx]==2)) {
|
||||
dirx=0;
|
||||
}
|
||||
else{
|
||||
idperso++;
|
||||
if(idperso>14)
|
||||
idperso=8;
|
||||
else {
|
||||
idperso++;
|
||||
if(idperso>14)
|
||||
idperso=8;
|
||||
}
|
||||
}
|
||||
|
||||
if(diry<0){
|
||||
if((Map1Info[9+starty][10+startx]==1) || (Map1Info[9+starty][11+startx]==1)){
|
||||
if(diry<0) {
|
||||
if((Map1Info[9+starty][10+startx]==1) || (Map1Info[9+starty][11+startx]==1)) {
|
||||
diry=0;
|
||||
}
|
||||
}
|
||||
|
||||
if(diry!=0){
|
||||
idperso++;
|
||||
if(diry!=0) {
|
||||
idperso++;
|
||||
if(idperso>22)
|
||||
idperso=16;
|
||||
}
|
||||
|
||||
cptx+=dirx;
|
||||
if(dirx>0) bgx++;
|
||||
if(dirx<0) bgx--;
|
||||
if((bgx>-1) ||(bgx<-63))
|
||||
if(dirx>0)
|
||||
bgx++;
|
||||
else if(dirx<0)
|
||||
bgx--;
|
||||
if((bgx>-1) || (bgx<-63))
|
||||
bgx=-32;
|
||||
|
||||
if(cptx==32){
|
||||
if(cptx==32) {
|
||||
cptx=0;
|
||||
dirx=0;
|
||||
startx--;
|
||||
}
|
||||
|
||||
if(cptx==-32){
|
||||
else if(cptx==-32) {
|
||||
cptx=0;
|
||||
dirx=0;
|
||||
startx++;
|
||||
}
|
||||
|
||||
cpty+=diry;
|
||||
if(diry>0) bgy++;
|
||||
if(diry<0) bgy--;
|
||||
if(diry>0)
|
||||
bgy++;
|
||||
else if(diry<0)
|
||||
bgy--;
|
||||
if((bgy>-1) ||(bgy<-63))
|
||||
bgy=-32;
|
||||
|
||||
if(cpty==32){
|
||||
if(cpty==32) {
|
||||
cpty=0;
|
||||
diry=0;
|
||||
starty--;
|
||||
}
|
||||
if(cpty==-32){
|
||||
else if(cpty==-32) {
|
||||
cpty=0;
|
||||
if(((Map1Info[9+starty][10+startx]==1) || (Map1Info[9+starty][11+startx]==1)) || ((Map1Info[9+starty][10+startx]==43521) || (Map1Info[9+starty][11+startx]==43521))){
|
||||
if(((Map1Info[9+starty][10+startx]==1) || (Map1Info[9+starty][11+startx]==1)) || ((Map1Info[9+starty][10+startx]==43521) || (Map1Info[9+starty][11+startx]==43521))) {
|
||||
diry=0;
|
||||
}
|
||||
starty++;
|
||||
}
|
||||
GRRLIB_DrawImg(bgx,bgy,tex_bg,0,1,1,0xFFFFFFFF);
|
||||
GRRLIB_DrawImg(bgx, bgy, tex_bg, 0, 1, 1, 0xFFFFFFFF);
|
||||
|
||||
for(y=0;y<=(17);y++){
|
||||
for(x=0;x<=(21);x++){
|
||||
if(Map1Data[y+starty][x+startx] != 0){
|
||||
GRRLIB_DrawTile(x*TileMap1Width+cptx-TileMap1Width,y*TileMap1Height+cpty-TileMap1Height,tex_tile1,0,1,1,0xFFFFFFFF,Map1Data[y+starty][x+startx]-1);
|
||||
}
|
||||
for(y=0;y<=(17);y++) {
|
||||
for(x=0;x<=(21);x++) {
|
||||
if(Map1Data[y+starty][x+startx] != 0) {
|
||||
GRRLIB_DrawTile(x*TileMap1Width+cptx-TileMap1Width,y*TileMap1Height+cpty-TileMap1Height,tex_tile1,0,1,1,0xFFFFFFFF,Map1Data[y+starty][x+startx]-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
GRRLIB_DrawTile(TileMap1Width*9,TileMap1Height*6,tex_perso,0,1,1,0xFFFFFFFF,(int)idperso);
|
||||
|
||||
oldsinnonameno=sinnonameno;
|
||||
for(i=0;i<8;i++){
|
||||
for(i=0; i<8; i++) {
|
||||
GRRLIB_DrawTile(TileMap1Width*(6+i),(TileMap1Height*10)+sin(sinnonameno)*64,tex_nonameno,0,1,1,0xFFFFFFFF,i);
|
||||
sinnonameno+=0.4F;
|
||||
}
|
||||
sinnonameno=oldsinnonameno+0.08F;
|
||||
|
||||
GRRLIB_Screen2Texture(0, 0, tex_screen, GX_TRUE);
|
||||
GRRLIB_Screen2Texture(0, 0, tex_screen, GX_TRUE);
|
||||
|
||||
|
||||
GRRLIB_camera3dSettings(0.0f,0.0f,camZ, 0,1,0, 0,0,0);
|
||||
GRRLIB_3dMode(0.1,3000,45,1);
|
||||
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);
|
||||
GX_Begin(GX_QUADS, GX_VTXFMT0, 16);
|
||||
|
@ -335,20 +332,19 @@ u32 col[3];
|
|||
GX_Position3f32(-rmode->fbWidth/2,-rmode->efbHeight/2,-rmode->fbWidth/2);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
GX_End();
|
||||
|
||||
a+=0.2f;
|
||||
|
||||
|
||||
GRRLIB_Render();
|
||||
}
|
||||
|
||||
GRRLIB_Exit();
|
||||
GRRLIB_Exit();
|
||||
GRRLIB_FreeTexture(tex_tile1);
|
||||
GRRLIB_FreeTexture(tex_perso);
|
||||
GRRLIB_FreeTexture(tex_bg);
|
||||
GRRLIB_FreeTexture(tex_nonameno);
|
||||
GRRLIB_FreeTexture(tex_screen);
|
||||
exit(0);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -13,10 +13,7 @@
|
|||
|
||||
int main() {
|
||||
float a=0;
|
||||
u32 col[3];
|
||||
col[0]=0xFFFFFFFF;
|
||||
col[1]=0xAAAAAAFF;
|
||||
col[2]=0x666666FF;
|
||||
u32 col[3] = {0xFFFFFFFF, 0xAAAAAAFF, 0x666666FF};
|
||||
int cubeZ=0;
|
||||
|
||||
GRRLIB_Init();
|
||||
|
|
|
@ -15,10 +15,7 @@
|
|||
|
||||
int main() {
|
||||
float a=0;
|
||||
u32 col[3];
|
||||
col[0]=0xFFFFFFFF;
|
||||
col[1]=0xFFFFFFFF;
|
||||
col[2]=0xFFFFFFFF;
|
||||
u32 col[3] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
|
||||
int cubeZ=0;
|
||||
|
||||
GRRLIB_Init();
|
||||
|
@ -138,4 +135,3 @@ int main() {
|
|||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,14 +17,11 @@
|
|||
extern GXRModeObj *rmode;
|
||||
|
||||
int main() {
|
||||
float a=0;
|
||||
u32 col[3];
|
||||
col[0]=0xFFFFFFFF;
|
||||
col[1]=0xFFFFFFFF;
|
||||
col[2]=0xFFFFFFFF;
|
||||
int cubeZ=5;
|
||||
int i=0;
|
||||
float sinx=0,oldsinx=0;
|
||||
float a=0;
|
||||
u32 col[3] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
|
||||
int cubeZ=5;
|
||||
int i=0;
|
||||
float sinx=0, oldsinx=0;
|
||||
|
||||
GRRLIB_Init();
|
||||
WPAD_Init();
|
||||
|
@ -44,107 +41,107 @@ float sinx=0,oldsinx=0;
|
|||
GRRLIB_camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0);
|
||||
|
||||
while(1) {
|
||||
GRRLIB_2dMode();
|
||||
GRRLIB_2dMode();
|
||||
WPAD_ScanPads();
|
||||
if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0);
|
||||
if(WPAD_ButtonsHeld(0) & WPAD_BUTTON_A) cubeZ++;
|
||||
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);
|
||||
GX_Begin(GX_QUADS, GX_VTXFMT0, 24);
|
||||
GX_Position3f32(-1.0f,1.0f,1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(0.0f,0.0f);
|
||||
GX_Position3f32(1.0f,1.0f,1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(1.0f,0.0f);
|
||||
GX_Position3f32(1.0f,-1.0f,1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(1.0f,1.0f);
|
||||
GX_Position3f32(-1.0f,-1.0f,1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
GRRLIB_3dMode(0.1,1000,45,1);
|
||||
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]);
|
||||
GX_TexCoord2f32(0.0f,0.0f);
|
||||
GX_Position3f32(1.0f,1.0f,1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(1.0f,0.0f);
|
||||
GX_Position3f32(1.0f,-1.0f,1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(1.0f,1.0f);
|
||||
GX_Position3f32(-1.0f,-1.0f,1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
|
||||
GX_Position3f32(1.0f,1.0f,-1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(0.0f,0.0f);
|
||||
GX_Position3f32(-1.0f,1.0f,-1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(1.0f,0.0f);
|
||||
GX_Position3f32(-1.0f,-1.0f,-1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(1.0f,1.0f);
|
||||
GX_Position3f32(1.0f,-1.0f,-1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
GX_Position3f32(1.0f,1.0f,-1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(0.0f,0.0f);
|
||||
GX_Position3f32(-1.0f,1.0f,-1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(1.0f,0.0f);
|
||||
GX_Position3f32(-1.0f,-1.0f,-1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(1.0f,1.0f);
|
||||
GX_Position3f32(1.0f,-1.0f,-1.0f);
|
||||
GX_Color1u32(col[0]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
|
||||
GX_Position3f32(1.0f,1.0f,1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(0.0f,0.0f);
|
||||
GX_Position3f32(1.0f,1.0f,-1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(1.0f,0.0f);
|
||||
GX_Position3f32(1.0f,-1.0f,-1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(1.0f,1.0f);
|
||||
GX_Position3f32(1.0f,-1.0f,1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
GX_Position3f32(1.0f,1.0f,1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(0.0f,0.0f);
|
||||
GX_Position3f32(1.0f,1.0f,-1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(1.0f,0.0f);
|
||||
GX_Position3f32(1.0f,-1.0f,-1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(1.0f,1.0f);
|
||||
GX_Position3f32(1.0f,-1.0f,1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
|
||||
GX_Position3f32(-1.0f,1.0f,-1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(0.0f,0.0f);
|
||||
GX_Position3f32(-1.0f,1.0f,1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(1.0f,0.0f);
|
||||
GX_Position3f32(-1.0f,-1.0f,1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(1.0f,1.0f);
|
||||
GX_Position3f32(-1.0f,-1.0f,-1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
GX_Position3f32(-1.0f,1.0f,-1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(0.0f,0.0f);
|
||||
GX_Position3f32(-1.0f,1.0f,1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(1.0f,0.0f);
|
||||
GX_Position3f32(-1.0f,-1.0f,1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(1.0f,1.0f);
|
||||
GX_Position3f32(-1.0f,-1.0f,-1.0f);
|
||||
GX_Color1u32(col[1]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
|
||||
GX_Position3f32(-1.0f,1.0f,-1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(0.0f,0.0f);
|
||||
GX_Position3f32(1.0f,1.0f,-1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(1.0f,0.0f);
|
||||
GX_Position3f32(1.0f,1.0f,1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(1.0f,1.0f);
|
||||
GX_Position3f32(-1.0f,1.0f,1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
GX_Position3f32(-1.0f,1.0f,-1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(0.0f,0.0f);
|
||||
GX_Position3f32(1.0f,1.0f,-1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(1.0f,0.0f);
|
||||
GX_Position3f32(1.0f,1.0f,1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(1.0f,1.0f);
|
||||
GX_Position3f32(-1.0f,1.0f,1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
|
||||
GX_Position3f32(1.0f,-1.0f,-1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(0.0f,0.0f);
|
||||
GX_Position3f32(-1.0f,-1.0f,-1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(1.0f,0.0f);
|
||||
GX_Position3f32(-1.0f,-1.0f,1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(1.0f,1.0f);
|
||||
GX_Position3f32(1.0f,-1.0f,1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
GX_End();
|
||||
GRRLIB_Screen2Texture(0,0,tex_screen,1);
|
||||
a+=0.5f;
|
||||
GX_Position3f32(1.0f,-1.0f,-1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(0.0f,0.0f);
|
||||
GX_Position3f32(-1.0f,-1.0f,-1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(1.0f,0.0f);
|
||||
GX_Position3f32(-1.0f,-1.0f,1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(1.0f,1.0f);
|
||||
GX_Position3f32(1.0f,-1.0f,1.0f);
|
||||
GX_Color1u32(col[2]);
|
||||
GX_TexCoord2f32(0.0f,1.0f);
|
||||
GX_End();
|
||||
GRRLIB_Screen2Texture(0,0,tex_screen,1);
|
||||
a+=0.5f;
|
||||
|
||||
// Switch To 2D Mode to display text
|
||||
GRRLIB_2dMode();
|
||||
oldsinx=sinx;
|
||||
for(i=0;i<rmode->efbHeight;i++){
|
||||
GRRLIB_DrawTile(0+sin(sinx)*60,i,tex_screen,0,1,1,0xFFFFFFFF,i);
|
||||
sinx+=0.02f;
|
||||
}
|
||||
sinx=oldsinx+0.02f;
|
||||
// Switch To 2D Mode to display text
|
||||
GRRLIB_2dMode();
|
||||
oldsinx=sinx;
|
||||
for(i=0; i<rmode->efbHeight; i++) {
|
||||
GRRLIB_DrawTile(0+sin(sinx)*60,i,tex_screen,0,1,1,0xFFFFFFFF,i);
|
||||
sinx+=0.02f;
|
||||
}
|
||||
sinx=oldsinx+0.02f;
|
||||
|
||||
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();
|
||||
}
|
||||
|
|
|
@ -11,15 +11,11 @@
|
|||
#include <wiiuse/wpad.h>
|
||||
|
||||
#include "gfx/logo.h"
|
||||
extern GXRModeObj *rmode;
|
||||
extern Mtx _GRR_view;
|
||||
|
||||
|
||||
|
||||
int main() {
|
||||
int i=0;
|
||||
float a=0;
|
||||
u32 col;
|
||||
int i=0;
|
||||
float a=0;
|
||||
u32 col;
|
||||
|
||||
GRRLIB_Init();
|
||||
WPAD_Init();
|
||||
|
@ -31,30 +27,32 @@ u32 col;
|
|||
GRRLIB_camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0);
|
||||
|
||||
while(1) {
|
||||
GRRLIB_2dMode();
|
||||
GRRLIB_2dMode();
|
||||
WPAD_ScanPads();
|
||||
if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0);
|
||||
|
||||
|
||||
GRRLIB_3dMode(0.1,1000,45,0);
|
||||
GRRLIB_objectView(0,0,-30, a,a*2,a*3);
|
||||
GX_Begin(GX_TRIANGLES, GX_VTXFMT0, logoNbFace * 3);
|
||||
for(i=0;i<logoNbFace*3;i+=3){
|
||||
if(i<=(246*3*2)) col=0xFFFFFFFF;
|
||||
else col=0xAAAAAAFF;
|
||||
|
||||
GX_Position3f32(logoPos[logoFac[i][0]-1].x,logoPos[logoFac[i][0]-1].y,logoPos[logoFac[i][0]-1].z);
|
||||
GX_Color1u32(col);
|
||||
|
||||
GX_Position3f32(logoPos[logoFac[i+1][0]-1].x,logoPos[logoFac[i+1][0]-1].y,logoPos[logoFac[i+1][0]-1].z);
|
||||
GX_Color1u32(col);
|
||||
|
||||
GX_Position3f32(logoPos[logoFac[i+2][0]-1].x,logoPos[logoFac[i+2][0]-1].y,logoPos[logoFac[i+2][0]-1].z);
|
||||
GX_Color1u32(col);
|
||||
}
|
||||
GRRLIB_3dMode(0.1,1000,45,0);
|
||||
GRRLIB_objectView(0,0,-30, a,a*2,a*3);
|
||||
GX_Begin(GX_TRIANGLES, GX_VTXFMT0, logoNbFace * 3);
|
||||
for(i=0; i<logoNbFace*3; i+=3) {
|
||||
if(i<=(246*3*2))
|
||||
col=0xFFFFFFFF;
|
||||
else
|
||||
col=0xAAAAAAFF;
|
||||
|
||||
GX_Position3f32(logoPos[logoFac[i][0]-1].x,logoPos[logoFac[i][0]-1].y,logoPos[logoFac[i][0]-1].z);
|
||||
GX_Color1u32(col);
|
||||
|
||||
GX_Position3f32(logoPos[logoFac[i+1][0]-1].x,logoPos[logoFac[i+1][0]-1].y,logoPos[logoFac[i+1][0]-1].z);
|
||||
GX_Color1u32(col);
|
||||
|
||||
GX_Position3f32(logoPos[logoFac[i+2][0]-1].x,logoPos[logoFac[i+2][0]-1].y,logoPos[logoFac[i+2][0]-1].z);
|
||||
GX_Color1u32(col);
|
||||
}
|
||||
GX_End();
|
||||
|
||||
a+=0.5f;
|
||||
a+=0.5f;
|
||||
GRRLIB_Render();
|
||||
}
|
||||
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
|
||||
|
|
|
@ -139,7 +139,7 @@ int main() {
|
|||
GRRLIB_Init();
|
||||
GRRLIB_Settings.antialias = false;
|
||||
WPAD_Init();
|
||||
GRRLIB_ClipDrawing(0,0,640,480);
|
||||
GRRLIB_ClipDrawing(0,0,rmode->fbWidth,rmode->efbHeight);
|
||||
GRRLIB_texImg *tex_tile1 = GRRLIB_LoadTexture(tile1);
|
||||
GRRLIB_InitTileSet(tex_tile1, TileMap1Width, TileMap1Height, 0);
|
||||
GRRLIB_texImg *tex_perso = GRRLIB_LoadTexture(perso);
|
||||
|
@ -197,14 +197,16 @@ int main() {
|
|||
}
|
||||
}
|
||||
if(diry!=0) {
|
||||
idperso++;
|
||||
idperso++;
|
||||
if(idperso>22)
|
||||
idperso=16;
|
||||
}
|
||||
|
||||
cptx+=dirx;
|
||||
if(dirx>0) bgx++;
|
||||
if(dirx<0) bgx--;
|
||||
if(dirx>0)
|
||||
bgx++;
|
||||
else if(dirx<0)
|
||||
bgx--;
|
||||
if((bgx>-1) ||(bgx<-63))
|
||||
bgx=-32;
|
||||
|
||||
|
|
Loading…
Reference in a new issue