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
eedfc95e
Commit
eedfc95e
authored
Sep 16, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Add a separate function for volume texture initialization.
parent
5b7b4f59
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
37 deletions
+49
-37
d3d8_private.h
dlls/d3d8/d3d8_private.h
+3
-5
device.c
dlls/d3d8/device.c
+20
-30
volumetexture.c
dlls/d3d8/volumetexture.c
+26
-2
No files found.
dlls/d3d8/d3d8_private.h
View file @
eedfc95e
...
...
@@ -440,11 +440,6 @@ struct IDirect3DTexture8Impl
/* ----------------------- */
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern
const
IDirect3DVolumeTexture8Vtbl
Direct3DVolumeTexture8_Vtbl
;
/*****************************************************************************
* IDirect3DVolumeTexture8 implementation structure
*/
struct
IDirect3DVolumeTexture8Impl
...
...
@@ -460,6 +455,9 @@ struct IDirect3DVolumeTexture8Impl
LPDIRECT3DDEVICE8
parentDevice
;
};
HRESULT
volumetexture_init
(
IDirect3DVolumeTexture8Impl
*
texture
,
IDirect3DDevice8Impl
*
device
,
UINT
width
,
UINT
height
,
UINT
depth
,
UINT
levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
);
/* ----------------------- */
/* IDirect3DStateBlockImpl */
/* ----------------------- */
...
...
dlls/d3d8/device.c
View file @
eedfc95e
...
...
@@ -695,45 +695,35 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_CreateVolumeTexture
(
IDirect3DDevice8
*
iface
,
UINT
Width
,
UINT
Height
,
UINT
Depth
,
UINT
Levels
,
DWORD
Usage
,
D3DFORMAT
F
ormat
,
D3DPOOL
Pool
,
IDirect3DVolumeTexture8
**
ppVolumeT
exture
)
UINT
width
,
UINT
height
,
UINT
depth
,
UINT
levels
,
DWORD
usage
,
D3DFORMAT
f
ormat
,
D3DPOOL
pool
,
IDirect3DVolumeTexture8
**
t
exture
)
{
IDirect3DVolumeTexture8Impl
*
object
;
IDirect3DDevice8Impl
*
This
=
(
IDirect3DDevice8Impl
*
)
iface
;
HRESULT
hrc
=
D3D_OK
;
IDirect3DVolumeTexture8Impl
*
object
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
TRACE
(
"iface %p, width %u, height %u, depth %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.
\n
"
,
iface
,
width
,
height
,
depth
,
levels
,
usage
,
format
,
pool
,
texture
);
/* Allocate the storage for the device */
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3DVolumeTexture8Impl
));
if
(
NULL
==
object
)
{
FIXME
(
"(%p) allocation of memory failed
\n
"
,
This
);
*
ppVolumeTexture
=
NULL
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Failed to allocate volume texture memory.
\n
"
);
return
D3DERR_OUTOFVIDEOMEMORY
;
}
object
->
lpVtbl
=
&
Direct3DVolumeTexture8_Vtbl
;
object
->
ref
=
1
;
wined3d_mutex_lock
();
hrc
=
IWineD3DDevice_CreateVolumeTexture
(
This
->
WineD3DDevice
,
Width
,
Height
,
Depth
,
Levels
,
Usage
&
WINED3DUSAGE_MASK
,
wined3dformat_from_d3dformat
(
Format
),
Pool
,
&
object
->
wineD3DVolumeTexture
,
(
IUnknown
*
)
object
);
wined3d_mutex_unlock
();
if
(
hrc
!=
D3D_OK
)
{
/* free up object */
FIXME
(
"(%p) call to IWineD3DDevice_CreateVolumeTexture failed
\n
"
,
This
);
hr
=
volumetexture_init
(
object
,
This
,
width
,
height
,
depth
,
levels
,
usage
,
format
,
pool
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize volume texture, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
ppVolumeTexture
=
NULL
;
}
else
{
IUnknown_AddRef
(
iface
);
object
->
parentDevice
=
iface
;
*
ppVolumeTexture
=
(
LPDIRECT3DVOLUMETEXTURE8
)
object
;
return
hr
;
}
TRACE
(
"(%p) returning %p
\n
"
,
This
,
*
ppVolumeTexture
);
return
hrc
;
TRACE
(
"Created volume texture %p.
\n
"
,
object
);
*
texture
=
(
IDirect3DVolumeTexture8
*
)
object
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_CreateCubeTexture
(
IDirect3DDevice8
*
iface
,
UINT
EdgeLength
,
...
...
dlls/d3d8/volumetexture.c
View file @
eedfc95e
...
...
@@ -285,8 +285,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_AddDirtyBox(LPDIRECT3DVOLUMETE
return
hr
;
}
const
IDirect3DVolumeTexture8Vtbl
Direct3DVolumeTexture8_Vtbl
=
static
const
IDirect3DVolumeTexture8Vtbl
Direct3DVolumeTexture8_Vtbl
=
{
/* IUnknown */
IDirect3DVolumeTexture8Impl_QueryInterface
,
...
...
@@ -312,3 +311,28 @@ const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl =
IDirect3DVolumeTexture8Impl_UnlockBox
,
IDirect3DVolumeTexture8Impl_AddDirtyBox
};
HRESULT
volumetexture_init
(
IDirect3DVolumeTexture8Impl
*
texture
,
IDirect3DDevice8Impl
*
device
,
UINT
width
,
UINT
height
,
UINT
depth
,
UINT
levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
)
{
HRESULT
hr
;
texture
->
lpVtbl
=
&
Direct3DVolumeTexture8_Vtbl
;
texture
->
ref
=
1
;
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_CreateVolumeTexture
(
device
->
WineD3DDevice
,
width
,
height
,
depth
,
levels
,
usage
&
WINED3DUSAGE_MASK
,
wined3dformat_from_d3dformat
(
format
),
pool
,
&
texture
->
wineD3DVolumeTexture
,
(
IUnknown
*
)
texture
);
wined3d_mutex_unlock
();
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d volume texture, hr %#x.
\n
"
,
hr
);
return
hr
;
}
texture
->
parentDevice
=
(
IDirect3DDevice8
*
)
device
;
IDirect3DDevice8_AddRef
(
texture
->
parentDevice
);
return
D3D_OK
;
}
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