Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0a358286
Commit
0a358286
authored
Jul 27, 2011
by
Ričardas Barkauskas
Committed by
Alexandre Julliard
Jul 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Use unsafe_impl_from_IDirect3DTexture() for application provided interfaces.
parent
06722210
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
ddraw_private.h
dlls/ddraw/ddraw_private.h
+2
-0
device.c
dlls/ddraw/device.c
+2
-2
surface.c
dlls/ddraw/surface.c
+9
-1
No files found.
dlls/ddraw/ddraw_private.h
View file @
0a358286
...
...
@@ -253,6 +253,8 @@ IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface4
(
IDirectDrawSurface4
*
iface
)
DECLSPEC_HIDDEN
;
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface7
(
IDirectDrawSurface7
*
iface
)
DECLSPEC_HIDDEN
;
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirect3DTexture
(
IDirect3DTexture
*
iface
)
DECLSPEC_HIDDEN
;
/* Get the number of bytes per pixel for a given surface */
#define PFGET_BPP(pf) (pf.dwFlags&DDPF_PALETTEINDEXED8?1:((pf.dwRGBBitCount+7)/8))
#define GET_BPP(desc) PFGET_BPP(desc.ddpfPixelFormat)
...
...
dlls/ddraw/device.c
View file @
0a358286
...
...
@@ -568,8 +568,8 @@ static HRESULT WINAPI IDirect3DDeviceImpl_1_SwapTextureHandles(IDirect3DDevice *
IDirect3DTexture
*
D3DTex1
,
IDirect3DTexture
*
D3DTex2
)
{
IDirect3DDeviceImpl
*
This
=
device_from_device1
(
iface
);
IDirectDrawSurfaceImpl
*
surf1
=
surface_from_texture1
(
D3DTex1
);
IDirectDrawSurfaceImpl
*
surf2
=
surface_from_texture1
(
D3DTex2
);
IDirectDrawSurfaceImpl
*
surf1
=
unsafe_impl_from_IDirect3DTexture
(
D3DTex1
);
IDirectDrawSurfaceImpl
*
surf2
=
unsafe_impl_from_IDirect3DTexture
(
D3DTex2
);
IDirect3DTexture2
*
t1
=
surf1
?
(
IDirect3DTexture2
*
)
&
surf1
->
IDirect3DTexture2_vtbl
:
NULL
;
IDirect3DTexture2
*
t2
=
surf2
?
(
IDirect3DTexture2
*
)
&
surf2
->
IDirect3DTexture2_vtbl
:
NULL
;
...
...
dlls/ddraw/surface.c
View file @
0a358286
...
...
@@ -4703,10 +4703,11 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
static
HRESULT
WINAPI
d3d_texture1_Load
(
IDirect3DTexture
*
iface
,
IDirect3DTexture
*
src_texture
)
{
IDirectDrawSurfaceImpl
*
src_surface
=
unsafe_impl_from_IDirect3DTexture
(
src_texture
);
TRACE
(
"iface %p, src_texture %p.
\n
"
,
iface
,
src_texture
);
return
d3d_texture2_Load
((
IDirect3DTexture2
*
)
&
surface_from_texture1
(
iface
)
->
IDirect3DTexture2_vtbl
,
src_
texture
?
(
IDirect3DTexture2
*
)
&
surface_from_texture1
(
src_texture
)
->
IDirect3DTexture2_vtbl
:
NULL
);
src_
surface
?
(
IDirect3DTexture2
*
)
&
src_surface
->
IDirect3DTexture2_vtbl
:
NULL
);
}
/*****************************************************************************
...
...
@@ -5028,6 +5029,13 @@ IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *
return
CONTAINING_RECORD
(
iface
,
IDirectDrawSurfaceImpl
,
IDirectDrawSurface_iface
);
}
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirect3DTexture
(
IDirect3DTexture
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
d3d_texture1_vtbl
);
return
CONTAINING_RECORD
(
iface
,
IDirectDrawSurfaceImpl
,
IDirect3DTexture_vtbl
);
}
static
void
STDMETHODCALLTYPE
ddraw_surface_wined3d_object_destroyed
(
void
*
parent
)
{
IDirectDrawSurfaceImpl
*
surface
=
parent
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment