Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b8d07a2b
Commit
b8d07a2b
authored
Apr 16, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Get rid of IDirect3DCubeTexture8Impl.
parent
7bb17f49
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
131 deletions
+108
-131
cubetexture.c
dlls/d3d8/cubetexture.c
+101
-108
d3d8_private.h
dlls/d3d8/d3d8_private.h
+2
-18
device.c
dlls/d3d8/device.c
+3
-3
texture.c
dlls/d3d8/texture.c
+2
-2
No files found.
dlls/d3d8/cubetexture.c
View file @
b8d07a2b
...
...
@@ -23,15 +23,14 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d8
);
static
inline
IDirect3DCubeTexture8Impl
*
impl_from_IDirect3DCubeTexture8
(
IDirect3DCubeTexture8
*
iface
)
static
inline
struct
d3d8_texture
*
impl_from_IDirect3DCubeTexture8
(
IDirect3DCubeTexture8
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DCubeTexture8Impl
,
IDirect3DCub
eTexture8_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d8_texture
,
IDirect3DBas
eTexture8_iface
);
}
static
HRESULT
WINAPI
IDirect3DCubeTexture8Impl_QueryInterface
(
IDirect3DCubeTexture8
*
iface
,
REFIID
riid
,
void
**
ppobj
)
static
HRESULT
WINAPI
d3d8_texture_cube_QueryInterface
(
IDirect3DCubeTexture8
*
iface
,
REFIID
riid
,
void
**
out
)
{
TRACE
(
"iface %p, riid %s, o
bject %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppobj
);
TRACE
(
"iface %p, riid %s, o
ut %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
riid
,
&
IID_IDirect3DCubeTexture8
)
||
IsEqualGUID
(
riid
,
&
IID_IDirect3DBaseTexture8
)
...
...
@@ -39,65 +38,64 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_QueryInterface(IDirect3DCubeText
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IUnknown_AddRef
(
iface
);
*
ppobj
=
iface
;
*
out
=
iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
ppobj
=
NULL
;
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IDirect3DCubeTexture8Impl
_AddRef
(
IDirect3DCubeTexture8
*
iface
)
static
ULONG
WINAPI
d3d8_texture_cube
_AddRef
(
IDirect3DCubeTexture8
*
iface
)
{
IDirect3DCubeTexture8Impl
*
This
=
impl_from_IDirect3DCubeTexture8
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
texture
->
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
ref
);
if
(
ref
==
1
)
{
IUnknown_AddRef
(
This
->
parentD
evice
);
IUnknown_AddRef
(
texture
->
parent_d
evice
);
wined3d_mutex_lock
();
wined3d_texture_incref
(
This
->
wined3d_texture
);
wined3d_texture_incref
(
texture
->
wined3d_texture
);
wined3d_mutex_unlock
();
}
return
ref
;
}
static
ULONG
WINAPI
IDirect3DCubeTexture8Impl
_Release
(
IDirect3DCubeTexture8
*
iface
)
static
ULONG
WINAPI
d3d8_texture_cube
_Release
(
IDirect3DCubeTexture8
*
iface
)
{
IDirect3DCubeTexture8Impl
*
This
=
impl_from_IDirect3DCubeTexture8
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
texture
->
refcount
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
ref
);
if
(
ref
==
0
)
{
IDirect3DDevice8
*
parentDevice
=
This
->
parentDevice
;
if
(
!
ref
)
{
IDirect3DDevice8
*
parent_device
=
texture
->
parent_device
;
TRACE
(
"Releasing child %p.
\n
"
,
This
->
wined3d_texture
);
TRACE
(
"Releasing child %p.
\n
"
,
texture
->
wined3d_texture
);
wined3d_mutex_lock
();
wined3d_texture_decref
(
This
->
wined3d_texture
);
wined3d_texture_decref
(
texture
->
wined3d_texture
);
wined3d_mutex_unlock
();
/* Release the device last, as it may cause the device to be destroyed. */
IDirect3DDevice8_Release
(
parent
D
evice
);
IDirect3DDevice8_Release
(
parent
_d
evice
);
}
return
ref
;
}
/* IDirect3DCubeTexture8 IDirect3DResource8 Interface follow: */
static
HRESULT
WINAPI
IDirect3DCubeTexture8Impl_GetDevice
(
IDirect3DCubeTexture8
*
iface
,
IDirect3DDevice8
**
device
)
static
HRESULT
WINAPI
d3d8_texture_cube_GetDevice
(
IDirect3DCubeTexture8
*
iface
,
IDirect3DDevice8
**
device
)
{
IDirect3DCubeTexture8Impl
*
This
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
This
->
parentD
evice
;
*
device
=
texture
->
parent_d
evice
;
IDirect3DDevice8_AddRef
(
*
device
);
TRACE
(
"Returning device %p.
\n
"
,
*
device
);
...
...
@@ -105,154 +103,149 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetDevice(IDirect3DCubeTexture8
return
D3D_OK
;
}
static
HRESULT
WINAPI
IDirect3DCubeTexture8Impl
_SetPrivateData
(
IDirect3DCubeTexture8
*
iface
,
REFGUID
refguid
,
const
void
*
pData
,
DWORD
SizeOfData
,
DWORD
F
lags
)
static
HRESULT
WINAPI
d3d8_texture_cube
_SetPrivateData
(
IDirect3DCubeTexture8
*
iface
,
REFGUID
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
f
lags
)
{
IDirect3DCubeTexture8Impl
*
This
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
wined3d_resource
*
resource
;
HRESULT
hr
;
TRACE
(
"iface %p, guid %s, data %p, data_size %u, flags %#x.
\n
"
,
iface
,
debugstr_guid
(
refguid
),
pData
,
SizeOfData
,
F
lags
);
iface
,
debugstr_guid
(
guid
),
data
,
data_size
,
f
lags
);
wined3d_mutex_lock
();
resource
=
wined3d_texture_get_resource
(
This
->
wined3d_texture
);
hr
=
wined3d_resource_set_private_data
(
resource
,
refguid
,
pData
,
SizeOfData
,
F
lags
);
resource
=
wined3d_texture_get_resource
(
texture
->
wined3d_texture
);
hr
=
wined3d_resource_set_private_data
(
resource
,
guid
,
data
,
data_size
,
f
lags
);
wined3d_mutex_unlock
();
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DCubeTexture8Impl
_GetPrivateData
(
IDirect3DCubeTexture8
*
iface
,
REFGUID
refguid
,
void
*
pData
,
DWORD
*
pSizeOfData
)
static
HRESULT
WINAPI
d3d8_texture_cube
_GetPrivateData
(
IDirect3DCubeTexture8
*
iface
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
{
IDirect3DCubeTexture8Impl
*
This
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
wined3d_resource
*
resource
;
HRESULT
hr
;
TRACE
(
"iface %p, guid %s, data %p, data_size %p.
\n
"
,
iface
,
debugstr_guid
(
refguid
),
pData
,
pSizeOfData
);
iface
,
debugstr_guid
(
guid
),
data
,
data_size
);
wined3d_mutex_lock
();
resource
=
wined3d_texture_get_resource
(
This
->
wined3d_texture
);
hr
=
wined3d_resource_get_private_data
(
resource
,
refguid
,
pData
,
pSizeOfData
);
resource
=
wined3d_texture_get_resource
(
texture
->
wined3d_texture
);
hr
=
wined3d_resource_get_private_data
(
resource
,
guid
,
data
,
data_size
);
wined3d_mutex_unlock
();
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DCubeTexture8Impl_FreePrivateData
(
IDirect3DCubeTexture8
*
iface
,
REFGUID
refguid
)
static
HRESULT
WINAPI
d3d8_texture_cube_FreePrivateData
(
IDirect3DCubeTexture8
*
iface
,
REFGUID
guid
)
{
IDirect3DCubeTexture8Impl
*
This
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
wined3d_resource
*
resource
;
HRESULT
hr
;
TRACE
(
"iface %p, guid %s.
\n
"
,
iface
,
debugstr_guid
(
ref
guid
));
TRACE
(
"iface %p, guid %s.
\n
"
,
iface
,
debugstr_guid
(
guid
));
wined3d_mutex_lock
();
resource
=
wined3d_texture_get_resource
(
This
->
wined3d_texture
);
hr
=
wined3d_resource_free_private_data
(
resource
,
ref
guid
);
resource
=
wined3d_texture_get_resource
(
texture
->
wined3d_texture
);
hr
=
wined3d_resource_free_private_data
(
resource
,
guid
);
wined3d_mutex_unlock
();
return
hr
;
}
static
DWORD
WINAPI
IDirect3DCubeTexture8Impl_SetPriority
(
IDirect3DCubeTexture8
*
iface
,
DWORD
PriorityNew
)
static
DWORD
WINAPI
d3d8_texture_cube_SetPriority
(
IDirect3DCubeTexture8
*
iface
,
DWORD
priority
)
{
IDirect3DCubeTexture8Impl
*
This
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
DWORD
ret
;
TRACE
(
"iface %p, priority %u.
\n
"
,
iface
,
PriorityNew
);
TRACE
(
"iface %p, priority %u.
\n
"
,
iface
,
priority
);
wined3d_mutex_lock
();
ret
=
wined3d_texture_set_priority
(
This
->
wined3d_texture
,
PriorityNew
);
ret
=
wined3d_texture_set_priority
(
texture
->
wined3d_texture
,
priority
);
wined3d_mutex_unlock
();
return
ret
;
}
static
DWORD
WINAPI
IDirect3DCubeTexture8Impl
_GetPriority
(
IDirect3DCubeTexture8
*
iface
)
static
DWORD
WINAPI
d3d8_texture_cube
_GetPriority
(
IDirect3DCubeTexture8
*
iface
)
{
IDirect3DCubeTexture8Impl
*
This
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
DWORD
ret
;
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
ret
=
wined3d_texture_get_priority
(
This
->
wined3d_texture
);
ret
=
wined3d_texture_get_priority
(
texture
->
wined3d_texture
);
wined3d_mutex_unlock
();
return
ret
;
}
static
void
WINAPI
IDirect3DCubeTexture8Impl
_PreLoad
(
IDirect3DCubeTexture8
*
iface
)
static
void
WINAPI
d3d8_texture_cube
_PreLoad
(
IDirect3DCubeTexture8
*
iface
)
{
IDirect3DCubeTexture8Impl
*
This
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_texture_preload
(
This
->
wined3d_texture
);
wined3d_texture_preload
(
texture
->
wined3d_texture
);
wined3d_mutex_unlock
();
}
static
D3DRESOURCETYPE
WINAPI
IDirect3DCubeTexture8Impl
_GetType
(
IDirect3DCubeTexture8
*
iface
)
static
D3DRESOURCETYPE
WINAPI
d3d8_texture_cube
_GetType
(
IDirect3DCubeTexture8
*
iface
)
{
TRACE
(
"iface %p.
\n
"
,
iface
);
return
D3DRTYPE_CUBETEXTURE
;
}
/* IDirect3DCubeTexture8 IDirect3DBaseTexture8 Interface follow: */
static
DWORD
WINAPI
IDirect3DCubeTexture8Impl_SetLOD
(
IDirect3DCubeTexture8
*
iface
,
DWORD
LODNew
)
static
DWORD
WINAPI
d3d8_texture_cube_SetLOD
(
IDirect3DCubeTexture8
*
iface
,
DWORD
lod
)
{
IDirect3DCubeTexture8Impl
*
This
=
impl_from_IDirect3DCubeTexture8
(
iface
);
DWORD
lod
;
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
DWORD
ret
;
TRACE
(
"iface %p, lod %u.
\n
"
,
iface
,
LODNew
);
TRACE
(
"iface %p, lod %u.
\n
"
,
iface
,
lod
);
wined3d_mutex_lock
();
lod
=
wined3d_texture_set_lod
(
This
->
wined3d_texture
,
LODNew
);
ret
=
wined3d_texture_set_lod
(
texture
->
wined3d_texture
,
lod
);
wined3d_mutex_unlock
();
return
lod
;
return
ret
;
}
static
DWORD
WINAPI
IDirect3DCubeTexture8Impl
_GetLOD
(
IDirect3DCubeTexture8
*
iface
)
static
DWORD
WINAPI
d3d8_texture_cube
_GetLOD
(
IDirect3DCubeTexture8
*
iface
)
{
IDirect3DCubeTexture8Impl
*
This
=
impl_from_IDirect3DCubeTexture8
(
iface
);
DWORD
lod
;
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
DWORD
ret
;
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
lod
=
wined3d_texture_get_lod
(
This
->
wined3d_texture
);
ret
=
wined3d_texture_get_lod
(
texture
->
wined3d_texture
);
wined3d_mutex_unlock
();
return
lod
;
return
ret
;
}
static
DWORD
WINAPI
IDirect3DCubeTexture8Impl
_GetLevelCount
(
IDirect3DCubeTexture8
*
iface
)
static
DWORD
WINAPI
d3d8_texture_cube
_GetLevelCount
(
IDirect3DCubeTexture8
*
iface
)
{
IDirect3DCubeTexture8Impl
*
This
=
impl_from_IDirect3DCubeTexture8
(
iface
);
DWORD
cn
t
;
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
DWORD
re
t
;
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
cnt
=
wined3d_texture_get_level_count
(
This
->
wined3d_texture
);
ret
=
wined3d_texture_get_level_count
(
texture
->
wined3d_texture
);
wined3d_mutex_unlock
();
return
cn
t
;
return
re
t
;
}
/* IDirect3DCubeTexture8 Interface follow: */
static
HRESULT
WINAPI
IDirect3DCubeTexture8Impl_GetLevelDesc
(
IDirect3DCubeTexture8
*
iface
,
UINT
level
,
D3DSURFACE_DESC
*
desc
)
static
HRESULT
WINAPI
d3d8_texture_cube_GetLevelDesc
(
IDirect3DCubeTexture8
*
iface
,
UINT
level
,
D3DSURFACE_DESC
*
desc
)
{
IDirect3DCubeTexture8Impl
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
wined3d_resource
*
sub_resource
;
HRESULT
hr
=
D3D_OK
;
...
...
@@ -280,10 +273,10 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(IDirect3DCubeTextur
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DCubeTexture8Impl
_GetCubeMapSurface
(
IDirect3DCubeTexture8
*
iface
,
static
HRESULT
WINAPI
d3d8_texture_cube
_GetCubeMapSurface
(
IDirect3DCubeTexture8
*
iface
,
D3DCUBEMAP_FACES
face
,
UINT
level
,
IDirect3DSurface8
**
surface
)
{
IDirect3DCubeTexture8Impl
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
wined3d_resource
*
sub_resource
;
IDirect3DSurface8Impl
*
surface_impl
;
UINT
sub_resource_idx
;
...
...
@@ -306,11 +299,11 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetCubeMapSurface(IDirect3DCubeT
return
D3D_OK
;
}
static
HRESULT
WINAPI
IDirect3DCubeTexture8Impl
_LockRect
(
IDirect3DCubeTexture8
*
iface
,
static
HRESULT
WINAPI
d3d8_texture_cube
_LockRect
(
IDirect3DCubeTexture8
*
iface
,
D3DCUBEMAP_FACES
face
,
UINT
level
,
D3DLOCKED_RECT
*
locked_rect
,
const
RECT
*
rect
,
DWORD
flags
)
{
IDirect3DCubeTexture8Impl
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
wined3d_resource
*
sub_resource
;
IDirect3DSurface8Impl
*
surface_impl
;
UINT
sub_resource_idx
;
...
...
@@ -333,10 +326,10 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(IDirect3DCubeTexture8 *
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DCubeTexture8Impl
_UnlockRect
(
IDirect3DCubeTexture8
*
iface
,
static
HRESULT
WINAPI
d3d8_texture_cube
_UnlockRect
(
IDirect3DCubeTexture8
*
iface
,
D3DCUBEMAP_FACES
face
,
UINT
level
)
{
IDirect3DCubeTexture8Impl
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
wined3d_resource
*
sub_resource
;
IDirect3DSurface8Impl
*
surface_impl
;
UINT
sub_resource_idx
;
...
...
@@ -358,10 +351,10 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(IDirect3DCubeTexture8
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DCubeTexture8Impl
_AddDirtyRect
(
IDirect3DCubeTexture8
*
iface
,
static
HRESULT
WINAPI
d3d8_texture_cube
_AddDirtyRect
(
IDirect3DCubeTexture8
*
iface
,
D3DCUBEMAP_FACES
face
,
const
RECT
*
dirty_rect
)
{
IDirect3DCubeTexture8Impl
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
struct
d3d8_texture
*
texture
=
impl_from_IDirect3DCubeTexture8
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, face %#x, dirty_rect %s.
\n
"
,
...
...
@@ -390,28 +383,28 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(IDirect3DCubeTextur
static
const
IDirect3DCubeTexture8Vtbl
Direct3DCubeTexture8_Vtbl
=
{
/* IUnknown */
IDirect3DCubeTexture8Impl
_QueryInterface
,
IDirect3DCubeTexture8Impl
_AddRef
,
IDirect3DCubeTexture8Impl
_Release
,
d3d8_texture_cube
_QueryInterface
,
d3d8_texture_cube
_AddRef
,
d3d8_texture_cube
_Release
,
/* IDirect3DResource8 */
IDirect3DCubeTexture8Impl
_GetDevice
,
IDirect3DCubeTexture8Impl
_SetPrivateData
,
IDirect3DCubeTexture8Impl
_GetPrivateData
,
IDirect3DCubeTexture8Impl
_FreePrivateData
,
IDirect3DCubeTexture8Impl
_SetPriority
,
IDirect3DCubeTexture8Impl
_GetPriority
,
IDirect3DCubeTexture8Impl
_PreLoad
,
IDirect3DCubeTexture8Impl
_GetType
,
d3d8_texture_cube
_GetDevice
,
d3d8_texture_cube
_SetPrivateData
,
d3d8_texture_cube
_GetPrivateData
,
d3d8_texture_cube
_FreePrivateData
,
d3d8_texture_cube
_SetPriority
,
d3d8_texture_cube
_GetPriority
,
d3d8_texture_cube
_PreLoad
,
d3d8_texture_cube
_GetType
,
/* IDirect3DBaseTexture8 */
IDirect3DCubeTexture8Impl
_SetLOD
,
IDirect3DCubeTexture8Impl
_GetLOD
,
IDirect3DCubeTexture8Impl
_GetLevelCount
,
d3d8_texture_cube
_SetLOD
,
d3d8_texture_cube
_GetLOD
,
d3d8_texture_cube
_GetLevelCount
,
/* IDirect3DCubeTexture8 */
IDirect3DCubeTexture8Impl
_GetLevelDesc
,
IDirect3DCubeTexture8Impl
_GetCubeMapSurface
,
IDirect3DCubeTexture8Impl
_LockRect
,
IDirect3DCubeTexture8Impl
_UnlockRect
,
IDirect3DCubeTexture8Impl_AddDirtyRect
d3d8_texture_cube
_GetLevelDesc
,
d3d8_texture_cube
_GetCubeMapSurface
,
d3d8_texture_cube
_LockRect
,
d3d8_texture_cube
_UnlockRect
,
d3d8_texture_cube_AddDirtyRect
,
};
static
void
STDMETHODCALLTYPE
d3d8_cubetexture_wined3d_object_destroyed
(
void
*
parent
)
...
...
@@ -424,13 +417,13 @@ static const struct wined3d_parent_ops d3d8_cubetexture_wined3d_parent_ops =
d3d8_cubetexture_wined3d_object_destroyed
,
};
HRESULT
cubetexture_init
(
IDirect3DCubeTexture8Impl
*
texture
,
IDirect3DDevice8Impl
*
device
,
HRESULT
cubetexture_init
(
struct
d3d8_texture
*
texture
,
IDirect3DDevice8Impl
*
device
,
UINT
edge_length
,
UINT
levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
)
{
HRESULT
hr
;
texture
->
IDirect3D
CubeTexture8_iface
.
lpVtbl
=
&
Direct3DCubeTexture8_Vtbl
;
texture
->
ref
=
1
;
texture
->
IDirect3D
BaseTexture8_iface
.
lpVtbl
=
(
const
IDirect3DBaseTexture8Vtbl
*
)
&
Direct3DCubeTexture8_Vtbl
;
texture
->
ref
count
=
1
;
wined3d_mutex_lock
();
hr
=
wined3d_texture_create_cube
(
device
->
wined3d_device
,
edge_length
,
levels
,
...
...
@@ -443,8 +436,8 @@ HRESULT cubetexture_init(IDirect3DCubeTexture8Impl *texture, IDirect3DDevice8Imp
return
hr
;
}
texture
->
parent
D
evice
=
&
device
->
IDirect3DDevice8_iface
;
IDirect3DDevice8_AddRef
(
texture
->
parent
D
evice
);
texture
->
parent
_d
evice
=
&
device
->
IDirect3DDevice8_iface
;
IDirect3DDevice8_AddRef
(
texture
->
parent
_d
evice
);
return
D3D_OK
;
}
dlls/d3d8/d3d8_private.h
View file @
b8d07a2b
...
...
@@ -104,7 +104,6 @@ typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
typedef
struct
IDirect3DVolumeTexture8Impl
IDirect3DVolumeTexture8Impl
;
typedef
struct
IDirect3D8Impl
IDirect3D8Impl
;
typedef
struct
IDirect3DDevice8Impl
IDirect3DDevice8Impl
;
typedef
struct
IDirect3DCubeTexture8Impl
IDirect3DCubeTexture8Impl
;
typedef
struct
IDirect3DIndexBuffer8Impl
IDirect3DIndexBuffer8Impl
;
typedef
struct
IDirect3DSurface8Impl
IDirect3DSurface8Impl
;
typedef
struct
IDirect3DSwapChain8Impl
IDirect3DSwapChain8Impl
;
...
...
@@ -312,28 +311,13 @@ struct IDirect3DBaseTexture8Impl
struct
d3d8_texture
{
IDirect3D
Texture8
IDirect3D
Texture8_iface
;
IDirect3D
BaseTexture8
IDirect3DBase
Texture8_iface
;
LONG
refcount
;
struct
wined3d_texture
*
wined3d_texture
;
IDirect3DDevice8
*
parent_device
;
};
/* --------------------- */
/* IDirect3DCubeTexture8 */
/* --------------------- */
/*****************************************************************************
* IDirect3DCubeTexture8 implementation structure
*/
struct
IDirect3DCubeTexture8Impl
{
IDirect3DCubeTexture8
IDirect3DCubeTexture8_iface
;
LONG
ref
;
struct
wined3d_texture
*
wined3d_texture
;
IDirect3DDevice8
*
parentDevice
;
};
HRESULT
cubetexture_init
(
IDirect3DCubeTexture8Impl
*
texture
,
IDirect3DDevice8Impl
*
device
,
HRESULT
cubetexture_init
(
struct
d3d8_texture
*
texture
,
IDirect3DDevice8Impl
*
device
,
UINT
edge_length
,
UINT
levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
)
DECLSPEC_HIDDEN
;
HRESULT
texture_init
(
struct
d3d8_texture
*
texture
,
IDirect3DDevice8Impl
*
device
,
...
...
dlls/d3d8/device.c
View file @
b8d07a2b
...
...
@@ -707,7 +707,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(IDirect3DDevice8 *iface
}
TRACE
(
"Created texture %p.
\n
"
,
object
);
*
texture
=
&
object
->
IDirect3D
Texture8_iface
;
*
texture
=
(
IDirect3DTexture8
*
)
&
object
->
IDirect3DBase
Texture8_iface
;
return
D3D_OK
;
}
...
...
@@ -748,7 +748,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(IDirect3DDevice8 *i
UINT
levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
,
IDirect3DCubeTexture8
**
texture
)
{
IDirect3DDevice8Impl
*
This
=
impl_from_IDirect3DDevice8
(
iface
);
IDirect3DCubeTexture8Impl
*
object
;
struct
d3d8_texture
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.
\n
"
,
...
...
@@ -770,7 +770,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(IDirect3DDevice8 *i
}
TRACE
(
"Created cube texture %p.
\n
"
,
object
);
*
texture
=
&
object
->
IDirect3DCub
eTexture8_iface
;
*
texture
=
(
IDirect3DCubeTexture8
*
)
&
object
->
IDirect3DBas
eTexture8_iface
;
return
hr
;
}
...
...
dlls/d3d8/texture.c
View file @
b8d07a2b
...
...
@@ -25,7 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
static
inline
struct
d3d8_texture
*
impl_from_IDirect3DTexture8
(
IDirect3DTexture8
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d3d8_texture
,
IDirect3DTexture8_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d8_texture
,
IDirect3D
Base
Texture8_iface
);
}
static
HRESULT
WINAPI
d3d8_texture_2d_QueryInterface
(
IDirect3DTexture8
*
iface
,
REFIID
riid
,
void
**
out
)
...
...
@@ -402,7 +402,7 @@ HRESULT texture_init(struct d3d8_texture *texture, IDirect3DDevice8Impl *device,
{
HRESULT
hr
;
texture
->
IDirect3D
Texture8_iface
.
lpVtbl
=
&
Direct3DTexture8_Vtbl
;
texture
->
IDirect3D
BaseTexture8_iface
.
lpVtbl
=
(
const
IDirect3DBaseTexture8Vtbl
*
)
&
Direct3DTexture8_Vtbl
;
texture
->
refcount
=
1
;
wined3d_mutex_lock
();
...
...
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