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
a537fb0a
Commit
a537fb0a
authored
Dec 24, 2008
by
Nick Burns
Committed by
Alexandre Julliard
Dec 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Fix surface version setting.
parent
9dea6f7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
6 deletions
+27
-6
ddraw.c
dlls/ddraw/ddraw.c
+1
-0
ddraw_thunks.c
dlls/ddraw/ddraw_thunks.c
+21
-4
surface.c
dlls/ddraw/surface.c
+5
-2
No files found.
dlls/ddraw/ddraw.c
View file @
a537fb0a
...
@@ -2084,6 +2084,7 @@ IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This,
...
@@ -2084,6 +2084,7 @@ IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This,
ICOM_INIT_INTERFACE
(
*
ppSurf
,
IDirect3DTexture
,
IDirect3DTexture1_Vtbl
);
ICOM_INIT_INTERFACE
(
*
ppSurf
,
IDirect3DTexture
,
IDirect3DTexture1_Vtbl
);
(
*
ppSurf
)
->
ref
=
1
;
(
*
ppSurf
)
->
ref
=
1
;
(
*
ppSurf
)
->
version
=
7
;
(
*
ppSurf
)
->
version
=
7
;
TRACE
(
"%p->version = %d
\n
"
,
(
*
ppSurf
),
(
*
ppSurf
)
->
version
);
(
*
ppSurf
)
->
ddraw
=
This
;
(
*
ppSurf
)
->
ddraw
=
This
;
(
*
ppSurf
)
->
surface_desc
.
dwSize
=
sizeof
(
DDSURFACEDESC2
);
(
*
ppSurf
)
->
surface_desc
.
dwSize
=
sizeof
(
DDSURFACEDESC2
);
(
*
ppSurf
)
->
surface_desc
.
u4
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
DDPIXELFORMAT
);
(
*
ppSurf
)
->
surface_desc
.
u4
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
DDPIXELFORMAT
);
...
...
dlls/ddraw/ddraw_thunks.c
View file @
a537fb0a
...
@@ -377,6 +377,23 @@ IDirectDraw4Impl_CreatePalette(LPDIRECTDRAW4 This, DWORD dwFlags,
...
@@ -377,6 +377,23 @@ IDirectDraw4Impl_CreatePalette(LPDIRECTDRAW4 This, DWORD dwFlags,
return
hr
;
return
hr
;
}
}
/* Must set all attached surfaces (e.g. mipmaps) versions as well */
static
void
set_surf_version
(
IDirectDrawSurfaceImpl
*
surf
,
int
version
)
{
int
i
;
TRACE
(
"%p->version(%d) = %d
\n
"
,
surf
,
surf
->
version
,
version
);
surf
->
version
=
version
;
for
(
i
=
0
;
i
<
MAX_COMPLEX_ATTACHED
;
i
++
)
{
if
(
!
surf
->
complex_array
[
i
])
break
;
set_surf_version
(
surf
->
complex_array
[
i
],
version
);
}
while
(
(
surf
=
surf
->
next_attached
)
)
{
set_surf_version
(
surf
,
version
);
}
}
static
HRESULT
WINAPI
static
HRESULT
WINAPI
IDirectDrawImpl_CreateSurface
(
LPDIRECTDRAW
This
,
LPDDSURFACEDESC
pSDesc
,
IDirectDrawImpl_CreateSurface
(
LPDIRECTDRAW
This
,
LPDDSURFACEDESC
pSDesc
,
LPDIRECTDRAWSURFACE
*
ppSurface
,
LPDIRECTDRAWSURFACE
*
ppSurface
,
...
@@ -407,7 +424,7 @@ IDirectDrawImpl_CreateSurface(LPDIRECTDRAW This, LPDDSURFACEDESC pSDesc,
...
@@ -407,7 +424,7 @@ IDirectDrawImpl_CreateSurface(LPDIRECTDRAW This, LPDDSURFACEDESC pSDesc,
impl
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
pSurface7
);
impl
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
pSurface7
);
if
(
SUCCEEDED
(
hr
)
&&
impl
)
if
(
SUCCEEDED
(
hr
)
&&
impl
)
{
{
impl
->
version
=
1
;
set_surf_version
(
impl
,
1
)
;
IDirectDraw7_Release
(
COM_INTERFACE_CAST
(
IDirectDrawImpl
,
IDirectDraw7_Release
(
COM_INTERFACE_CAST
(
IDirectDrawImpl
,
IDirectDraw
,
IDirectDraw
,
IDirectDraw7
,
IDirectDraw7
,
...
@@ -442,7 +459,7 @@ IDirectDraw2Impl_CreateSurface(LPDIRECTDRAW2 This, LPDDSURFACEDESC pSDesc,
...
@@ -442,7 +459,7 @@ IDirectDraw2Impl_CreateSurface(LPDIRECTDRAW2 This, LPDDSURFACEDESC pSDesc,
impl
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
pSurface7
);
impl
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
pSurface7
);
if
(
SUCCEEDED
(
hr
)
&&
impl
)
if
(
SUCCEEDED
(
hr
)
&&
impl
)
{
{
impl
->
version
=
2
;
set_surf_version
(
impl
,
2
)
;
IDirectDraw7_Release
(
COM_INTERFACE_CAST
(
IDirectDrawImpl
,
IDirectDraw7_Release
(
COM_INTERFACE_CAST
(
IDirectDrawImpl
,
IDirectDraw2
,
IDirectDraw2
,
IDirectDraw7
,
IDirectDraw7
,
...
@@ -477,7 +494,7 @@ IDirectDraw3Impl_CreateSurface(LPDIRECTDRAW3 This, LPDDSURFACEDESC pSDesc,
...
@@ -477,7 +494,7 @@ IDirectDraw3Impl_CreateSurface(LPDIRECTDRAW3 This, LPDDSURFACEDESC pSDesc,
impl
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
pSurface7
);
impl
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
pSurface7
);
if
(
SUCCEEDED
(
hr
)
&&
impl
)
if
(
SUCCEEDED
(
hr
)
&&
impl
)
{
{
impl
->
version
=
3
;
set_surf_version
(
impl
,
3
)
;
IDirectDraw7_Release
(
COM_INTERFACE_CAST
(
IDirectDrawImpl
,
IDirectDraw7_Release
(
COM_INTERFACE_CAST
(
IDirectDrawImpl
,
IDirectDraw3
,
IDirectDraw3
,
IDirectDraw7
,
IDirectDraw7
,
...
@@ -507,7 +524,7 @@ IDirectDraw4Impl_CreateSurface(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pSDesc,
...
@@ -507,7 +524,7 @@ IDirectDraw4Impl_CreateSurface(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pSDesc,
impl
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
*
ppSurface
);
impl
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
*
ppSurface
);
if
(
SUCCEEDED
(
hr
)
&&
impl
)
if
(
SUCCEEDED
(
hr
)
&&
impl
)
{
{
impl
->
version
=
4
;
set_surf_version
(
impl
,
4
)
;
IDirectDraw7_Release
(
COM_INTERFACE_CAST
(
IDirectDrawImpl
,
IDirectDraw7_Release
(
COM_INTERFACE_CAST
(
IDirectDrawImpl
,
IDirectDraw4
,
IDirectDraw4
,
IDirectDraw7
,
IDirectDraw7
,
...
...
dlls/ddraw/surface.c
View file @
a537fb0a
...
@@ -475,15 +475,18 @@ IDirectDrawSurfaceImpl_GetAttachedSurface(IDirectDrawSurface7 *iface,
...
@@ -475,15 +475,18 @@ IDirectDrawSurfaceImpl_GetAttachedSurface(IDirectDrawSurface7 *iface,
TRACE
(
"(%p)->(%p,%p)
\n
"
,
This
,
Caps
,
Surface
);
TRACE
(
"(%p)->(%p,%p)
\n
"
,
This
,
Caps
,
Surface
);
EnterCriticalSection
(
&
ddraw_cs
);
EnterCriticalSection
(
&
ddraw_cs
);
our_caps
=
*
Caps
;
if
(
This
->
version
<
7
)
if
(
This
->
version
<
7
)
{
{
/* Earlier dx apps put garbage into these members, clear them */
/* Earlier dx apps put garbage into these members, clear them */
our_caps
.
dwCaps
=
Caps
->
dwCaps
;
our_caps
.
dwCaps2
=
0
;
our_caps
.
dwCaps2
=
0
;
our_caps
.
dwCaps3
=
0
;
our_caps
.
dwCaps3
=
0
;
our_caps
.
dwCaps4
=
0
;
our_caps
.
dwCaps4
=
0
;
}
}
else
{
our_caps
=
*
Caps
;
}
TRACE
(
"(%p): Looking for caps: %x,%x,%x,%x
\n
"
,
This
,
our_caps
.
dwCaps
,
our_caps
.
dwCaps2
,
our_caps
.
dwCaps3
,
our_caps
.
dwCaps4
);
/* FIXME: Better debugging */
TRACE
(
"(%p): Looking for caps: %x,%x,%x,%x
\n
"
,
This
,
our_caps
.
dwCaps
,
our_caps
.
dwCaps2
,
our_caps
.
dwCaps3
,
our_caps
.
dwCaps4
);
/* FIXME: Better debugging */
...
...
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