for some reason memcpy won't work but GX_CopyTex does?

This commit is contained in:
dborth 2009-03-21 04:06:55 +00:00
parent bb2c829be2
commit 403d4cefc1

View File

@ -868,21 +868,24 @@ setGFX ()
*/ */
void TakeScreenshot() void TakeScreenshot()
{ {
int texSize = vmode->fbWidth * vmode->efbHeight * 4;
if(gameScreenTex) free(gameScreenTex); if(gameScreenTex) free(gameScreenTex);
gameScreenTex = (u8 *)memalign(32, vmode->fbWidth * vmode->efbHeight * 4); gameScreenTex = (u8 *)memalign(32, texSize);
if(gameScreenTex == NULL) return; if(gameScreenTex == NULL) return;
GX_SetTexCopySrc(0, 0, vmode->fbWidth, vmode->efbHeight); GX_SetTexCopySrc(0, 0, vmode->fbWidth, vmode->efbHeight);
GX_SetTexCopyDst(vmode->fbWidth, vmode->efbHeight, GX_TF_RGBA8, GX_FALSE); GX_SetTexCopyDst(vmode->fbWidth, vmode->efbHeight, GX_TF_RGBA8, GX_FALSE);
GX_CopyTex(gameScreenTex, GX_FALSE); GX_CopyTex(gameScreenTex, GX_FALSE);
GX_PixModeSync(); GX_PixModeSync();
DCFlushRange(gameScreenTex, vmode->fbWidth * vmode->efbHeight * 4); DCFlushRange(gameScreenTex, texSize);
#ifdef HW_RVL #ifdef HW_RVL
if(gameScreenTex2) free(gameScreenTex2); if(gameScreenTex2) free(gameScreenTex2);
gameScreenTex2 = (u8 *)memalign(32, vmode->fbWidth * vmode->efbHeight * 4); gameScreenTex2 = (u8 *)memalign(32, texSize);
if(gameScreenTex2 == NULL) return; if(gameScreenTex2 == NULL) return;
memcpy(gameScreenTex2, gameScreenTex, vmode->fbWidth * vmode->efbHeight * 4); GX_CopyTex(gameScreenTex2, GX_FALSE);
DCFlushRange(gameScreenTex2, vmode->fbWidth * vmode->efbHeight * 4); GX_PixModeSync();
DCFlushRange(gameScreenTex2, texSize);
#endif #endif
} }