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
b5b58e42
Commit
b5b58e42
authored
Sep 17, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Add a separate function for cube texture initialization.
parent
c51fbe92
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
35 deletions
+45
-35
cubetexture.c
dlls/d3d8/cubetexture.c
+25
-2
d3d8_private.h
dlls/d3d8/d3d8_private.h
+3
-5
device.c
dlls/d3d8/device.c
+17
-28
No files found.
dlls/d3d8/cubetexture.c
View file @
b5b58e42
...
...
@@ -286,8 +286,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(LPDIRECT3DCUBETEXTU
return
hr
;
}
const
IDirect3DCubeTexture8Vtbl
Direct3DCubeTexture8_Vtbl
=
static
const
IDirect3DCubeTexture8Vtbl
Direct3DCubeTexture8_Vtbl
=
{
/* IUnknown */
IDirect3DCubeTexture8Impl_QueryInterface
,
...
...
@@ -313,3 +312,27 @@ const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl =
IDirect3DCubeTexture8Impl_UnlockRect
,
IDirect3DCubeTexture8Impl_AddDirtyRect
};
HRESULT
cubetexture_init
(
IDirect3DCubeTexture8Impl
*
texture
,
IDirect3DDevice8Impl
*
device
,
UINT
edge_length
,
UINT
levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
)
{
HRESULT
hr
;
texture
->
lpVtbl
=
&
Direct3DCubeTexture8_Vtbl
;
texture
->
ref
=
1
;
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_CreateCubeTexture
(
device
->
WineD3DDevice
,
edge_length
,
levels
,
usage
&
WINED3DUSAGE_MASK
,
wined3dformat_from_d3dformat
(
format
),
pool
,
&
texture
->
wineD3DCubeTexture
,
(
IUnknown
*
)
texture
);
wined3d_mutex_unlock
();
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d cube texture, hr %#x.
\n
"
,
hr
);
return
hr
;
}
texture
->
parentDevice
=
(
IDirect3DDevice8
*
)
device
;
IDirect3DDevice8_AddRef
(
texture
->
parentDevice
);
return
D3D_OK
;
}
dlls/d3d8/d3d8_private.h
View file @
b5b58e42
...
...
@@ -390,11 +390,6 @@ struct IDirect3DBaseTexture8Impl
/* --------------------- */
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern
const
IDirect3DCubeTexture8Vtbl
Direct3DCubeTexture8_Vtbl
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IDirect3DCubeTexture8 implementation structure
*/
struct
IDirect3DCubeTexture8Impl
...
...
@@ -410,6 +405,9 @@ struct IDirect3DCubeTexture8Impl
LPDIRECT3DDEVICE8
parentDevice
;
};
HRESULT
cubetexture_init
(
IDirect3DCubeTexture8Impl
*
texture
,
IDirect3DDevice8Impl
*
device
,
UINT
edge_length
,
UINT
levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
)
DECLSPEC_HIDDEN
;
/* ----------------- */
/* IDirect3DTexture8 */
/* ----------------- */
...
...
dlls/d3d8/device.c
View file @
b5b58e42
...
...
@@ -726,45 +726,34 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(IDirect3DDevice8
return
D3D_OK
;
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_CreateCubeTexture
(
IDirect3DDevice8
*
iface
,
UINT
EdgeL
ength
,
UINT
Levels
,
DWORD
Usage
,
D3DFORMAT
Format
,
D3DPOOL
Pool
,
IDirect3DCubeTexture8
**
ppCubeT
exture
)
static
HRESULT
WINAPI
IDirect3DDevice8Impl_CreateCubeTexture
(
IDirect3DDevice8
*
iface
,
UINT
edge_l
ength
,
UINT
levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
,
IDirect3DCubeTexture8
**
t
exture
)
{
IDirect3DCubeTexture8Impl
*
object
;
IDirect3DDevice8Impl
*
This
=
(
IDirect3DDevice8Impl
*
)
iface
;
HRESULT
hr
=
D3D_OK
;
IDirect3DCubeTexture8Impl
*
object
;
HRESULT
hr
;
TRACE
(
"(%p) : ELen(%d) Lvl(%d) Usage(%d) fmt(%u), Pool(%d)
\n
"
,
This
,
EdgeLength
,
Levels
,
Usage
,
Format
,
Pool
);
TRACE
(
"iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.
\n
"
,
iface
,
edge_length
,
levels
,
usage
,
format
,
pool
,
texture
);
/* Allocate the storage for the device */
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
NULL
==
object
)
{
FIXME
(
"(%p) allocation of CubeTexture failed
\n
"
,
This
);
*
ppCubeTexture
=
NULL
;
if
(
!
object
)
{
ERR
(
"Failed to allocate cube texture memory.
\n
"
);
return
D3DERR_OUTOFVIDEOMEMORY
;
}
object
->
lpVtbl
=
&
Direct3DCubeTexture8_Vtbl
;
object
->
ref
=
1
;
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_CreateCubeTexture
(
This
->
WineD3DDevice
,
EdgeLength
,
Levels
,
Usage
&
WINED3DUSAGE_MASK
,
wined3dformat_from_d3dformat
(
Format
),
Pool
,
&
object
->
wineD3DCubeTexture
,
(
IUnknown
*
)
object
);
wined3d_mutex_unlock
();
if
(
hr
!=
D3D_OK
){
/* free up object */
FIXME
(
"(%p) call to IWineD3DDevice_CreateCubeTexture failed
\n
"
,
This
);
hr
=
cubetexture_init
(
object
,
This
,
edge_length
,
levels
,
usage
,
format
,
pool
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize cube texture, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
ppCubeTexture
=
NULL
;
}
else
{
IUnknown_AddRef
(
iface
);
object
->
parentDevice
=
iface
;
*
ppCubeTexture
=
(
LPDIRECT3DCUBETEXTURE8
)
object
;
return
hr
;
}
TRACE
(
"(%p) returning %p
\n
"
,
This
,
*
ppCubeTexture
);
TRACE
(
"Created cube texture %p.
\n
"
,
object
);
*
texture
=
(
IDirect3DCubeTexture8
*
)
object
;
return
hr
;
}
...
...
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