From ea08d4aa84b022c5265fe772241a94478aef975e Mon Sep 17 00:00:00 2001 From: nitsuja Date: Mon, 3 Aug 2009 01:57:25 +0000 Subject: [PATCH] rasterizer: fix for everything blended being slightly transparent opengl: fix for everything blended being doubly opaque --- desmume/src/GPU.cpp | 3 ++- desmume/src/OGLRender.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index d43bfc4f8..f8f8f5f60 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -588,6 +588,7 @@ FORCEINLINE FASTCALL void GPU::_master_setFinal3dColor(int dstX, int srcX) int bg_under = bgPixels[dstX]; if(blend2[bg_under]) { + alpha++; if(alpha<32) { //if the layer underneath is a blend bottom layer, then 3d always alpha blends with it @@ -2054,7 +2055,7 @@ static void GPU_ligne_layer(NDS_Screen * screen, u16 l) for(int j=0;j<8;j++) gpu->blend2[j] = (gpu->BLDCNT & (0x100 << j))!=0; - // paint lower priorities fist + // paint lower priorities first // then higher priorities on top for(int prio=NB_PRIORITIES; prio > 0; ) { diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index 0efd98d41..0503b2bd2 100644 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -702,7 +702,7 @@ static void GL_ReadFramebuffer() u32screen3D &= 0x3F3F3F3F; const int t = i<<2; - const u8 a = GPU_screen3D[t+3]; + const u8 a = GPU_screen3D[t+3] >> 1; const u8 r = GPU_screen3D[t+2]; const u8 g = GPU_screen3D[t+1]; const u8 b = GPU_screen3D[t+0];