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
50a0c212
Commit
50a0c212
authored
Dec 05, 2006
by
Markus Amsler
Committed by
Alexandre Julliard
Dec 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d: Callback infrastructure for implicit volume destruction in IWineD3DVolumeTexture.
parent
cb865294
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
20 deletions
+33
-20
directx.c
dlls/wined3d/directx.c
+10
-0
volumetexture.c
dlls/wined3d/volumetexture.c
+17
-20
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
wined3d_interface.h
include/wine/wined3d_interface.h
+4
-0
No files found.
dlls/wined3d/directx.c
View file @
50a0c212
...
...
@@ -2500,6 +2500,16 @@ ULONG WINAPI D3DCB_DefaultDestroySurface(IWineD3DSurface *pSurface) {
return
IUnknown_Release
(
surfaceParent
);
}
ULONG
WINAPI
D3DCB_DefaultDestroyVolume
(
IWineD3DVolume
*
pVolume
)
{
IUnknown
*
volumeParent
;
TRACE
(
"(%p) call back
\n
"
,
pVolume
);
/* Now, release the parent, which will take care of cleaning up the volume for us */
IWineD3DVolume_GetParent
(
pVolume
,
&
volumeParent
);
IUnknown_Release
(
volumeParent
);
return
IUnknown_Release
(
volumeParent
);
}
/**********************************************************
* IWineD3D VTbl follows
**********************************************************/
...
...
dlls/wined3d/volumetexture.c
View file @
50a0c212
...
...
@@ -55,29 +55,10 @@ static ULONG WINAPI IWineD3DVolumeTextureImpl_AddRef(IWineD3DVolumeTexture *ifac
static
ULONG
WINAPI
IWineD3DVolumeTextureImpl_Release
(
IWineD3DVolumeTexture
*
iface
)
{
IWineD3DVolumeTextureImpl
*
This
=
(
IWineD3DVolumeTextureImpl
*
)
iface
;
ULONG
ref
;
int
i
;
TRACE
(
"(%p) : Releasing from %d
\n
"
,
This
,
This
->
resource
.
ref
);
ref
=
InterlockedDecrement
(
&
This
->
resource
.
ref
);
if
(
ref
==
0
)
{
for
(
i
=
0
;
i
<
This
->
baseTexture
.
levels
;
i
++
)
{
if
(
This
->
volumes
[
i
]
!=
NULL
)
{
/* Since the volumes were created by callback, the texture is
* keeping the reference to the parent, so the texture should
* release it. */
IUnknown
*
volumeParent
=
NULL
;
TRACE
(
"(%p) : Releasing volume %p
\n
"
,
This
,
This
->
volumes
[
i
]);
/* Cleanup the container */
IWineD3DVolume_SetContainer
(
This
->
volumes
[
i
],
0
);
/* Now, release the parent, which will take care of cleaning up the volume for us */
IWineD3DVolume_GetParent
(
This
->
volumes
[
i
],
&
volumeParent
);
IUnknown_Release
(
volumeParent
);
/* Once for the reference GetParent added */
IUnknown_Release
(
volumeParent
);
/* Once for the reference we're keeping */
}
}
IWineD3DBaseTextureImpl_CleanUp
((
IWineD3DBaseTexture
*
)
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
IWineD3DVolumeTexture_Destroy
(
iface
,
D3DCB_DefaultDestroyVolume
);
}
return
ref
;
}
...
...
@@ -207,6 +188,21 @@ static void WINAPI IWineD3DVolumeTextureImpl_ApplyStateChanges(IWineD3DVolumeTex
/* *******************************************
IWineD3DVolumeTexture IWineD3DVolumeTexture parts follow
******************************************* */
static
void
WINAPI
IWineD3DVolumeTextureImpl_Destroy
(
IWineD3DVolumeTexture
*
iface
,
D3DCB_DESTROYVOLUMEFN
D3DCB_DestroyVolume
)
{
IWineD3DVolumeTextureImpl
*
This
=
(
IWineD3DVolumeTextureImpl
*
)
iface
;
int
i
;
TRACE
(
"(%p) : Cleaning up
\n
"
,
This
);
for
(
i
=
0
;
i
<
This
->
baseTexture
.
levels
;
i
++
)
{
if
(
This
->
volumes
[
i
]
!=
NULL
)
{
/* Cleanup the container */
IWineD3DVolume_SetContainer
(
This
->
volumes
[
i
],
0
);
D3DCB_DestroyVolume
(
This
->
volumes
[
i
]);
}
}
IWineD3DBaseTextureImpl_CleanUp
((
IWineD3DBaseTexture
*
)
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
static
HRESULT
WINAPI
IWineD3DVolumeTextureImpl_GetLevelDesc
(
IWineD3DVolumeTexture
*
iface
,
UINT
Level
,
WINED3DVOLUME_DESC
*
pDesc
)
{
IWineD3DVolumeTextureImpl
*
This
=
(
IWineD3DVolumeTextureImpl
*
)
iface
;
if
(
Level
<
This
->
baseTexture
.
levels
)
{
...
...
@@ -298,6 +294,7 @@ const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =
IWineD3DVolumeTextureImpl_GetTextureDimensions
,
IWineD3DVolumeTextureImpl_ApplyStateChanges
,
/* volume texture */
IWineD3DVolumeTextureImpl_Destroy
,
IWineD3DVolumeTextureImpl_GetLevelDesc
,
IWineD3DVolumeTextureImpl_GetVolumeLevel
,
IWineD3DVolumeTextureImpl_LockBox
,
...
...
dlls/wined3d/wined3d_private.h
View file @
50a0c212
...
...
@@ -419,6 +419,8 @@ BOOL IWineD3DImpl_FillGLCaps(IWineD3D *iface, Display* display);
/* Default callbacks for implicit object destruction */
extern
ULONG
WINAPI
D3DCB_DefaultDestroySurface
(
IWineD3DSurface
*
pSurface
);
extern
ULONG
WINAPI
D3DCB_DefaultDestroyVolume
(
IWineD3DVolume
*
pSurface
);
/*****************************************************************************
* Internal representation of a light
*/
...
...
include/wine/wined3d_interface.h
View file @
50a0c212
...
...
@@ -245,6 +245,8 @@ typedef HRESULT WINAPI (*D3DCB_ENUMDISPLAYMODESCALLBACK) (IUnknown *pDevice,
*/
typedef
ULONG
WINAPI
(
*
D3DCB_DESTROYSURFACEFN
)
(
struct
IWineD3DSurface
*
pSurface
);
typedef
ULONG
WINAPI
(
*
D3DCB_DESTROYVOLUMEFN
)
(
struct
IWineD3DVolume
*
pVolume
);
/*****************************************************************************
* IWineD3DBase interface
*/
...
...
@@ -1025,6 +1027,7 @@ DECLARE_INTERFACE_(IWineD3DVolumeTexture,IWineD3DBaseTexture)
STDMETHOD_
(
UINT
,
GetTextureDimensions
)(
THIS
)
PURE
;
STDMETHOD_
(
void
,
ApplyStateChanges
)(
THIS_
const
DWORD
textureStates
[
WINED3D_HIGHEST_TEXTURE_STATE
+
1
],
const
DWORD
samplerStates
[
WINED3D_HIGHEST_SAMPLER_STATE
+
1
])
PURE
;
/*** IWineD3DVolumeTexture methods ***/
STDMETHOD_
(
void
,
Destroy
)(
THIS_
D3DCB_DESTROYVOLUMEFN
pFn
)
PURE
;
STDMETHOD
(
GetLevelDesc
)(
THIS_
UINT
Level
,
WINED3DVOLUME_DESC
*
pDesc
)
PURE
;
STDMETHOD
(
GetVolumeLevel
)(
THIS_
UINT
Level
,
struct
IWineD3DVolume
**
ppVolumeLevel
)
PURE
;
STDMETHOD
(
LockBox
)(
THIS_
UINT
Level
,
WINED3DLOCKED_BOX
*
pLockedVolume
,
CONST
WINED3DBOX
*
pBox
,
DWORD
Flags
)
PURE
;
...
...
@@ -1063,6 +1066,7 @@ DECLARE_INTERFACE_(IWineD3DVolumeTexture,IWineD3DBaseTexture)
#define IWineD3DVolumeTexture_GetTextureDimensions(p) (p)->lpVtbl->GetTextureDimensions(p)
#define IWineD3DVolumeTexture_ApplyStateChanges(p,a,b) (p)->lpVtbl->ApplyStateChanges(p,a,b)
/*** IWineD3DVolumeTexture methods ***/
#define IWineD3DVolumeTexture_Destroy(p,a) (p)->lpVtbl->Destroy(p,a)
#define IWineD3DVolumeTexture_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b)
#define IWineD3DVolumeTexture_GetVolumeLevel(p,a,b) (p)->lpVtbl->GetVolumeLevel(p,a,b)
#define IWineD3DVolumeTexture_LockBox(p,a,b,c,d) (p)->lpVtbl->LockBox(p,a,b,c,d)
...
...
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