[CHG] Cleanup examples

This commit is contained in:
Crayon2000 2009-12-15 22:32:21 +00:00
parent d2355216d2
commit bd928df11b
7 changed files with 203 additions and 217 deletions

View file

@ -17,7 +17,7 @@ include $(DEVKITPPC)/wii_rules
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
TARGET := $(notdir $(CURDIR)) TARGET := $(notdir $(CURDIR))
BUILD := build BUILD := build
SOURCES := source source/gfx GRRLIB_addon SOURCES := source source/gfx
DATA := data DATA := data
INCLUDES := INCLUDES :=

View file

@ -139,12 +139,7 @@ int i=0;
float sinnonameno=0, oldsinnonameno=0; float sinnonameno=0, oldsinnonameno=0;
float camZ=1400.0f; float camZ=1400.0f;
float a=0; float a=0;
u32 col[3]; u32 col[3] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
col[0]=0xFFFFFFFF;
col[1]=0xFFFFFFFF;
col[2]=0xFFFFFFFF;
GRRLIB_Init(); GRRLIB_Init();
GRRLIB_Settings.antialias = false; GRRLIB_Settings.antialias = false;
@ -160,7 +155,6 @@ u32 col[3];
GRRLIB_texImg *tex_screen = GRRLIB_CreateEmptyTexture(rmode->fbWidth, rmode->efbHeight); GRRLIB_texImg *tex_screen = GRRLIB_CreateEmptyTexture(rmode->fbWidth, rmode->efbHeight);
GRRLIB_setBackgroundColour(0x00, 0x00, 0x00, 0xFF); GRRLIB_setBackgroundColour(0x00, 0x00, 0x00, 0xFF);
while(1) { while(1) {
@ -223,8 +217,10 @@ u32 col[3];
} }
cptx+=dirx; cptx+=dirx;
if(dirx>0) bgx++; if(dirx>0)
if(dirx<0) bgx--; bgx++;
else if(dirx<0)
bgx--;
if((bgx>-1) || (bgx<-63)) if((bgx>-1) || (bgx<-63))
bgx=-32; bgx=-32;
@ -233,16 +229,17 @@ u32 col[3];
dirx=0; dirx=0;
startx--; startx--;
} }
else if(cptx==-32) {
if(cptx==-32){
cptx=0; cptx=0;
dirx=0; dirx=0;
startx++; startx++;
} }
cpty+=diry; cpty+=diry;
if(diry>0) bgy++; if(diry>0)
if(diry<0) bgy--; bgy++;
else if(diry<0)
bgy--;
if((bgy>-1) ||(bgy<-63)) if((bgy>-1) ||(bgy<-63))
bgy=-32; bgy=-32;
@ -251,7 +248,7 @@ u32 col[3];
diry=0; diry=0;
starty--; starty--;
} }
if(cpty==-32){ else if(cpty==-32) {
cpty=0; 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; diry=0;
@ -335,10 +332,10 @@ u32 col[3];
GX_Position3f32(-rmode->fbWidth/2,-rmode->efbHeight/2,-rmode->fbWidth/2); GX_Position3f32(-rmode->fbWidth/2,-rmode->efbHeight/2,-rmode->fbWidth/2);
GX_Color1u32(col[1]); GX_Color1u32(col[1]);
GX_TexCoord2f32(0.0f,1.0f); GX_TexCoord2f32(0.0f,1.0f);
GX_End();
a+=0.2f; a+=0.2f;
GRRLIB_Render(); GRRLIB_Render();
} }
@ -351,4 +348,3 @@ u32 col[3];
exit(0); exit(0);
} }

View file

@ -13,10 +13,7 @@
int main() { int main() {
float a=0; float a=0;
u32 col[3]; u32 col[3] = {0xFFFFFFFF, 0xAAAAAAFF, 0x666666FF};
col[0]=0xFFFFFFFF;
col[1]=0xAAAAAAFF;
col[2]=0x666666FF;
int cubeZ=0; int cubeZ=0;
GRRLIB_Init(); GRRLIB_Init();

View file

@ -15,10 +15,7 @@
int main() { int main() {
float a=0; float a=0;
u32 col[3]; u32 col[3] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
col[0]=0xFFFFFFFF;
col[1]=0xFFFFFFFF;
col[2]=0xFFFFFFFF;
int cubeZ=0; int cubeZ=0;
GRRLIB_Init(); GRRLIB_Init();
@ -138,4 +135,3 @@ int main() {
exit(0); exit(0);
} }

View file

@ -18,10 +18,7 @@ extern GXRModeObj *rmode;
int main() { int main() {
float a=0; float a=0;
u32 col[3]; u32 col[3] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
col[0]=0xFFFFFFFF;
col[1]=0xFFFFFFFF;
col[2]=0xFFFFFFFF;
int cubeZ=5; int cubeZ=5;
int i=0; int i=0;
float sinx=0, oldsinx=0; float sinx=0, oldsinx=0;

View file

@ -11,10 +11,6 @@
#include <wiiuse/wpad.h> #include <wiiuse/wpad.h>
#include "gfx/logo.h" #include "gfx/logo.h"
extern GXRModeObj *rmode;
extern Mtx _GRR_view;
int main() { int main() {
int i=0; int i=0;
@ -40,8 +36,10 @@ u32 col;
GRRLIB_objectView(0,0,-30, a,a*2,a*3); GRRLIB_objectView(0,0,-30, a,a*2,a*3);
GX_Begin(GX_TRIANGLES, GX_VTXFMT0, logoNbFace * 3); GX_Begin(GX_TRIANGLES, GX_VTXFMT0, logoNbFace * 3);
for(i=0; i<logoNbFace*3; i+=3) { for(i=0; i<logoNbFace*3; i+=3) {
if(i<=(246*3*2)) col=0xFFFFFFFF; if(i<=(246*3*2))
else col=0xAAAAAAFF; 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_Position3f32(logoPos[logoFac[i][0]-1].x,logoPos[logoFac[i][0]-1].y,logoPos[logoFac[i][0]-1].z);
GX_Color1u32(col); GX_Color1u32(col);

View file

@ -139,7 +139,7 @@ int main() {
GRRLIB_Init(); GRRLIB_Init();
GRRLIB_Settings.antialias = false; GRRLIB_Settings.antialias = false;
WPAD_Init(); WPAD_Init();
GRRLIB_ClipDrawing(0,0,640,480); GRRLIB_ClipDrawing(0,0,rmode->fbWidth,rmode->efbHeight);
GRRLIB_texImg *tex_tile1 = GRRLIB_LoadTexture(tile1); 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_texImg *tex_perso = GRRLIB_LoadTexture(perso);
@ -203,8 +203,10 @@ int main() {
} }
cptx+=dirx; cptx+=dirx;
if(dirx>0) bgx++; if(dirx>0)
if(dirx<0) bgx--; bgx++;
else if(dirx<0)
bgx--;
if((bgx>-1) ||(bgx<-63)) if((bgx>-1) ||(bgx<-63))
bgx=-32; bgx=-32;