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
43ad90ce
Commit
43ad90ce
authored
Aug 30, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 31, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Get rid of the ImplType fields in IDirectDrawImpl and IDirectDrawSurfaceImpl.
parent
c89a3ffe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
24 deletions
+12
-24
ddraw.c
dlls/ddraw/ddraw.c
+9
-16
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-5
surface.c
dlls/ddraw/surface.c
+2
-3
No files found.
dlls/ddraw/ddraw.c
View file @
43ad90ce
...
...
@@ -206,7 +206,7 @@ static HRESULT WINAPI ddraw7_QueryInterface(IDirectDraw7 *iface, REFIID refiid,
IsEqualGUID
(
&
IID_IDirect3D7
,
refiid
)
)
{
/* Check the surface implementation */
if
(
This
->
Impl
Type
!=
SURFACE_OPENGL
)
if
(
DefaultSurface
Type
!=
SURFACE_OPENGL
)
{
WARN
(
"The app requests a Direct3D interface, but non-opengl surfaces where set in winecfg
\n
"
);
/* Do not abort here, only reject 3D Device creation */
...
...
@@ -1378,7 +1378,6 @@ static HRESULT WINAPI ddraw7_GetFourCCCodes(IDirectDraw7 *iface, DWORD *NumCodes
DWORD
count
=
0
,
i
,
outsize
;
HRESULT
hr
;
WINED3DDISPLAYMODE
d3ddm
;
WINED3DSURFTYPE
type
=
This
->
ImplType
;
TRACE
(
"iface %p, codes_count %p, codes %p.
\n
"
,
iface
,
NumCodes
,
Codes
);
...
...
@@ -1389,7 +1388,7 @@ static HRESULT WINAPI ddraw7_GetFourCCCodes(IDirectDraw7 *iface, DWORD *NumCodes
for
(
i
=
0
;
i
<
(
sizeof
(
formats
)
/
sizeof
(
formats
[
0
]));
++
i
)
{
hr
=
wined3d_check_device_format
(
This
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
WINED3DDEVTYPE_HAL
,
d3ddm
.
Format
,
0
,
WINED3DRTYPE_SURFACE
,
formats
[
i
],
t
ype
);
d3ddm
.
Format
,
0
,
WINED3DRTYPE_SURFACE
,
formats
[
i
],
DefaultSurfaceT
ype
);
if
(
SUCCEEDED
(
hr
))
{
if
(
count
<
outsize
)
...
...
@@ -2600,7 +2599,6 @@ static HRESULT WINAPI ddraw7_StartModeTest(IDirectDraw7 *iface, SIZE *Modes, DWO
static
HRESULT
ddraw_create_surface
(
IDirectDrawImpl
*
This
,
DDSURFACEDESC2
*
pDDSD
,
IDirectDrawSurfaceImpl
**
ppSurf
,
UINT
level
,
UINT
version
)
{
WINED3DSURFTYPE
ImplType
=
This
->
ImplType
;
HRESULT
hr
;
TRACE
(
"ddraw %p, surface_desc %p, surface %p, level %u.
\n
"
,
...
...
@@ -2612,7 +2610,7 @@ static HRESULT ddraw_create_surface(IDirectDrawImpl *This, DDSURFACEDESC2 *pDDSD
DDRAW_dump_surface_desc
(
pDDSD
);
}
if
((
pDDSD
->
ddsCaps
.
dwCaps
&
DDSCAPS_3DDEVICE
)
&&
This
->
Impl
Type
!=
SURFACE_OPENGL
)
if
((
pDDSD
->
ddsCaps
.
dwCaps
&
DDSCAPS_3DDEVICE
)
&&
DefaultSurface
Type
!=
SURFACE_OPENGL
)
{
WARN
(
"The application requests a 3D capable surface, but a non-OpenGL surface type was set in the registry.
\n
"
);
/* Do not fail surface creation, only fail 3D device creation. */
...
...
@@ -2626,7 +2624,7 @@ static HRESULT ddraw_create_surface(IDirectDrawImpl *This, DDSURFACEDESC2 *pDDSD
return
DDERR_OUTOFVIDEOMEMORY
;
}
hr
=
ddraw_surface_init
(
*
ppSurf
,
This
,
pDDSD
,
level
,
ImplType
,
version
);
hr
=
ddraw_surface_init
(
*
ppSurf
,
This
,
pDDSD
,
level
,
version
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize surface, hr %#x.
\n
"
,
hr
);
...
...
@@ -3248,10 +3246,9 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
* The only case I can think of where this doesn't apply is when a
* 2D app was configured by the user to run with OpenGL and it didn't create
* the render target as first surface. In this case the render target creation
* will cause the 3D init.
*/
if
(
(
ddraw
->
ImplType
==
SURFACE_OPENGL
)
&&
!
(
ddraw
->
d3d_initialized
)
&&
desc2
.
ddsCaps
.
dwCaps
&
(
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_3DDEVICE
)
)
* will cause the 3D init. */
if
(
DefaultSurfaceType
==
SURFACE_OPENGL
&&
!
ddraw
->
d3d_initialized
&&
desc2
.
ddsCaps
.
dwCaps
&
(
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_3DDEVICE
))
{
IDirectDrawSurfaceImpl
*
target
=
object
,
*
surface
;
struct
list
*
entry
;
...
...
@@ -4695,7 +4692,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
*
device
=
NULL
;
/* Fail device creation if non-opengl surfaces are used. */
if
(
This
->
Impl
Type
!=
SURFACE_OPENGL
)
if
(
DefaultSurface
Type
!=
SURFACE_OPENGL
)
{
ERR
(
"The application wants to create a Direct3D device, but non-opengl surfaces are set in the registry.
\n
"
);
ERR
(
"Please set the surface implementation to opengl or autodetection to allow 3D rendering.
\n
"
);
...
...
@@ -5799,7 +5796,7 @@ static HRESULT CDECL device_parent_create_swapchain(struct wined3d_device_parent
TRACE
(
"device_parent %p, present_parameters %p, swapchain %p.
\n
"
,
device_parent
,
present_parameters
,
swapchain
);
hr
=
wined3d_swapchain_create
(
ddraw
->
wined3d_device
,
present_parameters
,
ddraw
->
Impl
Type
,
NULL
,
&
ddraw_null_wined3d_parent_ops
,
swapchain
);
DefaultSurface
Type
,
NULL
,
&
ddraw_null_wined3d_parent_ops
,
swapchain
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create swapchain, hr %#x.
\n
"
,
hr
);
...
...
@@ -5846,10 +5843,6 @@ HRESULT ddraw_init(IDirectDrawImpl *ddraw, WINED3DDEVTYPE device_type)
ddraw
->
numIfaces
=
1
;
ddraw
->
ref7
=
1
;
/* See comments in IDirectDrawImpl_CreateNewSurface for a description of
* this field. */
ddraw
->
ImplType
=
DefaultSurfaceType
;
/* Get the current screen settings. */
hDC
=
GetDC
(
0
);
ddraw
->
orig_bpp
=
GetDeviceCaps
(
hDC
,
BITSPIXEL
)
*
GetDeviceCaps
(
hDC
,
PLANES
);
...
...
dlls/ddraw/ddraw_private.h
View file @
43ad90ce
...
...
@@ -111,9 +111,6 @@ struct IDirectDrawImpl
HWND
devicewindow
;
HWND
dest_window
;
/* The surface type to request */
WINED3DSURFTYPE
ImplType
;
/* Helpers for surface creation */
IDirectDrawSurfaceImpl
*
tex_root
;
BOOL
depthstencil
;
...
...
@@ -194,7 +191,6 @@ struct IDirectDrawSurfaceImpl
/* Misc things */
DWORD
uniqueness_value
;
UINT
mipmap_level
;
WINED3DSURFTYPE
ImplType
;
/* For D3DDevice creation */
BOOL
isRenderTarget
;
...
...
@@ -211,7 +207,7 @@ struct IDirectDrawSurfaceImpl
HRESULT
ddraw_surface_create_texture
(
IDirectDrawSurfaceImpl
*
surface
)
DECLSPEC_HIDDEN
;
void
ddraw_surface_destroy
(
IDirectDrawSurfaceImpl
*
surface
)
DECLSPEC_HIDDEN
;
HRESULT
ddraw_surface_init
(
IDirectDrawSurfaceImpl
*
surface
,
IDirectDrawImpl
*
ddraw
,
DDSURFACEDESC2
*
desc
,
UINT
mip_level
,
WINED3DSURFTYPE
surface_type
,
UINT
version
)
DECLSPEC_HIDDEN
;
DDSURFACEDESC2
*
desc
,
UINT
mip_level
,
UINT
version
)
DECLSPEC_HIDDEN
;
ULONG
ddraw_surface_release_iface
(
IDirectDrawSurfaceImpl
*
This
)
DECLSPEC_HIDDEN
;
static
inline
IDirectDrawSurfaceImpl
*
impl_from_IDirect3DTexture
(
IDirect3DTexture
*
iface
)
...
...
dlls/ddraw/surface.c
View file @
43ad90ce
...
...
@@ -5085,7 +5085,7 @@ HRESULT ddraw_surface_create_texture(IDirectDrawSurfaceImpl *surface)
}
HRESULT
ddraw_surface_init
(
IDirectDrawSurfaceImpl
*
surface
,
IDirectDrawImpl
*
ddraw
,
DDSURFACEDESC2
*
desc
,
UINT
mip_level
,
WINED3DSURFTYPE
surface_type
,
UINT
version
)
DDSURFACEDESC2
*
desc
,
UINT
mip_level
,
UINT
version
)
{
WINED3DPOOL
pool
=
WINED3DPOOL_DEFAULT
;
enum
wined3d_format_id
format
;
...
...
@@ -5176,11 +5176,10 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr
copy_to_surfacedesc2
(
&
surface
->
surface_desc
,
desc
);
surface
->
first_attached
=
surface
;
surface
->
ImplType
=
surface_type
;
hr
=
wined3d_surface_create
(
ddraw
->
wined3d_device
,
desc
->
dwWidth
,
desc
->
dwHeight
,
format
,
TRUE
/* Lockable */
,
FALSE
/* Discard */
,
mip_level
,
usage
,
pool
,
WINED3DMULTISAMPLE_NONE
,
0
/* MultiSampleQuality */
,
surface_t
ype
,
surface
,
WINED3DMULTISAMPLE_NONE
,
0
/* MultiSampleQuality */
,
DefaultSurfaceT
ype
,
surface
,
&
ddraw_surface_wined3d_parent_ops
,
&
surface
->
wined3d_surface
);
if
(
FAILED
(
hr
))
{
...
...
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