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
2e5628df
Commit
2e5628df
authored
Oct 14, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Oct 16, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Make the surface list a standard wine list.
parent
92e6e46c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
31 deletions
+19
-31
ddraw.c
dlls/ddraw/ddraw.c
+11
-16
ddraw_private.h
dlls/ddraw/ddraw_private.h
+5
-6
main.c
dlls/ddraw/main.c
+2
-0
surface.c
dlls/ddraw/surface.c
+1
-9
No files found.
dlls/ddraw/ddraw.c
View file @
2e5628df
...
...
@@ -1904,12 +1904,7 @@ IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This,
/* Increase the surface counter, and attach the surface */
InterlockedIncrement
(
&
This
->
surfaces
);
if
(
This
->
surface_list
)
{
This
->
surface_list
->
prev
=
*
ppSurf
;
}
(
*
ppSurf
)
->
next
=
This
->
surface_list
;
This
->
surface_list
=
*
ppSurf
;
list_add_head
(
&
This
->
surface_list
,
&
(
*
ppSurf
)
->
surface_list_entry
);
/* Here we could store all created surfaces in the DirectDrawImpl structure,
* But this could also be delegated to WineDDraw, as it keeps track of all its
...
...
@@ -2375,23 +2370,20 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface,
if
(
(
This
->
ImplType
==
SURFACE_OPENGL
)
&&
!
(
This
->
d3d_initialized
)
&&
desc2
.
ddsCaps
.
dwCaps
&
(
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_3DDEVICE
)
)
{
IDirectDrawSurfaceImpl
*
target
=
This
->
surface_list
;
IDirectDrawSurfaceImpl
*
target
=
object
,
*
surface
;
struct
list
*
entry
;
/* Search for the primary to use as render target */
while
(
targe
t
)
LIST_FOR_EACH
(
entry
,
&
This
->
surface_lis
t
)
{
if
(
target
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
surface
=
LIST_ENTRY
(
entry
,
IDirectDrawSurfaceImpl
,
surface_list_entry
);
if
(
surface
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
{
/* found */
target
=
surface
;
TRACE
(
"Using primary %p as render target
\n
"
,
target
);
break
;
}
target
=
target
->
next
;
}
/* If it's not found, use the just created DDSCAPS_3DDEVICE surface */
if
(
!
target
)
{
target
=
object
;
}
TRACE
(
"(%p) Attaching a D3DDevice, rendertarget = %p
\n
"
,
This
,
target
);
...
...
@@ -2601,6 +2593,7 @@ IDirectDrawImpl_EnumSurfaces(IDirectDraw7 *iface,
IDirectDrawSurfaceImpl
*
surf
;
BOOL
all
,
nomatch
;
DDSURFACEDESC2
desc
;
struct
list
*
entry
,
*
entry2
;
all
=
Flags
&
DDENUMSURFACES_ALL
;
nomatch
=
Flags
&
DDENUMSURFACES_NOMATCH
;
...
...
@@ -2610,8 +2603,10 @@ IDirectDrawImpl_EnumSurfaces(IDirectDraw7 *iface,
if
(
!
Callback
)
return
DDERR_INVALIDPARAMS
;
for
(
surf
=
This
->
surface_list
;
surf
;
surf
=
surf
->
next
)
/* Use the _SAFE enumeration, the app may destroy enumerated surfaces */
LIST_FOR_EACH_SAFE
(
entry
,
entry2
,
&
This
->
surface_list
)
{
surf
=
LIST_ENTRY
(
entry
,
IDirectDrawSurfaceImpl
,
surface_list_entry
);
if
(
all
||
(
nomatch
!=
IDirectDrawImpl_DDSD_Match
(
DDSD
,
&
surf
->
surface_desc
)))
{
desc
=
surf
->
surface_desc
;
...
...
dlls/ddraw/ddraw_private.h
View file @
2e5628df
...
...
@@ -130,10 +130,6 @@ struct IDirectDrawImpl
/* The surface type to request */
WINED3DSURFTYPE
ImplType
;
/* The surface list - can't relay this to WineD3D
* because of IParent
*/
IDirectDrawSurfaceImpl
*
surface_list
;
/* Our private window class */
char
classname
[
32
];
...
...
@@ -145,6 +141,10 @@ struct IDirectDrawImpl
/* For the dll unload cleanup code */
struct
list
ddraw_list_entry
;
/* The surface list - can't relay this to WineD3D
* because of IParent
*/
struct
list
surface_list
;
LONG
surfaces
;
};
...
...
@@ -233,8 +233,7 @@ struct IDirectDrawSurfaceImpl
IDirectDrawClipperImpl
*
clipper
;
/* For the ddraw surface list */
IDirectDrawSurfaceImpl
*
next
;
IDirectDrawSurfaceImpl
*
prev
;
struct
list
surface_list_entry
;
DWORD
Handle
;
};
...
...
dlls/ddraw/main.c
View file @
2e5628df
...
...
@@ -315,6 +315,8 @@ DDRAW_Create(GUID *guid,
#undef CKEY_CAPS
#undef FX_CAPS
list_init
(
&
This
->
surface_list
);
EnterCriticalSection
(
&
ddraw_list_cs
);
list_add_head
(
&
global_ddraw_list
,
&
This
->
ddraw_list_entry
);
LeaveCriticalSection
(
&
ddraw_list_cs
);
...
...
dlls/ddraw/surface.c
View file @
2e5628df
...
...
@@ -238,15 +238,7 @@ static void IDirectDrawSurfaceImpl_Destroy(IDirectDrawSurfaceImpl *This)
/* Reduce the ddraw surface count */
InterlockedDecrement
(
&
This
->
ddraw
->
surfaces
);
if
(
This
->
prev
)
This
->
prev
->
next
=
This
->
next
;
else
{
assert
(
This
->
ddraw
->
surface_list
==
This
);
This
->
ddraw
->
surface_list
=
This
->
next
;
}
if
(
This
->
next
)
This
->
next
->
prev
=
This
->
prev
;
list_remove
(
&
This
->
surface_list_entry
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
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