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
f1ec3820
Commit
f1ec3820
authored
Mar 16, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of IWineD3DTexture.
parent
2c16ab2a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
82 additions
and
115 deletions
+82
-115
d3d8_private.h
dlls/d3d8/d3d8_private.h
+2
-6
texture.c
dlls/d3d8/texture.c
+19
-19
d3d9_private.h
dlls/d3d9/d3d9_private.h
+2
-7
texture.c
dlls/d3d9/texture.c
+22
-22
ddraw.c
dlls/ddraw/ddraw.c
+1
-2
device.c
dlls/wined3d/device.c
+6
-6
texture.c
dlls/wined3d/texture.c
+28
-36
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-7
wined3d.idl
include/wine/wined3d.idl
+1
-10
No files found.
dlls/d3d8/d3d8_private.h
View file @
f1ec3820
...
...
@@ -362,12 +362,8 @@ struct IDirect3DTexture8Impl
{
IDirect3DTexture8
IDirect3DTexture8_iface
;
LONG
ref
;
/* IDirect3DResourc8 fields */
IWineD3DTexture
*
wineD3DTexture
;
/* Parent reference */
IDirect3DDevice8
*
parentDevice
;
IWineD3DBaseTexture
*
wined3d_texture
;
IDirect3DDevice8
*
parentDevice
;
};
HRESULT
texture_init
(
IDirect3DTexture8Impl
*
texture
,
IDirect3DDevice8Impl
*
device
,
...
...
dlls/d3d8/texture.c
View file @
f1ec3820
...
...
@@ -61,7 +61,7 @@ static ULONG WINAPI IDirect3DTexture8Impl_AddRef(IDirect3DTexture8 *iface)
{
IDirect3DDevice8_AddRef
(
This
->
parentDevice
);
wined3d_mutex_lock
();
IWineD3D
Texture_AddRef
(
This
->
wineD3DT
exture
);
IWineD3D
BaseTexture_AddRef
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
}
...
...
@@ -79,7 +79,7 @@ static ULONG WINAPI IDirect3DTexture8Impl_Release(IDirect3DTexture8 *iface)
IDirect3DDevice8
*
parentDevice
=
This
->
parentDevice
;
wined3d_mutex_lock
();
IWineD3D
Texture_Release
(
This
->
wineD3DT
exture
);
IWineD3D
BaseTexture_Release
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
/* Release the device last, as it may cause the device to be destroyed. */
...
...
@@ -114,7 +114,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_SetPrivateData(IDirect3DTexture8 *if
iface
,
debugstr_guid
(
refguid
),
pData
,
SizeOfData
,
Flags
);
wined3d_mutex_lock
();
hr
=
IWineD3D
Texture_SetPrivateData
(
This
->
wineD3DT
exture
,
refguid
,
pData
,
SizeOfData
,
Flags
);
hr
=
IWineD3D
BaseTexture_SetPrivateData
(
This
->
wined3d_t
exture
,
refguid
,
pData
,
SizeOfData
,
Flags
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -130,7 +130,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetPrivateData(IDirect3DTexture8 *if
iface
,
debugstr_guid
(
refguid
),
pData
,
pSizeOfData
);
wined3d_mutex_lock
();
hr
=
IWineD3D
Texture_GetPrivateData
(
This
->
wineD3DT
exture
,
refguid
,
pData
,
pSizeOfData
);
hr
=
IWineD3D
BaseTexture_GetPrivateData
(
This
->
wined3d_t
exture
,
refguid
,
pData
,
pSizeOfData
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -145,7 +145,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_FreePrivateData(IDirect3DTexture8 *i
TRACE
(
"iface %p, guid %s.
\n
"
,
iface
,
debugstr_guid
(
refguid
));
wined3d_mutex_lock
();
hr
=
IWineD3D
Texture_FreePrivateData
(
This
->
wineD3DT
exture
,
refguid
);
hr
=
IWineD3D
BaseTexture_FreePrivateData
(
This
->
wined3d_t
exture
,
refguid
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -159,7 +159,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_SetPriority(IDirect3DTexture8 *iface,
TRACE
(
"iface %p, priority %u.
\n
"
,
iface
,
PriorityNew
);
wined3d_mutex_lock
();
ret
=
IWineD3D
Texture_SetPriority
(
This
->
wineD3DT
exture
,
PriorityNew
);
ret
=
IWineD3D
BaseTexture_SetPriority
(
This
->
wined3d_t
exture
,
PriorityNew
);
wined3d_mutex_unlock
();
return
ret
;
...
...
@@ -173,7 +173,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_GetPriority(IDirect3DTexture8 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
ret
=
IWineD3D
Texture_GetPriority
(
This
->
wineD3DT
exture
);
ret
=
IWineD3D
BaseTexture_GetPriority
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
return
ret
;
...
...
@@ -186,7 +186,7 @@ static void WINAPI IDirect3DTexture8Impl_PreLoad(IDirect3DTexture8 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
IWineD3D
Texture_PreLoad
(
This
->
wineD3DT
exture
);
IWineD3D
BaseTexture_PreLoad
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
}
...
...
@@ -198,7 +198,7 @@ static D3DRESOURCETYPE WINAPI IDirect3DTexture8Impl_GetType(IDirect3DTexture8 *i
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
type
=
IWineD3D
Texture_GetType
(
This
->
wineD3DT
exture
);
type
=
IWineD3D
BaseTexture_GetType
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
return
type
;
...
...
@@ -213,7 +213,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_SetLOD(IDirect3DTexture8 *iface, DWORD
TRACE
(
"iface %p, lod %u.
\n
"
,
iface
,
LODNew
);
wined3d_mutex_lock
();
ret
=
IWineD3D
Texture_SetLOD
(
This
->
wineD3DT
exture
,
LODNew
);
ret
=
IWineD3D
BaseTexture_SetLOD
(
This
->
wined3d_t
exture
,
LODNew
);
wined3d_mutex_unlock
();
return
ret
;
...
...
@@ -227,7 +227,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_GetLOD(IDirect3DTexture8 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
ret
=
IWineD3D
Texture_GetLOD
(
This
->
wineD3DT
exture
);
ret
=
IWineD3D
BaseTexture_GetLOD
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
return
ret
;
...
...
@@ -241,7 +241,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_GetLevelCount(IDirect3DTexture8 *iface
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
ret
=
IWineD3D
Texture_GetLevelCount
(
This
->
wineD3DT
exture
);
ret
=
IWineD3D
BaseTexture_GetLevelCount
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
return
ret
;
...
...
@@ -257,7 +257,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(IDirect3DTexture8 *ifac
TRACE
(
"iface %p, level %u, desc %p.
\n
"
,
iface
,
level
,
desc
);
wined3d_mutex_lock
();
if
(
!
(
sub_resource
=
IWineD3D
Texture_GetSubResource
(
texture
->
wineD3DT
exture
,
level
)))
if
(
!
(
sub_resource
=
IWineD3D
BaseTexture_GetSubResource
(
texture
->
wined3d_t
exture
,
level
)))
hr
=
D3DERR_INVALIDCALL
;
else
{
...
...
@@ -287,7 +287,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(IDirect3DTexture8 *i
TRACE
(
"iface %p, level %u, surface %p.
\n
"
,
iface
,
level
,
surface
);
wined3d_mutex_lock
();
if
(
!
(
sub_resource
=
IWineD3D
Texture_GetSubResource
(
texture
->
wineD3DT
exture
,
level
)))
if
(
!
(
sub_resource
=
IWineD3D
BaseTexture_GetSubResource
(
texture
->
wined3d_t
exture
,
level
)))
{
wined3d_mutex_unlock
();
return
D3DERR_INVALIDCALL
;
...
...
@@ -311,7 +311,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_LockRect(IDirect3DTexture8 *iface, U
iface
,
level
,
locked_rect
,
rect
,
flags
);
wined3d_mutex_lock
();
if
(
!
(
sub_resource
=
IWineD3D
Texture_GetSubResource
(
texture
->
wineD3DT
exture
,
level
)))
if
(
!
(
sub_resource
=
IWineD3D
BaseTexture_GetSubResource
(
texture
->
wined3d_t
exture
,
level
)))
hr
=
D3DERR_INVALIDCALL
;
else
hr
=
IDirect3DSurface8_LockRect
((
IDirect3DSurface8
*
)
wined3d_resource_get_parent
(
sub_resource
),
...
...
@@ -330,7 +330,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(IDirect3DTexture8 *iface,
TRACE
(
"iface %p, level %u.
\n
"
,
iface
,
level
);
wined3d_mutex_lock
();
if
(
!
(
sub_resource
=
IWineD3D
Texture_GetSubResource
(
texture
->
wineD3DT
exture
,
level
)))
if
(
!
(
sub_resource
=
IWineD3D
BaseTexture_GetSubResource
(
texture
->
wined3d_t
exture
,
level
)))
hr
=
D3DERR_INVALIDCALL
;
else
hr
=
IDirect3DSurface8_UnlockRect
((
IDirect3DSurface8
*
)
wined3d_resource_get_parent
(
sub_resource
));
...
...
@@ -349,7 +349,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(IDirect3DTexture8 *ifac
wined3d_mutex_lock
();
if
(
!
dirty_rect
)
hr
=
IWineD3D
Texture_AddDirtyRegion
(
texture
->
wineD3DT
exture
,
0
,
NULL
);
hr
=
IWineD3D
BaseTexture_AddDirtyRegion
(
texture
->
wined3d_t
exture
,
0
,
NULL
);
else
{
WINED3DBOX
dirty_region
;
...
...
@@ -360,7 +360,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(IDirect3DTexture8 *ifac
dirty_region
.
Bottom
=
dirty_rect
->
bottom
;
dirty_region
.
Front
=
0
;
dirty_region
.
Back
=
1
;
hr
=
IWineD3D
Texture_AddDirtyRegion
(
texture
->
wineD3DT
exture
,
0
,
&
dirty_region
);
hr
=
IWineD3D
BaseTexture_AddDirtyRegion
(
texture
->
wined3d_t
exture
,
0
,
&
dirty_region
);
}
wined3d_mutex_unlock
();
...
...
@@ -415,7 +415,7 @@ HRESULT texture_init(IDirect3DTexture8Impl *texture, IDirect3DDevice8Impl *devic
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_CreateTexture
(
device
->
WineD3DDevice
,
width
,
height
,
levels
,
usage
&
WINED3DUSAGE_MASK
,
wined3dformat_from_d3dformat
(
format
),
pool
,
texture
,
&
d3d8_texture_wined3d_parent_ops
,
&
texture
->
wine
D3DT
exture
);
texture
,
&
d3d8_texture_wined3d_parent_ops
,
&
texture
->
wine
d3d_t
exture
);
wined3d_mutex_unlock
();
if
(
FAILED
(
hr
))
{
...
...
dlls/d3d9/d3d9_private.h
View file @
f1ec3820
...
...
@@ -353,15 +353,10 @@ HRESULT cubetexture_init(IDirect3DCubeTexture9Impl *texture, IDirect3DDevice9Imp
*/
typedef
struct
IDirect3DTexture9Impl
{
/* IUnknown fields */
const
IDirect3DTexture9Vtbl
*
lpVtbl
;
LONG
ref
;
/* IDirect3DResource9 fields */
IWineD3DTexture
*
wineD3DTexture
;
/* Parent reference */
LPDIRECT3DDEVICE9EX
parentDevice
;
IWineD3DBaseTexture
*
wined3d_texture
;
IDirect3DDevice9Ex
*
parentDevice
;
}
IDirect3DTexture9Impl
;
HRESULT
texture_init
(
IDirect3DTexture9Impl
*
texture
,
IDirect3DDevice9Impl
*
device
,
...
...
dlls/d3d9/texture.c
View file @
f1ec3820
...
...
@@ -55,7 +55,7 @@ static ULONG WINAPI IDirect3DTexture9Impl_AddRef(LPDIRECT3DTEXTURE9 iface) {
{
IDirect3DDevice9Ex_AddRef
(
This
->
parentDevice
);
wined3d_mutex_lock
();
IWineD3D
Texture_AddRef
(
This
->
wineD3DT
exture
);
IWineD3D
BaseTexture_AddRef
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
}
...
...
@@ -72,7 +72,7 @@ static ULONG WINAPI IDirect3DTexture9Impl_Release(LPDIRECT3DTEXTURE9 iface) {
IDirect3DDevice9Ex
*
parentDevice
=
This
->
parentDevice
;
wined3d_mutex_lock
();
IWineD3D
Texture_Release
(
This
->
wineD3DT
exture
);
IWineD3D
BaseTexture_Release
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
/* Release the device last, as it may cause the device to be destroyed. */
...
...
@@ -104,7 +104,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_SetPrivateData(LPDIRECT3DTEXTURE9 if
iface
,
debugstr_guid
(
refguid
),
pData
,
SizeOfData
,
Flags
);
wined3d_mutex_lock
();
hr
=
IWineD3D
Texture_SetPrivateData
(
This
->
wineD3DT
exture
,
refguid
,
pData
,
SizeOfData
,
Flags
);
hr
=
IWineD3D
BaseTexture_SetPrivateData
(
This
->
wined3d_t
exture
,
refguid
,
pData
,
SizeOfData
,
Flags
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -118,7 +118,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_GetPrivateData(LPDIRECT3DTEXTURE9 if
iface
,
debugstr_guid
(
refguid
),
pData
,
pSizeOfData
);
wined3d_mutex_lock
();
hr
=
IWineD3D
Texture_GetPrivateData
(
This
->
wineD3DT
exture
,
refguid
,
pData
,
pSizeOfData
);
hr
=
IWineD3D
BaseTexture_GetPrivateData
(
This
->
wined3d_t
exture
,
refguid
,
pData
,
pSizeOfData
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -131,7 +131,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_FreePrivateData(LPDIRECT3DTEXTURE9 i
TRACE
(
"iface %p, guid %s.
\n
"
,
iface
,
debugstr_guid
(
refguid
));
wined3d_mutex_lock
();
hr
=
IWineD3D
Texture_FreePrivateData
(
This
->
wineD3DT
exture
,
refguid
);
hr
=
IWineD3D
BaseTexture_FreePrivateData
(
This
->
wined3d_t
exture
,
refguid
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -144,7 +144,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_SetPriority(LPDIRECT3DTEXTURE9 iface,
TRACE
(
"iface %p, priority %u.
\n
"
,
iface
,
PriorityNew
);
wined3d_mutex_lock
();
ret
=
IWineD3D
Texture_SetPriority
(
This
->
wineD3DT
exture
,
PriorityNew
);
ret
=
IWineD3D
BaseTexture_SetPriority
(
This
->
wined3d_t
exture
,
PriorityNew
);
wined3d_mutex_unlock
();
return
ret
;
...
...
@@ -157,7 +157,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_GetPriority(LPDIRECT3DTEXTURE9 iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
ret
=
IWineD3D
Texture_GetPriority
(
This
->
wineD3DT
exture
);
ret
=
IWineD3D
BaseTexture_GetPriority
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
return
ret
;
...
...
@@ -169,7 +169,7 @@ static void WINAPI IDirect3DTexture9Impl_PreLoad(LPDIRECT3DTEXTURE9 iface) {
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
IWineD3D
Texture_PreLoad
(
This
->
wineD3DT
exture
);
IWineD3D
BaseTexture_PreLoad
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
}
...
...
@@ -180,7 +180,7 @@ static D3DRESOURCETYPE WINAPI IDirect3DTexture9Impl_GetType(LPDIRECT3DTEXTURE9 i
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
ret
=
IWineD3D
Texture_GetType
(
This
->
wineD3DT
exture
);
ret
=
IWineD3D
BaseTexture_GetType
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
return
ret
;
...
...
@@ -194,7 +194,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_SetLOD(LPDIRECT3DTEXTURE9 iface, DWORD
TRACE
(
"iface %p, lod %u.
\n
"
,
iface
,
LODNew
);
wined3d_mutex_lock
();
ret
=
IWineD3D
Texture_SetLOD
(
This
->
wineD3DT
exture
,
LODNew
);
ret
=
IWineD3D
BaseTexture_SetLOD
(
This
->
wined3d_t
exture
,
LODNew
);
wined3d_mutex_unlock
();
return
ret
;
...
...
@@ -207,7 +207,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_GetLOD(LPDIRECT3DTEXTURE9 iface) {
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
ret
=
IWineD3D
Texture_GetLOD
(
This
->
wineD3DT
exture
);
ret
=
IWineD3D
BaseTexture_GetLOD
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
return
ret
;
...
...
@@ -220,7 +220,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_GetLevelCount(LPDIRECT3DTEXTURE9 iface
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
ret
=
IWineD3D
Texture_GetLevelCount
(
This
->
wineD3DT
exture
);
ret
=
IWineD3D
BaseTexture_GetLevelCount
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
return
ret
;
...
...
@@ -233,7 +233,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_SetAutoGenFilterType(LPDIRECT3DTEXTU
TRACE
(
"iface %p, filter_type %#x.
\n
"
,
iface
,
FilterType
);
wined3d_mutex_lock
();
hr
=
IWineD3D
Texture_SetAutoGenFilterType
(
This
->
wineD3DTexture
,
(
WINED3DTEXTUREFILTERTYPE
)
FilterType
);
hr
=
IWineD3D
BaseTexture_SetAutoGenFilterType
(
This
->
wined3d_texture
,
(
WINED3DTEXTUREFILTERTYPE
)
FilterType
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -246,7 +246,7 @@ static D3DTEXTUREFILTERTYPE WINAPI IDirect3DTexture9Impl_GetAutoGenFilterType(LP
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
ret
=
(
D3DTEXTUREFILTERTYPE
)
IWineD3DTexture_GetAutoGenFilterType
(
This
->
wineD3DT
exture
);
ret
=
(
D3DTEXTUREFILTERTYPE
)
IWineD3DBaseTexture_GetAutoGenFilterType
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
return
ret
;
...
...
@@ -258,7 +258,7 @@ static void WINAPI IDirect3DTexture9Impl_GenerateMipSubLevels(LPDIRECT3DTEXTURE9
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
IWineD3D
Texture_GenerateMipSubLevels
(
This
->
wineD3DT
exture
);
IWineD3D
BaseTexture_GenerateMipSubLevels
(
This
->
wined3d_t
exture
);
wined3d_mutex_unlock
();
}
...
...
@@ -272,7 +272,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_GetLevelDesc(IDirect3DTexture9 *ifac
TRACE
(
"iface %p, level %u, desc %p.
\n
"
,
iface
,
level
,
desc
);
wined3d_mutex_lock
();
if
(
!
(
sub_resource
=
IWineD3D
Texture_GetSubResource
(
texture
->
wineD3DT
exture
,
level
)))
if
(
!
(
sub_resource
=
IWineD3D
BaseTexture_GetSubResource
(
texture
->
wined3d_t
exture
,
level
)))
hr
=
D3DERR_INVALIDCALL
;
else
{
...
...
@@ -302,7 +302,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_GetSurfaceLevel(IDirect3DTexture9 *i
TRACE
(
"iface %p, level %u, surface %p.
\n
"
,
iface
,
level
,
surface
);
wined3d_mutex_lock
();
if
(
!
(
sub_resource
=
IWineD3D
Texture_GetSubResource
(
texture
->
wineD3DT
exture
,
level
)))
if
(
!
(
sub_resource
=
IWineD3D
BaseTexture_GetSubResource
(
texture
->
wined3d_t
exture
,
level
)))
{
wined3d_mutex_unlock
();
return
D3DERR_INVALIDCALL
;
...
...
@@ -326,7 +326,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_LockRect(IDirect3DTexture9 *iface,
iface
,
level
,
locked_rect
,
rect
,
flags
);
wined3d_mutex_lock
();
if
(
!
(
sub_resource
=
IWineD3D
Texture_GetSubResource
(
texture
->
wineD3DT
exture
,
level
)))
if
(
!
(
sub_resource
=
IWineD3D
BaseTexture_GetSubResource
(
texture
->
wined3d_t
exture
,
level
)))
hr
=
D3DERR_INVALIDCALL
;
else
hr
=
IDirect3DSurface9_LockRect
((
IDirect3DSurface9
*
)
wined3d_resource_get_parent
(
sub_resource
),
...
...
@@ -345,7 +345,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_UnlockRect(IDirect3DTexture9 *iface,
TRACE
(
"iface %p, level %u.
\n
"
,
iface
,
level
);
wined3d_mutex_lock
();
if
(
!
(
sub_resource
=
IWineD3D
Texture_GetSubResource
(
texture
->
wineD3DT
exture
,
level
)))
if
(
!
(
sub_resource
=
IWineD3D
BaseTexture_GetSubResource
(
texture
->
wined3d_t
exture
,
level
)))
hr
=
D3DERR_INVALIDCALL
;
else
hr
=
IDirect3DSurface9_UnlockRect
((
IDirect3DSurface9
*
)
wined3d_resource_get_parent
(
sub_resource
));
...
...
@@ -364,7 +364,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_AddDirtyRect(IDirect3DTexture9 *ifac
wined3d_mutex_lock
();
if
(
!
dirty_rect
)
hr
=
IWineD3D
Texture_AddDirtyRegion
(
texture
->
wineD3DT
exture
,
0
,
NULL
);
hr
=
IWineD3D
BaseTexture_AddDirtyRegion
(
texture
->
wined3d_t
exture
,
0
,
NULL
);
else
{
WINED3DBOX
dirty_region
;
...
...
@@ -375,7 +375,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_AddDirtyRect(IDirect3DTexture9 *ifac
dirty_region
.
Bottom
=
dirty_rect
->
bottom
;
dirty_region
.
Front
=
0
;
dirty_region
.
Back
=
1
;
hr
=
IWineD3D
Texture_AddDirtyRegion
(
texture
->
wineD3DT
exture
,
0
,
&
dirty_region
);
hr
=
IWineD3D
BaseTexture_AddDirtyRegion
(
texture
->
wined3d_t
exture
,
0
,
&
dirty_region
);
}
wined3d_mutex_unlock
();
...
...
@@ -433,7 +433,7 @@ HRESULT texture_init(IDirect3DTexture9Impl *texture, IDirect3DDevice9Impl *devic
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_CreateTexture
(
device
->
WineD3DDevice
,
width
,
height
,
levels
,
usage
&
WINED3DUSAGE_MASK
,
wined3dformat_from_d3dformat
(
format
),
pool
,
texture
,
&
d3d9_texture_wined3d_parent_ops
,
&
texture
->
wine
D3DT
exture
);
texture
,
&
d3d9_texture_wined3d_parent_ops
,
&
texture
->
wine
d3d_t
exture
);
wined3d_mutex_unlock
();
if
(
FAILED
(
hr
))
{
...
...
dlls/ddraw/ddraw.c
View file @
f1ec3820
...
...
@@ -3444,8 +3444,7 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
else
{
hr
=
IWineD3DDevice_CreateTexture
(
ddraw
->
wineD3DDevice
,
DDSD
->
dwWidth
,
DDSD
->
dwHeight
,
levels
,
0
,
Format
,
Pool
,
object
,
&
ddraw_null_wined3d_parent_ops
,
(
IWineD3DTexture
**
)
&
object
->
wineD3DTexture
);
levels
,
0
,
Format
,
Pool
,
object
,
&
ddraw_null_wined3d_parent_ops
,
&
object
->
wineD3DTexture
);
}
ddraw
->
tex_root
=
NULL
;
}
...
...
dlls/wined3d/device.c
View file @
f1ec3820
...
...
@@ -1101,21 +1101,21 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateRendertargetView(IWineD3DDevice *
static
HRESULT
WINAPI
IWineD3DDeviceImpl_CreateTexture
(
IWineD3DDevice
*
iface
,
UINT
Width
,
UINT
Height
,
UINT
Levels
,
DWORD
Usage
,
enum
wined3d_format_id
Format
,
WINED3DPOOL
Pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
IWineD3D
Texture
**
ppT
exture
)
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
IWineD3D
BaseTexture
**
t
exture
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DTextureImpl
*
object
;
HRESULT
hr
;
TRACE
(
"(%p) : Width %d, Height %d, Levels %d, Usage %#x
\n
"
,
This
,
Width
,
Height
,
Levels
,
Usage
);
TRACE
(
"Format %#x (%s), Pool %#x,
ppT
exture %p, parent %p
\n
"
,
Format
,
debug_d3dformat
(
Format
),
Pool
,
ppT
exture
,
parent
);
TRACE
(
"Format %#x (%s), Pool %#x,
t
exture %p, parent %p
\n
"
,
Format
,
debug_d3dformat
(
Format
),
Pool
,
t
exture
,
parent
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Out of memory
\n
"
);
*
ppT
exture
=
NULL
;
*
t
exture
=
NULL
;
return
WINED3DERR_OUTOFVIDEOMEMORY
;
}
...
...
@@ -1124,11 +1124,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
{
WARN
(
"Failed to initialize texture, returning %#x
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
ppT
exture
=
NULL
;
*
t
exture
=
NULL
;
return
hr
;
}
*
ppTexture
=
(
IWineD3D
Texture
*
)
object
;
*
texture
=
(
IWineD3DBase
Texture
*
)
object
;
TRACE
(
"(%p) : Created texture %p
\n
"
,
This
,
object
);
...
...
dlls/wined3d/texture.c
View file @
f1ec3820
/*
* IWineD3DTexture implementation
*
* Copyright 2002-2005 Jason Edmeades
* Copyright 2002-2005 Raphael Junqueira
* Copyright 2005 Oliver Stieber
...
...
@@ -221,19 +219,15 @@ static void texture_cleanup(IWineD3DTextureImpl *This)
basetexture_cleanup
((
IWineD3DBaseTextureImpl
*
)
This
);
}
/* *******************************************
IWineD3DTexture IUnknown parts follow
******************************************* */
static
HRESULT
WINAPI
IWineD3DTextureImpl_QueryInterface
(
IWineD3DTexture
*
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
static
HRESULT
WINAPI
IWineD3DTextureImpl_QueryInterface
(
IWineD3DBaseTexture
*
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IWineD3DTextureImpl
*
This
=
(
IWineD3DTextureImpl
*
)
iface
;
TRACE
(
"(%p)->(%s,%p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IWineD3DBase
)
||
IsEqualGUID
(
riid
,
&
IID_IWineD3DResource
)
||
IsEqualGUID
(
riid
,
&
IID_IWineD3DBaseTexture
)
||
IsEqualGUID
(
riid
,
&
IID_IWineD3DTexture
))
{
||
IsEqualGUID
(
riid
,
&
IID_IWineD3DBaseTexture
)
)
{
IUnknown_AddRef
(
iface
);
*
ppobj
=
This
;
return
WINED3D_OK
;
...
...
@@ -242,14 +236,16 @@ static HRESULT WINAPI IWineD3DTextureImpl_QueryInterface(IWineD3DTexture *iface,
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IWineD3DTextureImpl_AddRef
(
IWineD3DTexture
*
iface
)
{
static
ULONG
WINAPI
IWineD3DTextureImpl_AddRef
(
IWineD3DBaseTexture
*
iface
)
{
IWineD3DTextureImpl
*
This
=
(
IWineD3DTextureImpl
*
)
iface
;
TRACE
(
"(%p) : AddRef increasing from %d
\n
"
,
This
,
This
->
resource
.
ref
);
return
InterlockedIncrement
(
&
This
->
resource
.
ref
);
}
/* Do not call while under the GL lock. */
static
ULONG
WINAPI
IWineD3DTextureImpl_Release
(
IWineD3DTexture
*
iface
)
{
static
ULONG
WINAPI
IWineD3DTextureImpl_Release
(
IWineD3DBaseTexture
*
iface
)
{
IWineD3DTextureImpl
*
This
=
(
IWineD3DTextureImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p) : Releasing from %d
\n
"
,
This
,
This
->
resource
.
ref
);
...
...
@@ -263,95 +259,91 @@ static ULONG WINAPI IWineD3DTextureImpl_Release(IWineD3DTexture *iface) {
return
ref
;
}
/* ****************************************************
IWineD3DTexture IWineD3DResource parts follow
**************************************************** */
static
HRESULT
WINAPI
IWineD3DTextureImpl_SetPrivateData
(
IWineD3DTexture
*
iface
,
static
HRESULT
WINAPI
IWineD3DTextureImpl_SetPrivateData
(
IWineD3DBaseTexture
*
iface
,
REFGUID
riid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
return
resource_set_private_data
(
&
((
IWineD3DTextureImpl
*
)
iface
)
->
resource
,
riid
,
data
,
data_size
,
flags
);
}
static
HRESULT
WINAPI
IWineD3DTextureImpl_GetPrivateData
(
IWineD3DTexture
*
iface
,
static
HRESULT
WINAPI
IWineD3DTextureImpl_GetPrivateData
(
IWineD3D
Base
Texture
*
iface
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
{
return
resource_get_private_data
(
&
((
IWineD3DTextureImpl
*
)
iface
)
->
resource
,
guid
,
data
,
data_size
);
}
static
HRESULT
WINAPI
IWineD3DTextureImpl_FreePrivateData
(
IWineD3DTexture
*
iface
,
REFGUID
refguid
)
static
HRESULT
WINAPI
IWineD3DTextureImpl_FreePrivateData
(
IWineD3D
Base
Texture
*
iface
,
REFGUID
refguid
)
{
return
resource_free_private_data
(
&
((
IWineD3DTextureImpl
*
)
iface
)
->
resource
,
refguid
);
}
static
DWORD
WINAPI
IWineD3DTextureImpl_SetPriority
(
IWineD3DTexture
*
iface
,
DWORD
priority
)
static
DWORD
WINAPI
IWineD3DTextureImpl_SetPriority
(
IWineD3D
Base
Texture
*
iface
,
DWORD
priority
)
{
return
resource_set_priority
(
&
((
IWineD3DTextureImpl
*
)
iface
)
->
resource
,
priority
);
}
static
DWORD
WINAPI
IWineD3DTextureImpl_GetPriority
(
IWineD3DTexture
*
iface
)
static
DWORD
WINAPI
IWineD3DTextureImpl_GetPriority
(
IWineD3D
Base
Texture
*
iface
)
{
return
resource_get_priority
(
&
((
IWineD3DTextureImpl
*
)
iface
)
->
resource
);
}
/* Do not call while under the GL lock. */
static
void
WINAPI
IWineD3DTextureImpl_PreLoad
(
IWineD3DTexture
*
iface
)
static
void
WINAPI
IWineD3DTextureImpl_PreLoad
(
IWineD3D
Base
Texture
*
iface
)
{
texture_preload
((
IWineD3DBaseTextureImpl
*
)
iface
,
SRGB_ANY
);
}
static
WINED3DRESOURCETYPE
WINAPI
IWineD3DTextureImpl_GetType
(
IWineD3DTexture
*
iface
)
static
WINED3DRESOURCETYPE
WINAPI
IWineD3DTextureImpl_GetType
(
IWineD3D
Base
Texture
*
iface
)
{
return
resource_get_type
(
&
((
IWineD3DTextureImpl
*
)
iface
)
->
resource
);
}
static
void
*
WINAPI
IWineD3DTextureImpl_GetParent
(
IWineD3DTexture
*
iface
)
static
void
*
WINAPI
IWineD3DTextureImpl_GetParent
(
IWineD3D
Base
Texture
*
iface
)
{
TRACE
(
"iface %p.
\n
"
,
iface
);
return
((
IWineD3DTextureImpl
*
)
iface
)
->
resource
.
parent
;
}
/* ******************************************************
IWineD3DTexture IWineD3DBaseTexture parts follow
****************************************************** */
static
DWORD
WINAPI
IWineD3DTextureImpl_SetLOD
(
IWineD3DTexture
*
iface
,
DWORD
LODNew
)
{
static
DWORD
WINAPI
IWineD3DTextureImpl_SetLOD
(
IWineD3DBaseTexture
*
iface
,
DWORD
LODNew
)
{
return
basetexture_set_lod
((
IWineD3DBaseTextureImpl
*
)
iface
,
LODNew
);
}
static
DWORD
WINAPI
IWineD3DTextureImpl_GetLOD
(
IWineD3DTexture
*
iface
)
{
static
DWORD
WINAPI
IWineD3DTextureImpl_GetLOD
(
IWineD3DBaseTexture
*
iface
)
{
return
basetexture_get_lod
((
IWineD3DBaseTextureImpl
*
)
iface
);
}
static
DWORD
WINAPI
IWineD3DTextureImpl_GetLevelCount
(
IWineD3DTexture
*
iface
)
static
DWORD
WINAPI
IWineD3DTextureImpl_GetLevelCount
(
IWineD3D
Base
Texture
*
iface
)
{
return
basetexture_get_level_count
((
IWineD3DBaseTextureImpl
*
)
iface
);
}
static
HRESULT
WINAPI
IWineD3DTextureImpl_SetAutoGenFilterType
(
IWineD3DTexture
*
iface
,
static
HRESULT
WINAPI
IWineD3DTextureImpl_SetAutoGenFilterType
(
IWineD3D
Base
Texture
*
iface
,
WINED3DTEXTUREFILTERTYPE
FilterType
)
{
return
basetexture_set_autogen_filter_type
((
IWineD3DBaseTextureImpl
*
)
iface
,
FilterType
);
}
static
WINED3DTEXTUREFILTERTYPE
WINAPI
IWineD3DTextureImpl_GetAutoGenFilterType
(
IWineD3DTexture
*
iface
)
static
WINED3DTEXTUREFILTERTYPE
WINAPI
IWineD3DTextureImpl_GetAutoGenFilterType
(
IWineD3D
Base
Texture
*
iface
)
{
return
basetexture_get_autogen_filter_type
((
IWineD3DBaseTextureImpl
*
)
iface
);
}
static
void
WINAPI
IWineD3DTextureImpl_GenerateMipSubLevels
(
IWineD3DTexture
*
iface
)
static
void
WINAPI
IWineD3DTextureImpl_GenerateMipSubLevels
(
IWineD3D
Base
Texture
*
iface
)
{
basetexture_generate_mipmaps
((
IWineD3DBaseTextureImpl
*
)
iface
);
}
static
BOOL
WINAPI
IWineD3DTextureImpl_IsCondNP2
(
IWineD3DTexture
*
iface
)
{
static
BOOL
WINAPI
IWineD3DTextureImpl_IsCondNP2
(
IWineD3DBaseTexture
*
iface
)
{
IWineD3DTextureImpl
*
This
=
(
IWineD3DTextureImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
cond_np2
;
}
static
struct
wined3d_resource
*
WINAPI
IWineD3DTextureImpl_GetSubResource
(
IWineD3DTexture
*
iface
,
static
struct
wined3d_resource
*
WINAPI
IWineD3DTextureImpl_GetSubResource
(
IWineD3D
Base
Texture
*
iface
,
UINT
sub_resource_idx
)
{
IWineD3DBaseTextureImpl
*
texture
=
(
IWineD3DBaseTextureImpl
*
)
iface
;
...
...
@@ -361,7 +353,7 @@ static struct wined3d_resource * WINAPI IWineD3DTextureImpl_GetSubResource(IWine
return
basetexture_get_sub_resource
(
texture
,
sub_resource_idx
);
}
static
HRESULT
WINAPI
IWineD3DTextureImpl_AddDirtyRegion
(
IWineD3DTexture
*
iface
,
static
HRESULT
WINAPI
IWineD3DTextureImpl_AddDirtyRegion
(
IWineD3D
Base
Texture
*
iface
,
UINT
layer
,
const
WINED3DBOX
*
dirty_region
)
{
IWineD3DBaseTextureImpl
*
texture
=
(
IWineD3DBaseTextureImpl
*
)
iface
;
...
...
@@ -381,7 +373,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRegion(IWineD3DTexture *iface,
return
WINED3D_OK
;
}
static
const
IWineD3DTextureVtbl
IWineD3DTexture_Vtbl
=
static
const
IWineD3D
Base
TextureVtbl
IWineD3DTexture_Vtbl
=
{
/* IUnknown */
IWineD3DTextureImpl_QueryInterface
,
...
...
dlls/wined3d/wined3d_private.h
View file @
f1ec3820
...
...
@@ -1953,17 +1953,11 @@ void basetexture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty) DECLSPE
DWORD
basetexture_set_lod
(
IWineD3DBaseTextureImpl
*
texture
,
DWORD
lod
)
DECLSPEC_HIDDEN
;
void
basetexture_unload
(
IWineD3DBaseTextureImpl
*
texture
)
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IWineD3DTexture implementation structure (extends IWineD3DBaseTextureImpl)
*/
typedef
struct
IWineD3DTextureImpl
{
/* IUnknown & WineD3DResource/WineD3DBaseTexture Information */
const
IWineD3DTextureVtbl
*
lpVtbl
;
const
IWineD3DBaseTextureVtbl
*
lpVtbl
;
struct
wined3d_resource
resource
;
IWineD3DBaseTextureClass
baseTexture
;
/* IWineD3DTexture */
BOOL
cond_np2
;
}
IWineD3DTextureImpl
;
...
...
include/wine/wined3d.idl
View file @
f1ec3820
...
...
@@ -2370,15 +2370,6 @@ interface IWineD3DBaseTexture : IWineD3DResource
[
object
,
local
,
uuid
(
3
e72cc1c
-
6
f30
-
11
d9
-
c687
-
00046142
c14f
)
]
interface
IWineD3DTexture
:
IWineD3DBaseTexture
{
}
[
object
,
local
,
uuid
(
41752900
-
6
f30
-
11
d9
-
c687
-
00046142
c14f
)
]
interface
IWineD3DCubeTexture
:
IWineD3DBaseTexture
...
...
@@ -2542,7 +2533,7 @@ interface IWineD3DDevice : IUnknown
[
in
]
WINED3DPOOL
pool
,
[
in
]
void
*
parent
,
[
in
]
const
struct
wined3d_parent_ops
*
parent_ops
,
[
out
]
IWineD3DTexture
**
texture
[
out
]
IWineD3D
Base
Texture
**
texture
)
;
HRESULT
CreateVolumeTexture
(
[
in
]
UINT
width
,
...
...
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