Module: wine
Branch: master
Commit: 85fd3130466835edad7b56d17d4b3b08f92626d5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=85fd3130466835edad7b56d17…
Author: Alexander Dorofeyev <alexd4(a)inbox.lv>
Date: Tue Mar 25 02:03:38 2008 +0200
wined3d: Don't use device palettes in read_from_framebuffer.
---
dlls/wined3d/surface.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 131de47..2c78f09 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -789,19 +789,24 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v
}
}
+ LEAVE_GL();
+
/* For P8 textures we need to perform an inverse palette lookup. This is done by searching for a palette
* index which matches the RGB value. Note this isn't guaranteed to work when there are multiple entries for
* the same color but we have no choice.
* In case of P8 render targets, the index is stored in the alpha component so no conversion is needed.
*/
if((This->resource.format == WINED3DFMT_P8) && !primary_render_target_is_p8(myDevice)) {
- PALETTEENTRY *pal;
+ PALETTEENTRY *pal = NULL;
DWORD width = pitch / 3;
int x, y, c;
+
if(This->palette) {
pal = This->palette->palents;
} else {
- pal = This->resource.wineD3DDevice->palettes[This->resource.wineD3DDevice->currentPalette];
+ ERR("Palette is missing, cannot perform inverse palette lookup\n");
+ HeapFree(GetProcessHeap(), 0, mem);
+ return ;
}
for(y = local_rect.top; y < local_rect.bottom; y++) {
@@ -824,7 +829,6 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v
}
HeapFree(GetProcessHeap(), 0, mem);
}
- LEAVE_GL();
}
/* Read the framebuffer contents into a texture */
Module: wine
Branch: master
Commit: 16da5943546afeec6c0498880b3a8ec39c979adc
URL: http://source.winehq.org/git/wine.git/?a=commit;h=16da5943546afeec6c0498880…
Author: Alexander Dorofeyev <alexd4(a)inbox.lv>
Date: Tue Mar 25 02:03:33 2008 +0200
wined3d: Fix comment.
---
dlls/wined3d/surface.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ed98a33..131de47 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2031,15 +2031,13 @@ static void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4]
return;
}
- /* Still no palette? Use the device's palette */
- /* can ddraw and d3d < 8 surfaces use device's palette (d3d >= 8 feature)? */
+ /* 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) */
for (i = 0; i < 256; i++) {
table[i][0] = device->palettes[device->currentPalette][i].peRed;
table[i][1] = device->palettes[device->currentPalette][i].peGreen;
table[i][2] = device->palettes[device->currentPalette][i].peBlue;
- /* 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) */
table[i][3] = device->palettes[device->currentPalette][i].peFlags;
}
} else {