d3d8: Use unsafe_impl_from_IDirect3DSurface8 for app provided ifaces.
This commit is contained in:
parent
bdd8459a53
commit
cce8294f39
|
@ -256,6 +256,7 @@ struct IDirect3DSurface8Impl
|
||||||
HRESULT surface_init(IDirect3DSurface8Impl *surface, IDirect3DDevice8Impl *device,
|
HRESULT surface_init(IDirect3DSurface8Impl *surface, IDirect3DDevice8Impl *device,
|
||||||
UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level,
|
UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level,
|
||||||
DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality) DECLSPEC_HIDDEN;
|
DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality) DECLSPEC_HIDDEN;
|
||||||
|
IDirect3DSurface8Impl *unsafe_impl_from_IDirect3DSurface8(IDirect3DSurface8 *iface) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/* ---------------------- */
|
/* ---------------------- */
|
||||||
/* IDirect3DVertexBuffer8 */
|
/* IDirect3DVertexBuffer8 */
|
||||||
|
|
|
@ -451,7 +451,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetCursorProperties(IDirect3DDevice8
|
||||||
UINT XHotSpot, UINT YHotSpot, IDirect3DSurface8 *pCursorBitmap)
|
UINT XHotSpot, UINT YHotSpot, IDirect3DSurface8 *pCursorBitmap)
|
||||||
{
|
{
|
||||||
IDirect3DDevice8Impl *This = impl_from_IDirect3DDevice8(iface);
|
IDirect3DDevice8Impl *This = impl_from_IDirect3DDevice8(iface);
|
||||||
IDirect3DSurface8Impl *pSurface = (IDirect3DSurface8Impl*)pCursorBitmap;
|
IDirect3DSurface8Impl *pSurface = unsafe_impl_from_IDirect3DSurface8(pCursorBitmap);
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("iface %p, hotspot_x %u, hotspot_y %u, bitmap %p.\n",
|
TRACE("iface %p, hotspot_x %u, hotspot_y %u, bitmap %p.\n",
|
||||||
|
@ -965,8 +965,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(IDirect3DDevice8 *iface,
|
||||||
IDirect3DSurface8 *pSourceSurface, const RECT *pSourceRects, UINT cRects,
|
IDirect3DSurface8 *pSourceSurface, const RECT *pSourceRects, UINT cRects,
|
||||||
IDirect3DSurface8 *pDestinationSurface, const POINT *pDestPoints)
|
IDirect3DSurface8 *pDestinationSurface, const POINT *pDestPoints)
|
||||||
{
|
{
|
||||||
IDirect3DSurface8Impl *Source = (IDirect3DSurface8Impl *) pSourceSurface;
|
IDirect3DSurface8Impl *Source = unsafe_impl_from_IDirect3DSurface8(pSourceSurface);
|
||||||
IDirect3DSurface8Impl *Dest = (IDirect3DSurface8Impl *) pDestinationSurface;
|
IDirect3DSurface8Impl *Dest = unsafe_impl_from_IDirect3DSurface8(pDestinationSurface);
|
||||||
enum wined3d_format_id srcFormat, destFormat;
|
enum wined3d_format_id srcFormat, destFormat;
|
||||||
struct wined3d_resource_desc wined3d_desc;
|
struct wined3d_resource_desc wined3d_desc;
|
||||||
struct wined3d_resource *wined3d_resource;
|
struct wined3d_resource *wined3d_resource;
|
||||||
|
@ -1053,7 +1053,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetFrontBuffer(IDirect3DDevice8 *ifac
|
||||||
IDirect3DSurface8 *pDestSurface)
|
IDirect3DSurface8 *pDestSurface)
|
||||||
{
|
{
|
||||||
IDirect3DDevice8Impl *This = impl_from_IDirect3DDevice8(iface);
|
IDirect3DDevice8Impl *This = impl_from_IDirect3DDevice8(iface);
|
||||||
IDirect3DSurface8Impl *destSurface = (IDirect3DSurface8Impl *)pDestSurface;
|
IDirect3DSurface8Impl *destSurface = unsafe_impl_from_IDirect3DSurface8(pDestSurface);
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("iface %p, dst_surface %p.\n", iface, pDestSurface);
|
TRACE("iface %p, dst_surface %p.\n", iface, pDestSurface);
|
||||||
|
@ -1074,8 +1074,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetRenderTarget(IDirect3DDevice8 *ifa
|
||||||
IDirect3DSurface8 *pRenderTarget, IDirect3DSurface8 *pNewZStencil)
|
IDirect3DSurface8 *pRenderTarget, IDirect3DSurface8 *pNewZStencil)
|
||||||
{
|
{
|
||||||
IDirect3DDevice8Impl *This = impl_from_IDirect3DDevice8(iface);
|
IDirect3DDevice8Impl *This = impl_from_IDirect3DDevice8(iface);
|
||||||
IDirect3DSurface8Impl *pSurface = (IDirect3DSurface8Impl *)pRenderTarget;
|
IDirect3DSurface8Impl *pSurface = unsafe_impl_from_IDirect3DSurface8(pRenderTarget);
|
||||||
IDirect3DSurface8Impl *pZSurface = (IDirect3DSurface8Impl *)pNewZStencil;
|
IDirect3DSurface8Impl *pZSurface = unsafe_impl_from_IDirect3DSurface8(pNewZStencil);
|
||||||
struct wined3d_surface *original_ds = NULL;
|
struct wined3d_surface *original_ds = NULL;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include <assert.h>
|
||||||
#include "d3d8_private.h"
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
|
||||||
|
@ -335,3 +336,12 @@ HRESULT surface_init(IDirect3DSurface8Impl *surface, IDirect3DDevice8Impl *devic
|
||||||
|
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IDirect3DSurface8Impl *unsafe_impl_from_IDirect3DSurface8(IDirect3DSurface8 *iface)
|
||||||
|
{
|
||||||
|
if (!iface)
|
||||||
|
return NULL;
|
||||||
|
assert(iface->lpVtbl == &Direct3DSurface8_Vtbl);
|
||||||
|
|
||||||
|
return impl_from_IDirect3DSurface8(iface);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue