The clear alpha is now the one selected by the game.

Removed the stencil blitting stuff, as it doesn't take care of whether the rear-plane is opaque or not (I left it commented if you've a good reason for re-enabling it).
This commit is contained in:
luigi__ 2008-12-30 12:39:20 +00:00
parent 879586c4fa
commit d1502f5bee
1 changed files with 12 additions and 11 deletions

View File

@ -74,7 +74,7 @@ static void ENDGL() {
#endif
static ALIGN(16) unsigned char GPU_screen3D [256*256*4];
static ALIGN(16) unsigned char GPU_screenStencil[256*256];
//static ALIGN(16) unsigned char GPU_screenStencil[256*256];
static const unsigned short map3d_cull[4] = {GL_FRONT_AND_BACK, GL_FRONT, GL_BACK, 0};
static const int texEnv[4] = { GL_MODULATE, GL_DECAL, GL_MODULATE, GL_MODULATE };
@ -367,7 +367,7 @@ static void OGLReset()
texcache_stop=MAX_TEXTURE<<1;
//clear the framebuffers
memset(GPU_screenStencil,0,sizeof(GPU_screenStencil));
// memset(GPU_screenStencil,0,sizeof(GPU_screenStencil));
memset(GPU_screen3D,0,sizeof(GPU_screen3D));
}
@ -1037,7 +1037,7 @@ static void OGLRender()
//printf("%d\n",gfx3d.projlist->count);
//we're not using the alpha clear color right now
glClearColor(gfx3d.clearColor[0],gfx3d.clearColor[1],gfx3d.clearColor[2], clearAlpha);
glClearColor(gfx3d.clearColor[0],gfx3d.clearColor[1],gfx3d.clearColor[2], gfx3d.clearColor[3]);
glClearDepth(gfx3d.clearDepth);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
@ -1118,7 +1118,7 @@ static void GL_ReadFramebuffer()
{
if(!BEGINGL()) return;
glFinish();
glReadPixels(0,0,256,192,GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, GPU_screenStencil);
// glReadPixels(0,0,256,192,GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, GPU_screenStencil);
glReadPixels(0,0,256,192,GL_BGRA_EXT, GL_UNSIGNED_BYTE, GPU_screen3D);
ENDGL();
@ -1160,25 +1160,26 @@ static void OGLGetLineCaptured(int line, u16* dst)
}
u8 *screen3D = (u8*)GPU_screen3D+((191-line)<<10);
u8 *screenStencil = (u8*)GPU_screenStencil+((191-line)<<8);
// u8 *screenStencil = (u8*)GPU_screenStencil+((191-line)<<8);
for(int i = 0; i < 256; i++)
{
u32 stencil = screenStencil[i];
/* u32 stencil = screenStencil[i];
if(!stencil)
{
dst[i] = 0x0000;
continue;
}
}*/
int t=i<<2;
u32 r = screen3D[t+2];
u32 g = screen3D[t+1];
u32 b = screen3D[t+0];
/* u8 r = screen3D[t+2];
u8 g = screen3D[t+1];
u8 b = screen3D[t+0];*/
//if this math strikes you as wrong, be sure to look at GL_ReadFramebuffer() where the pixel format in screen3D is changed
dst[i] = (b<<10) | (g<<5) | (r) | 0x8000;
//dst[i] = (b<<10) | (g<<5) | (r) | 0x8000;
dst[i] = (screen3D[t+2] | (screen3D[t+1] << 5) | (screen3D[t+0] << 10) | ((screen3D[t+3] > 0) ? 0x8000 : 0x0000));
}
}