[PATCH] Upload the whole surface to the framebuffer when LockedRect isn't set because not in all cases flush_to_framebuffer_drawpixels is called because of locking. This fixes GL_INVALID_OPERATION lines in Red Alert and other apps.
Roderick Colenbrander
thunderbird2k at gmx.net
Tue Feb 19 14:18:26 CST 2008
---
dlls/wined3d/surface.c | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ca3dea4..e41b11f 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1163,11 +1163,19 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm
checkGLcall("glBindBufferARB");
}
- glDrawPixels(This->lockedRect.right - This->lockedRect.left,
- (This->lockedRect.bottom - This->lockedRect.top)-1,
- fmt, type,
- mem + bpp * This->lockedRect.left + pitch * This->lockedRect.top);
- checkGLcall("glDrawPixels");
+ /* When the surface is locked we only have to refresh the locked part else we need to update the whole image */
+ if(This->Flags & SFLAG_LOCKED) {
+ glDrawPixels(This->lockedRect.right - This->lockedRect.left,
+ (This->lockedRect.bottom - This->lockedRect.top)-1,
+ fmt, type,
+ mem + bpp * This->lockedRect.left + pitch * This->lockedRect.top);
+ checkGLcall("glDrawPixels");
+ } else {
+ glDrawPixels(This->currentDesc.Width,
+ This->currentDesc.Height,
+ fmt, type, mem);
+ checkGLcall("glDrawPixels");
+ }
if(This->Flags & SFLAG_PBO) {
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
@@ -2023,7 +2031,7 @@ static void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4]
table[i][1] = device->palettes[device->currentPalette][i].peGreen;
table[i][2] = device->palettes[device->currentPalette][i].peBlue;
- if(dxVersion >= 8) {
+ if(0 && dxVersion >= 8) {
/* Direct3D >= 8 palette usage style: P8 textures use device palettes, palette entry format is A8R8G8B8,
alpha is stored in peFlags and may be used by the app if D3DPTEXTURECAPS_ALPHAPALETTE device
capability flag is present (wine does advertise this capability) */
--
1.5.3.4
--========GMX285281203452784431095--
More information about the wine-patches
mailing list