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;
}
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);