[CHG] Cleanup

This commit is contained in:
Crayon2000 2009-11-26 22:46:24 +00:00
parent a3024c20b7
commit 740a81df7e
6 changed files with 119 additions and 121 deletions

View file

@ -40,20 +40,21 @@ void GRRLIB_Screen2Texture (int posx, int posy, GRRLIB_texImg *tex, bool clear)
} }
/** /**
* Start GX Compositing Process. * Start GX compositing process.
* @see GRRLIB_CompoEnd
*/ */
void GRRLIB_CompoStart (void){ void GRRLIB_CompoStart (void){
GX_SetPixelFmt(GX_PF_RGBA6_Z24,GX_ZC_LINEAR); GX_SetPixelFmt(GX_PF_RGBA6_Z24,GX_ZC_LINEAR);
GX_PokeAlphaRead(GX_READ_NONE); GX_PokeAlphaRead(GX_READ_NONE);
} }
/** /**
* End GX Compositing Process (Make a snapshot of the screen in a texture WITH ALPHA LAYER). * End GX compositing process (Make a snapshot of the screen in a texture WITH ALPHA LAYER).
* EFB is cleared after this function.
* @see GRRLIB_CompoStart
* @param posx top left corner of the grabbed part. * @param posx top left corner of the grabbed part.
* @param posy top left corner of the grabbed part. * @param posy top left corner of the grabbed part.
* @param tex A pointer to a texture representing the screen or NULL if an error occurs. * @param tex A pointer to a texture representing the screen or NULL if an error occurs.
* @info EFB is cleared after this function.
*/ */
void GRRLIB_CompoEnd(int posx, int posy, GRRLIB_texImg *tex){ void GRRLIB_CompoEnd(int posx, int posy, GRRLIB_texImg *tex){
GRRLIB_Screen2Texture(posx, posy, tex, FALSE); GRRLIB_Screen2Texture(posx, posy, tex, FALSE);
@ -65,5 +66,4 @@ void GRRLIB_CompoEnd(int posx, int posy, GRRLIB_texImg *tex){
if (rmode->aa) GX_SetPixelFmt(GX_PF_RGB565_Z16, GX_ZC_LINEAR) ; if (rmode->aa) GX_SetPixelFmt(GX_PF_RGB565_Z16, GX_ZC_LINEAR) ;
else GX_SetPixelFmt(GX_PF_RGB8_Z24 , GX_ZC_LINEAR) ; else GX_SetPixelFmt(GX_PF_RGB8_Z24 , GX_ZC_LINEAR) ;
} }

View file

@ -37,22 +37,20 @@ int main() {
WPAD_ScanPads(); WPAD_ScanPads();
if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0); if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0);
GRRLIB_CompoStart (); GRRLIB_CompoStart();
GRRLIB_SetAlpha(0xff); GRRLIB_SetAlpha(0xff);
for(i=0;i<360;i+=30){ for(i=0;i<360;i+=30) {
GRRLIB_Settings.rotation= i+rot; GRRLIB_Settings.rotation= i+rot;
GRRLIB_DrawTile((rmode->fbWidth/2)-(tex_font->tilew/2), (rmode->efbHeight/2)-(tex_font->tileh+circsize),tex_font,65-32+((int)i/45)); GRRLIB_DrawTile((rmode->fbWidth/2)-(tex_font->tilew/2), (rmode->efbHeight/2)-(tex_font->tileh+circsize), tex_font, 65-32+((int)i/45));
} }
GRRLIB_CompoEnd(0, 0, tex_screen); GRRLIB_CompoEnd(0, 0, tex_screen);
GRRLIB_Settings.rotation=0; GRRLIB_Settings.rotation=0;
rot-=0.6; rot-=0.6;
GRRLIB_SetAlpha(0xff);
GRRLIB_DrawImg(50, 50,tex_screen);
GRRLIB_SetAlpha(0xFF); GRRLIB_SetAlpha(0xFF);
GRRLIB_DrawImg(100, 100,tex_screen); GRRLIB_DrawImg(50, 50, tex_screen);
GRRLIB_DrawImg(100, 100, tex_screen);
GRRLIB_Render(); GRRLIB_Render();
} }