Felix Nawothnig : wined3d:
Allow np2 textures to be loaded for SFLAG_INDRAWABLE.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Apr 9 07:35:57 CDT 2007
Module: wine
Branch: master
Commit: c0782603d09807c6ca506948bb4a814a73430184
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c0782603d09807c6ca506948bb4a814a73430184
Author: Felix Nawothnig <flexo at holycrap.org>
Date: Sat Apr 7 23:37:41 2007 +0200
wined3d: Allow np2 textures to be loaded for SFLAG_INDRAWABLE.
---
dlls/wined3d/surface.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 1684d1a..af90b61 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1825,6 +1825,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
return WINED3DERR_INVALIDCALL;
}
+ d3dfmt_get_conv(This, TRUE /* We need color keying */, TRUE /* We will use textures */, &format, &internal, &type, &convert, &bpp);
+
if (This->Flags & SFLAG_INDRAWABLE) {
if (This->glDescription.level != 0)
FIXME("Surface in texture is only supported for level 0\n");
@@ -1842,16 +1844,16 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
glReadBuffer(This->resource.wineD3DDevice->offscreenBuffer);
vcheckGLcall("glReadBuffer");
- glCopyTexImage2D(This->glDescription.target,
- This->glDescription.level,
- This->glDescription.glFormatInternal,
- 0,
- 0,
- This->currentDesc.Width,
- This->currentDesc.Height,
- 0);
+ surface_allocate_surface(This, internal, This->pow2Width,
+ This->pow2Height, format, type);
+
+ glCopyTexSubImage2D(This->glDescription.target,
+ This->glDescription.level,
+ 0, 0, 0, 0,
+ This->currentDesc.Width,
+ This->currentDesc.Height);
+ checkGLcall("glCopyTexSubImage2D");
- checkGLcall("glCopyTexImage2D");
glReadBuffer(prevRead);
vcheckGLcall("glReadBuffer");
@@ -1869,8 +1871,6 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
}
else This->Flags &= ~SFLAG_GLCKEY;
- d3dfmt_get_conv(This, TRUE /* We need color keying */, TRUE /* We will use textures */, &format, &internal, &type, &convert, &bpp);
-
/* The width is in 'length' not in bytes */
width = This->currentDesc.Width;
pitch = IWineD3DSurface_GetPitch(iface);
More information about the wine-cvs
mailing list