From 54a20ad5ca22f1e96cb0614d72034bdfee53c049 Mon Sep 17 00:00:00 2001 From: N0NameN0 Date: Sun, 8 Nov 2009 16:54:14 +0000 Subject: [PATCH] [CHG] Modded Screen2Texture to be able to specify parameters with this change you can make real GX compositing now ;) --- GRRLIB/GRRLIB/GRRLIB_snapshot.c | 11 +++++++---- GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h | 5 ++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/GRRLIB/GRRLIB/GRRLIB_snapshot.c b/GRRLIB/GRRLIB/GRRLIB_snapshot.c index cfc6a02..74996df 100644 --- a/GRRLIB/GRRLIB/GRRLIB_snapshot.c +++ b/GRRLIB/GRRLIB/GRRLIB_snapshot.c @@ -24,13 +24,16 @@ THE SOFTWARE. /** * Make a snapshot of the screen in a texture. + * @param posx 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 clear, want that GX clear the grabbed part ? */ -void GRRLIB_Screen2Texture (GRRLIB_texImg *tex) { +void GRRLIB_Screen2Texture (int posx, int posy, GRRLIB_texImg *tex, bool clear) { if(tex->data != NULL) { - GX_SetTexCopySrc(0, 0, rmode->fbWidth, rmode->efbHeight); - GX_SetTexCopyDst(rmode->fbWidth, rmode->efbHeight, GX_TF_RGBA8, GX_FALSE); - GX_CopyTex(tex->data, GX_FALSE); + GX_SetTexCopySrc(posx, posy, tex->w, tex->h); + GX_SetTexCopyDst(tex->w, tex->h, GX_TF_RGBA8, GX_FALSE); + GX_CopyTex(tex->data, clear); GX_PixModeSync(); GRRLIB_FlushTex(tex); } diff --git a/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h b/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h index 4cf108d..bf74b6c 100644 --- a/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h +++ b/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h @@ -121,9 +121,8 @@ void GRRLIB_DrawTileQuad (const guVector pos[4], GRRLIB_texImg *tex, void GRRLIB_Render (void) ; //------------------------------------------------------------------------------ -// GRRLIB_snapshot.c - Create a texture containing a snapshot of the framebuffer -void GRRLIB_Screen2Texture (GRRLIB_texImg *tex) ; - +// GRRLIB_snapshot.c - Create a texture containing a snapshot of a part of the framebuffer +void GRRLIB_Screen2Texture (int posx, int posy, GRRLIB_texImg *tex, bool clear) ; //------------------------------------------------------------------------------ // GRRLIB_texEdit.c - Modifying the content of a texture