mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 06:30:37 +00:00
Make all newly created surfces dirty, so that they are loaded properly
the first time around. Replace some calls to cubetexture in basetexture to calls to basetexture. Check that the level isn't out of bounds in calls to texture.
This commit is contained in:
parent
7e3918d53e
commit
e8855c48d8
@ -31,23 +31,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
|||||||
******************************************* */
|
******************************************* */
|
||||||
HRESULT WINAPI IWineD3DBaseTextureImpl_QueryInterface(IWineD3DBaseTexture *iface, REFIID riid, LPVOID *ppobj)
|
HRESULT WINAPI IWineD3DBaseTextureImpl_QueryInterface(IWineD3DBaseTexture *iface, REFIID riid, LPVOID *ppobj)
|
||||||
{
|
{
|
||||||
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
||||||
TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj);
|
TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj);
|
||||||
/* FIXME: This needs to extend an IWineD3DBaseObject */
|
/* FIXME: This needs to extend an IWineD3DBaseObject */
|
||||||
if (IsEqualGUID(riid, &IID_IUnknown)
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||||
|| IsEqualGUID(riid, &IID_IWineD3DResource)
|
|| IsEqualGUID(riid, &IID_IWineD3DResource)
|
||||||
|| IsEqualGUID(riid, &IID_IWineD3DBaseTexture)) {
|
|| IsEqualGUID(riid, &IID_IWineD3DBaseTexture)) {
|
||||||
IUnknown_AddRef(iface);
|
IUnknown_AddRef(iface);
|
||||||
*ppobj = This;
|
*ppobj = This;
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG WINAPI IWineD3DBaseTextureImpl_AddRef(IWineD3DBaseTexture *iface) {
|
ULONG WINAPI IWineD3DBaseTextureImpl_AddRef(IWineD3DBaseTexture *iface) {
|
||||||
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
||||||
ULONG ref = InterlockedIncrement(&This->resource.ref);
|
ULONG ref = InterlockedIncrement(&This->resource.ref);
|
||||||
|
|
||||||
TRACE("(%p) : AddRef increasing from %ld\n", This,ref - 1);
|
TRACE("(%p) : AddRef increasing from %ld\n", This,ref - 1);
|
||||||
IUnknown_AddRef(This->resource.parent);
|
IUnknown_AddRef(This->resource.parent);
|
||||||
return ref;
|
return ref;
|
||||||
@ -67,7 +67,7 @@ ULONG WINAPI IWineD3DBaseTextureImpl_Release(IWineD3DBaseTexture *iface) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* class static */
|
/* class static */
|
||||||
void IWineD3DBaseTextureImpl_CleanUp(IWineD3DBaseTexture *iface){
|
void IWineD3DBaseTextureImpl_CleanUp(IWineD3DBaseTexture *iface) {
|
||||||
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
||||||
TRACE("(%p) : ", This);
|
TRACE("(%p) : ", This);
|
||||||
if (This->baseTexture.textureName != 0) {
|
if (This->baseTexture.textureName != 0) {
|
||||||
@ -126,35 +126,35 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_GetParent(IWineD3DBaseTexture *iface, IUn
|
|||||||
* so just pretend that they work unless something really needs a failure. */
|
* so just pretend that they work unless something really needs a failure. */
|
||||||
DWORD WINAPI IWineD3DBaseTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD LODNew) {
|
DWORD WINAPI IWineD3DBaseTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD LODNew) {
|
||||||
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
||||||
|
|
||||||
if (This->resource.pool != D3DPOOL_MANAGED) {
|
if (This->resource.pool != D3DPOOL_MANAGED) {
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(LODNew >= This->baseTexture.levels)
|
if(LODNew >= This->baseTexture.levels)
|
||||||
LODNew = This->baseTexture.levels - 1;
|
LODNew = This->baseTexture.levels - 1;
|
||||||
This->baseTexture.LOD = LODNew;
|
This->baseTexture.LOD = LODNew;
|
||||||
|
|
||||||
TRACE("(%p) : set bogus LOD to %d \n", This, This->baseTexture.LOD);
|
TRACE("(%p) : set bogus LOD to %d \n", This, This->baseTexture.LOD);
|
||||||
|
|
||||||
return This->baseTexture.LOD;
|
return This->baseTexture.LOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI IWineD3DBaseTextureImpl_GetLOD(IWineD3DBaseTexture *iface) {
|
DWORD WINAPI IWineD3DBaseTextureImpl_GetLOD(IWineD3DBaseTexture *iface) {
|
||||||
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
||||||
|
|
||||||
if (This->resource.pool != D3DPOOL_MANAGED) {
|
if (This->resource.pool != D3DPOOL_MANAGED) {
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("(%p) : returning %d \n", This, This->baseTexture.LOD);
|
TRACE("(%p) : returning %d \n", This, This->baseTexture.LOD);
|
||||||
|
|
||||||
return This->baseTexture.LOD;
|
return This->baseTexture.LOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI IWineD3DBaseTextureImpl_GetLevelCount(IWineD3DBaseTexture *iface) {
|
DWORD WINAPI IWineD3DBaseTextureImpl_GetLevelCount(IWineD3DBaseTexture *iface) {
|
||||||
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
||||||
TRACE("(%p) : returning %d\n", This, This->baseTexture.levels);
|
TRACE("(%p) : returning %d\n", This, This->baseTexture.levels);
|
||||||
return This->baseTexture.levels;
|
return This->baseTexture.levels;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ D3DTEXTUREFILTERTYPE WINAPI IWineD3DBaseTextureImpl_GetAutoGenFilterType(IWineD3
|
|||||||
|
|
||||||
void WINAPI IWineD3DBaseTextureImpl_GenerateMipSubLevels(IWineD3DBaseTexture *iface) {
|
void WINAPI IWineD3DBaseTextureImpl_GenerateMipSubLevels(IWineD3DBaseTexture *iface) {
|
||||||
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
||||||
/* TODO: implement filters using GL_SGI_generate_mipmaps http://oss.sgi.com/projects/ogl-sample/registry/SGIS/generate_mipmap.txt */
|
/* TODO: implement filters using GL_SGI_generate_mipmaps http://oss.sgi.com/projects/ogl-sample/registry/SGIS/generate_mipmap.txt */
|
||||||
FIXME("(%p) : stub\n", This);
|
FIXME("(%p) : stub\n", This);
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
@ -203,15 +203,15 @@ BOOL WINAPI IWineD3DBaseTextureImpl_GetDirty(IWineD3DBaseTexture *iface) {
|
|||||||
|
|
||||||
HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
|
HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
|
||||||
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
||||||
|
HRESULT hr = D3D_OK;
|
||||||
UINT textureDimensions;
|
UINT textureDimensions;
|
||||||
|
|
||||||
TRACE("(%p) : About to bind texture\n", This);
|
TRACE("(%p) : About to bind texture\n", This);
|
||||||
|
|
||||||
textureDimensions = IWineD3DCubeTexture_GetTextureDimensions(iface);
|
textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface);
|
||||||
ENTER_GL();
|
ENTER_GL();
|
||||||
#if 0 /* TODO: context manager support */
|
#if 0 /* TODO: context manager support */
|
||||||
IWineD3DContextManager_PushState(This->contextManager, textureDimensions, ENABLED, NOW /* make sure the state is applied now */);
|
IWineD3DContextManager_PushState(This->contextManager, textureDimensions, ENABLED, NOW /* make sure the state is applied now */);
|
||||||
#else
|
#else
|
||||||
glEnable(textureDimensions);
|
glEnable(textureDimensions);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -225,7 +225,8 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
|
|||||||
GLclampf tmp;
|
GLclampf tmp;
|
||||||
tmp = 0.9f;
|
tmp = 0.9f;
|
||||||
glPrioritizeTextures(1, &This->baseTexture.textureName, &tmp);
|
glPrioritizeTextures(1, &This->baseTexture.textureName, &tmp);
|
||||||
}
|
}
|
||||||
|
IWineD3DBaseTexture_SetDirty(iface, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Bind the texture */
|
/* Bind the texture */
|
||||||
@ -234,34 +235,37 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
|
|||||||
checkGLcall("glBindTexture");
|
checkGLcall("glBindTexture");
|
||||||
} else { /* this only happened if we've run out of openGL textures */
|
} else { /* this only happened if we've run out of openGL textures */
|
||||||
WARN("This texture doesn't have an openGL texture assigned to it\n");
|
WARN("This texture doesn't have an openGL texture assigned to it\n");
|
||||||
return D3DERR_INVALIDCALL;
|
hr = D3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Always need to reset the number of mipmap levels when rebinding as it is
|
if (hr == D3D_OK) {
|
||||||
a property of the active texture unit, and another texture may have set it
|
/* Always need to reset the number of mipmap levels when rebinding as it is
|
||||||
to a different value */
|
a property of the active texture unit, and another texture may have set it
|
||||||
TRACE("Setting GL_TEXTURE_MAX_LEVEL to %d\n", This->baseTexture.levels - 1);
|
to a different value */
|
||||||
glTexParameteri(textureDimensions, GL_TEXTURE_MAX_LEVEL, This->baseTexture.levels - 1);
|
TRACE("Setting GL_TEXTURE_MAX_LEVEL to %d\n", This->baseTexture.levels - 1);
|
||||||
checkGLcall("glTexParameteri(textureDimensions, GL_TEXTURE_MAX_LEVEL, This->baseTexture.levels)");
|
glTexParameteri(textureDimensions, GL_TEXTURE_MAX_LEVEL, This->baseTexture.levels - 1);
|
||||||
|
checkGLcall("glTexParameteri(textureDimensions, GL_TEXTURE_MAX_LEVEL, This->baseTexture.levels)");
|
||||||
return D3D_OK;
|
}
|
||||||
|
LEAVE_GL();
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI IWineD3DBaseTextureImpl_UnBindTexture(IWineD3DBaseTexture *iface) {
|
HRESULT WINAPI IWineD3DBaseTextureImpl_UnBindTexture(IWineD3DBaseTexture *iface) {
|
||||||
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
||||||
UINT textureDimensions;
|
UINT textureDimensions;
|
||||||
|
|
||||||
TRACE("(%p) : About to bind texture\n", This);
|
TRACE("(%p) : About to bind texture\n", This);
|
||||||
textureDimensions = IWineD3DCubeTexture_GetTextureDimensions(iface);
|
textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface);
|
||||||
|
|
||||||
ENTER_GL();
|
ENTER_GL();
|
||||||
|
|
||||||
glBindTexture(textureDimensions, 0);
|
glBindTexture(textureDimensions, 0);
|
||||||
#if 0 /* TODO: context manager support */
|
#if 0 /* TODO: context manager support */
|
||||||
IWineD3DContextManager_PopState(This->contextManager, GL_TEXTURE_CUBE_MAP_ARB, ENABLED, NOW /* make sure the state is applied now */);
|
IWineD3DContextManager_PopState(This->contextManager, textureDimensions, ENABLED, NOW /* make sure the state is applied now */);
|
||||||
#else
|
#else
|
||||||
glDisable(textureDimensions);
|
glDisable(textureDimensions);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LEAVE_GL();
|
LEAVE_GL();
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
@ -287,7 +291,6 @@ static const IWineD3DBaseTextureVtbl IWineD3DBaseTexture_Vtbl =
|
|||||||
IWineD3DBaseTextureImpl_GetPriority,
|
IWineD3DBaseTextureImpl_GetPriority,
|
||||||
IWineD3DBaseTextureImpl_PreLoad,
|
IWineD3DBaseTextureImpl_PreLoad,
|
||||||
IWineD3DBaseTextureImpl_GetType,
|
IWineD3DBaseTextureImpl_GetType,
|
||||||
|
|
||||||
/*IWineD3DBaseTexture*/
|
/*IWineD3DBaseTexture*/
|
||||||
IWineD3DBaseTextureImpl_SetLOD,
|
IWineD3DBaseTextureImpl_SetLOD,
|
||||||
IWineD3DBaseTextureImpl_GetLOD,
|
IWineD3DBaseTextureImpl_GetLOD,
|
||||||
|
@ -83,6 +83,7 @@ inline static Display *get_display( HDC hdc )
|
|||||||
_basetexture.levels = Levels; \
|
_basetexture.levels = Levels; \
|
||||||
_basetexture.filterType = (Usage & D3DUSAGE_AUTOGENMIPMAP) ? D3DTEXF_LINEAR : D3DTEXF_NONE; \
|
_basetexture.filterType = (Usage & D3DUSAGE_AUTOGENMIPMAP) ? D3DTEXF_LINEAR : D3DTEXF_NONE; \
|
||||||
_basetexture.LOD = 0; \
|
_basetexture.LOD = 0; \
|
||||||
|
_basetexture.dirty = TRUE; \
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************
|
/**********************************************************
|
||||||
@ -443,7 +444,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Wid
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(MultisampleQuality > 0){
|
if(MultisampleQuality > 0){
|
||||||
FIXME("MultisampleQuality set to %ld, bstituting 0 \n" , MultisampleQuality);
|
FIXME("MultisampleQuality set to %ld, substituting 0 \n" , MultisampleQuality);
|
||||||
MultisampleQuality=0;
|
MultisampleQuality=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -546,7 +547,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Wid
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IWineD3DSurface_CleanDirtyRect(*ppSurface);
|
IWineD3DSurface_AddDirtyRect(*ppSurface, NULL);
|
||||||
TRACE("(%p) : w(%d) h(%d) fmt(%d,%s) lockable(%d) surf@%p, surfmem@%p, %d bytes\n",
|
TRACE("(%p) : w(%d) h(%d) fmt(%d,%s) lockable(%d) surf@%p, surfmem@%p, %d bytes\n",
|
||||||
This, Width, Height, Format, debug_d3dformat(Format),
|
This, Width, Height, Format, debug_d3dformat(Format),
|
||||||
(WINED3DFMT_D16_LOCKABLE == Format), *ppSurface, object->resource.allocatedMemory, object->resource.size);
|
(WINED3DFMT_D16_LOCKABLE == Format), *ppSurface, object->resource.allocatedMemory, object->resource.size);
|
||||||
|
@ -67,8 +67,8 @@ ULONG WINAPI IWineD3DTextureImpl_Release(IWineD3DTexture *iface) {
|
|||||||
IUnknown_Release(surfaceParent);
|
IUnknown_Release(surfaceParent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IWineD3DBaseTextureImpl_CleanUp((IWineD3DBaseTexture *)iface);
|
IWineD3DBaseTextureImpl_CleanUp((IWineD3DBaseTexture *)iface);
|
||||||
IWineD3DDevice_Release((IWineD3DDevice *)This->resource.wineD3DDevice);
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
} else {
|
} else {
|
||||||
IUnknown_Release(This->resource.parent); /* Released the reference to the d3dx object */
|
IUnknown_Release(This->resource.parent); /* Released the reference to the d3dx object */
|
||||||
@ -104,20 +104,21 @@ DWORD WINAPI IWineD3DTextureImpl_GetPriority(IWineD3DTexture *iface) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WINAPI IWineD3DTextureImpl_PreLoad(IWineD3DTexture *iface) {
|
void WINAPI IWineD3DTextureImpl_PreLoad(IWineD3DTexture *iface) {
|
||||||
/* Override the IWineD3DResource Preload method */
|
|
||||||
|
/* Override the IWineD3DResource PreLoad method */
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
||||||
|
|
||||||
TRACE("(%p) : About to load texture\n", This);
|
TRACE("(%p) : About to load texture\n", This);
|
||||||
|
|
||||||
IWineD3DTexture_BindTexture(iface);
|
IWineD3DTexture_BindTexture(iface);
|
||||||
|
|
||||||
ENTER_GL();
|
ENTER_GL();
|
||||||
/* If were dirty then reload the surfaces */
|
/* If were dirty then reload the surfaces */
|
||||||
if(This->baseTexture.dirty != FALSE) {
|
if(This->baseTexture.dirty != FALSE) {
|
||||||
for (i = 0; i < This->baseTexture.levels; i++) {
|
for (i = 0; i < This->baseTexture.levels; i++) {
|
||||||
IWineD3DSurface_LoadTexture(This->surfaces[i], GL_TEXTURE_2D, i);
|
IWineD3DSurface_LoadTexture(This->surfaces[i], GL_TEXTURE_2D, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No longer dirty */
|
/* No longer dirty */
|
||||||
This->baseTexture.dirty = FALSE;
|
This->baseTexture.dirty = FALSE;
|
||||||
}
|
}
|
||||||
@ -206,38 +207,49 @@ HRESULT WINAPI IWineD3DTextureImpl_GetLevelDesc(IWineD3DTexture *iface, UINT Lev
|
|||||||
|
|
||||||
HRESULT WINAPI IWineD3DTextureImpl_GetSurfaceLevel(IWineD3DTexture *iface, UINT Level, IWineD3DSurface** ppSurfaceLevel) {
|
HRESULT WINAPI IWineD3DTextureImpl_GetSurfaceLevel(IWineD3DTexture *iface, UINT Level, IWineD3DSurface** ppSurfaceLevel) {
|
||||||
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
||||||
*ppSurfaceLevel = (IWineD3DSurface *) This->surfaces[Level];
|
HRESULT hr = D3DERR_INVALIDCALL;
|
||||||
IWineD3DSurface_AddRef((IWineD3DSurface *) This->surfaces[Level]);
|
|
||||||
TRACE("(%p) : returning %p for level %d\n", This, *ppSurfaceLevel, Level);
|
|
||||||
return D3D_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT WINAPI IWineD3DTextureImpl_LockRect(IWineD3DTexture *iface, UINT Level, D3DLOCKED_RECT *pLockedRect,
|
|
||||||
CONST RECT *pRect, DWORD Flags) {
|
|
||||||
HRESULT hr;
|
|
||||||
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
|
||||||
|
|
||||||
if (Level < This->baseTexture.levels) {
|
if (Level < This->baseTexture.levels) {
|
||||||
|
*ppSurfaceLevel = This->surfaces[Level];
|
||||||
hr = IWineD3DSurface_LockRect((IWineD3DSurface *) This->surfaces[Level], pLockedRect, pRect, Flags);
|
IWineD3DSurface_AddRef((IWineD3DSurface*) This->surfaces[Level]);
|
||||||
TRACE("(%p) Level (%d) success(%lu)\n", This, Level, hr);
|
hr = D3D_OK;
|
||||||
} else {
|
TRACE("(%p) : returning %p for level %d\n", This, *ppSurfaceLevel, Level);
|
||||||
FIXME("(%p) level(%d) overflow Levels(%d)\n", This, Level, This->baseTexture.levels);
|
}
|
||||||
return D3DERR_INVALIDCALL;
|
if (D3D_OK != hr) {
|
||||||
|
WARN("(%p) level(%d) overflow Levels(%d)\n", This, Level, This->baseTexture.levels);
|
||||||
|
*ppSurfaceLevel = NULL; /* Just to be on the safe side.. */
|
||||||
}
|
}
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI IWineD3DTextureImpl_UnlockRect(IWineD3DTexture *iface, UINT Level) {
|
HRESULT WINAPI IWineD3DTextureImpl_LockRect(IWineD3DTexture *iface, UINT Level, D3DLOCKED_RECT *pLockedRect,
|
||||||
HRESULT hr;
|
CONST RECT *pRect, DWORD Flags) {
|
||||||
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
||||||
|
HRESULT hr = D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
if (Level < This->baseTexture.levels) {
|
if (Level < This->baseTexture.levels) {
|
||||||
hr = IWineD3DSurface_UnlockRect((IWineD3DSurface *) This->surfaces[Level]);
|
hr = IWineD3DSurface_LockRect((IWineD3DSurface *) This->surfaces[Level], pLockedRect, pRect, Flags);
|
||||||
TRACE("(%p) Level (%d) success(%lu)\n", This, Level, hr);
|
}
|
||||||
|
if (D3D_OK == hr) {
|
||||||
|
TRACE("(%p) Level (%d) success\n", This, Level);
|
||||||
} else {
|
} else {
|
||||||
FIXME("(%p) level(%d) overflow Levels(%d)\n", This, Level, This->baseTexture.levels);
|
WARN("(%p) level(%d) overflow Levels(%d)\n", This, Level, This->baseTexture.levels);
|
||||||
return D3DERR_INVALIDCALL;
|
}
|
||||||
|
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI IWineD3DTextureImpl_UnlockRect(IWineD3DTexture *iface, UINT Level) {
|
||||||
|
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
||||||
|
HRESULT hr = D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
|
if (Level < This->baseTexture.levels) {
|
||||||
|
hr = IWineD3DSurface_UnlockRect(This->surfaces[Level]);
|
||||||
|
}
|
||||||
|
if ( D3D_OK == hr) {
|
||||||
|
TRACE("(%p) Level (%d) success\n", This, Level);
|
||||||
|
} else {
|
||||||
|
WARN("(%p) level(%d) overflow Levels(%d)\n", This, Level, This->baseTexture.levels);
|
||||||
}
|
}
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
@ -255,7 +267,7 @@ const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
|
|||||||
IWineD3DTextureImpl_QueryInterface,
|
IWineD3DTextureImpl_QueryInterface,
|
||||||
IWineD3DTextureImpl_AddRef,
|
IWineD3DTextureImpl_AddRef,
|
||||||
IWineD3DTextureImpl_Release,
|
IWineD3DTextureImpl_Release,
|
||||||
/* IWineD3DResource */
|
/* IWineD3DResource */
|
||||||
IWineD3DTextureImpl_GetParent,
|
IWineD3DTextureImpl_GetParent,
|
||||||
IWineD3DTextureImpl_GetDevice,
|
IWineD3DTextureImpl_GetDevice,
|
||||||
IWineD3DTextureImpl_SetPrivateData,
|
IWineD3DTextureImpl_SetPrivateData,
|
||||||
@ -265,7 +277,7 @@ const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
|
|||||||
IWineD3DTextureImpl_GetPriority,
|
IWineD3DTextureImpl_GetPriority,
|
||||||
IWineD3DTextureImpl_PreLoad,
|
IWineD3DTextureImpl_PreLoad,
|
||||||
IWineD3DTextureImpl_GetType,
|
IWineD3DTextureImpl_GetType,
|
||||||
/* IWineD3DBaseTexture */
|
/* IWineD3DBaseTexture */
|
||||||
IWineD3DTextureImpl_SetLOD,
|
IWineD3DTextureImpl_SetLOD,
|
||||||
IWineD3DTextureImpl_GetLOD,
|
IWineD3DTextureImpl_GetLOD,
|
||||||
IWineD3DTextureImpl_GetLevelCount,
|
IWineD3DTextureImpl_GetLevelCount,
|
||||||
@ -276,8 +288,8 @@ const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
|
|||||||
IWineD3DTextureImpl_GetDirty,
|
IWineD3DTextureImpl_GetDirty,
|
||||||
IWineD3DTextureImpl_BindTexture,
|
IWineD3DTextureImpl_BindTexture,
|
||||||
IWineD3DTextureImpl_UnBindTexture,
|
IWineD3DTextureImpl_UnBindTexture,
|
||||||
IWineD3DTextureImpl_GetTextureDimensions,
|
IWineD3DTextureImpl_GetTextureDimensions,
|
||||||
/* IWineD3DTexture */
|
/* IWineD3DTexture */
|
||||||
IWineD3DTextureImpl_GetLevelDesc,
|
IWineD3DTextureImpl_GetLevelDesc,
|
||||||
IWineD3DTextureImpl_GetSurfaceLevel,
|
IWineD3DTextureImpl_GetSurfaceLevel,
|
||||||
IWineD3DTextureImpl_LockRect,
|
IWineD3DTextureImpl_LockRect,
|
||||||
|
Loading…
Reference in New Issue
Block a user