wined3d: Correctly name a variable.
This commit is contained in:
parent
385a8da4e4
commit
67436f9dbd
|
@ -1796,7 +1796,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
|
|||
GLenum format, internal, type;
|
||||
CONVERT_TYPES convert;
|
||||
int bpp;
|
||||
int pitch;
|
||||
int width;
|
||||
BYTE *mem;
|
||||
|
||||
if (This->Flags & SFLAG_INTEXTURE) {
|
||||
|
@ -1879,21 +1879,21 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
|
|||
|
||||
d3dfmt_get_conv(This, TRUE /* We need color keying */, TRUE /* We will use textures */, &format, &internal, &type, &convert, &bpp);
|
||||
|
||||
/* The pitch is in 'length' not in bytes */
|
||||
/* The width is in 'length' not in bytes */
|
||||
if (NP2_REPACK == wined3d_settings.nonpower2_mode || This->resource.usage & WINED3DUSAGE_RENDERTARGET)
|
||||
pitch = This->currentDesc.Width;
|
||||
width = This->currentDesc.Width;
|
||||
else
|
||||
pitch = This->pow2Width;
|
||||
width = This->pow2Width;
|
||||
|
||||
if((convert != NO_CONVERSION) && This->resource.allocatedMemory) {
|
||||
int height = This->glRect.bottom - This->glRect.top;
|
||||
|
||||
mem = HeapAlloc(GetProcessHeap(), 0, pitch * height * bpp);
|
||||
mem = HeapAlloc(GetProcessHeap(), 0, width * height * bpp);
|
||||
if(!mem) {
|
||||
ERR("Out of memory %d, %d!\n", pitch, height);
|
||||
ERR("Out of memory %d, %d!\n", width, height);
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
d3dfmt_convert_surface(This->resource.allocatedMemory, mem, pitch * height, convert, This);
|
||||
d3dfmt_convert_surface(This->resource.allocatedMemory, mem, width * height, convert, This);
|
||||
|
||||
This->Flags |= SFLAG_CONVERTED;
|
||||
} else if (This->resource.format == WINED3DFMT_P8 && GL_SUPPORT(EXT_PALETTED_TEXTURE)) {
|
||||
|
@ -1906,7 +1906,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
|
|||
}
|
||||
|
||||
/* Make sure the correct pitch is used */
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, pitch);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, width);
|
||||
|
||||
if (NP2_REPACK == wined3d_settings.nonpower2_mode && (This->Flags & SFLAG_NONPOW2) && !(This->Flags & SFLAG_OVERSIZE)) {
|
||||
TRACE("non power of two support\n");
|
||||
|
|
Loading…
Reference in New Issue