wined3d: Remove the X channel fixup in render target unlocking.

This commit is contained in:
Stefan Dösinger 2007-11-28 21:26:31 +01:00 committed by Alexandre Julliard
parent db24d3af9a
commit 94cd8c276a
1 changed files with 10 additions and 51 deletions

View File

@ -1002,64 +1002,23 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This) {
case WINED3DFMT_R5G6B5:
case WINED3DFMT_A1R5G5B5:
case WINED3DFMT_R8G8B8:
case WINED3DFMT_X4R4G4B4:
case WINED3DFMT_X1R5G5B5:
type = This->glDescription.glType;
fmt = This->glDescription.glFormat;
mem = This->resource.allocatedMemory;
bpp = This->bytesPerPixel;
break;
case WINED3DFMT_X4R4G4B4:
{
int size;
unsigned short *data;
data = (unsigned short *)This->resource.allocatedMemory;
size = (This->lockedRect.bottom - This->lockedRect.top) * (This->lockedRect.right - This->lockedRect.left);
while(size > 0) {
*data |= 0xF000;
data++;
size--;
}
type = This->glDescription.glType;
fmt = This->glDescription.glFormat;
mem = This->resource.allocatedMemory;
bpp = This->bytesPerPixel;
}
break;
case WINED3DFMT_X1R5G5B5:
{
int size;
unsigned short *data;
data = (unsigned short *)This->resource.allocatedMemory;
size = (This->lockedRect.bottom - This->lockedRect.top) * (This->lockedRect.right - This->lockedRect.left);
while(size > 0) {
*data |= 0x8000;
data++;
size--;
}
type = This->glDescription.glType;
fmt = This->glDescription.glFormat;
mem = This->resource.allocatedMemory;
bpp = This->bytesPerPixel;
}
break;
/* In the past times we used to set the X channel of X8R8G8B8 and the above formats to
* 1.0 because it happened to fix the intro movie in Pirates. However, this seems wrong.
* If the game uses an X8R8G8B8 back buffer the GL alpha channel should not make any differences,
* and the bug must be somewhere else. If we really have to set the alpha channel to 1.0 in
* this case do it by clearing it after the draw instead of fixing it up in the CPU. Blending
* is disabled via CTXUSAGE_BLIT context setup, so in the glDrawPixels call it does not
* have any effects
*/
case WINED3DFMT_X8R8G8B8:
{
/* make sure the X byte is set to alpha on, since it
could be any random value. This fixes the intro movie in Pirates! */
int size;
unsigned int *data;
data = (unsigned int *)This->resource.allocatedMemory;
size = (This->lockedRect.bottom - This->lockedRect.top) * (This->lockedRect.right - This->lockedRect.left);
while(size > 0) {
*data |= 0xFF000000;
data++;
size--;
}
}
/* Fall through */
case WINED3DFMT_A8R8G8B8:
{
glPixelStorei(GL_PACK_SWAP_BYTES, TRUE);