wined3d: Allow np2 textures to be loaded for SFLAG_INDRAWABLE.

This commit is contained in:
Felix Nawothnig 2007-04-07 23:37:41 +02:00 committed by Alexandre Julliard
parent 43155227d6
commit c0782603d0
1 changed files with 11 additions and 11 deletions

View File

@ -1825,6 +1825,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
return WINED3DERR_INVALIDCALL; 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->Flags & SFLAG_INDRAWABLE) {
if (This->glDescription.level != 0) if (This->glDescription.level != 0)
FIXME("Surface in texture is only supported for level 0\n"); 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); glReadBuffer(This->resource.wineD3DDevice->offscreenBuffer);
vcheckGLcall("glReadBuffer"); vcheckGLcall("glReadBuffer");
glCopyTexImage2D(This->glDescription.target, surface_allocate_surface(This, internal, This->pow2Width,
This->glDescription.level, This->pow2Height, format, type);
This->glDescription.glFormatInternal,
0, glCopyTexSubImage2D(This->glDescription.target,
0, This->glDescription.level,
This->currentDesc.Width, 0, 0, 0, 0,
This->currentDesc.Height, This->currentDesc.Width,
0); This->currentDesc.Height);
checkGLcall("glCopyTexSubImage2D");
checkGLcall("glCopyTexImage2D");
glReadBuffer(prevRead); glReadBuffer(prevRead);
vcheckGLcall("glReadBuffer"); vcheckGLcall("glReadBuffer");
@ -1869,8 +1871,6 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
} }
else This->Flags &= ~SFLAG_GLCKEY; 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 */ /* The width is in 'length' not in bytes */
width = This->currentDesc.Width; width = This->currentDesc.Width;
pitch = IWineD3DSurface_GetPitch(iface); pitch = IWineD3DSurface_GetPitch(iface);