Commit 94cd8c27 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

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

parent db24d3af
......@@ -1002,64 +1002,23 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This) {
case WINED3DFMT_R5G6B5:
case WINED3DFMT_A1R5G5B5:
case WINED3DFMT_R8G8B8:
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;
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment