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
89a4e696
Commit
89a4e696
authored
Apr 14, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the IWineD3DVolume typedefs.
parent
2c450571
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
39 deletions
+31
-39
device.c
dlls/wined3d/device.c
+18
-22
texture.c
dlls/wined3d/texture.c
+5
-5
volume.c
dlls/wined3d/volume.c
+3
-5
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-7
No files found.
dlls/wined3d/device.c
View file @
89a4e696
...
...
@@ -1183,10 +1183,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
static
HRESULT
WINAPI
IWineD3DDeviceImpl_CreateVolume
(
IWineD3DDevice
*
iface
,
UINT
Width
,
UINT
Height
,
UINT
Depth
,
DWORD
Usage
,
enum
wined3d_format_id
Format
,
WINED3DPOOL
Pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
IWineD3DVolume
**
ppV
olume
)
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_volume
**
v
olume
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DVolumeImpl
*
object
;
struct
wined3d_volume
*
object
;
HRESULT
hr
;
TRACE
(
"(%p) : W(%d) H(%d) D(%d), Usage(%d), Fmt(%u,%s), Pool(%s)
\n
"
,
This
,
Width
,
Height
,
...
...
@@ -1196,7 +1196,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface, UIN
if
(
!
object
)
{
ERR
(
"Out of memory
\n
"
);
*
ppV
olume
=
NULL
;
*
v
olume
=
NULL
;
return
WINED3DERR_OUTOFVIDEOMEMORY
;
}
...
...
@@ -1209,7 +1209,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface, UIN
}
TRACE
(
"(%p) : Created volume %p.
\n
"
,
This
,
object
);
*
ppVolume
=
(
IWineD3DVolume
*
)
object
;
*
volume
=
object
;
return
WINED3D_OK
;
}
...
...
@@ -5088,34 +5088,33 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveStrided(IWineD3DDev
/* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */
static
HRESULT
IWineD3DDeviceImpl_UpdateVolume
(
IWineD3DDevice
*
iface
,
IWineD3DVolume
*
pSourceVolume
,
IWineD3DVolume
*
pDestinationV
olume
)
struct
wined3d_volume
*
src_volume
,
struct
wined3d_volume
*
dst_v
olume
)
{
WINED3DLOCKED_BOX
src
;
WINED3DLOCKED_BOX
dst
;
HRESULT
hr
;
TRACE
(
"iface %p, src_volume %p, dst_volume %p.
\n
"
,
iface
,
pSourceVolume
,
pDestinationV
olume
);
iface
,
src_volume
,
dst_v
olume
);
/* TODO: Implement direct loading into the gl volume instead of using memcpy and
* dirtification to improve loading performance.
*/
hr
=
wined3d_volume_map
(
pSourceVolume
,
&
src
,
NULL
,
WINED3DLOCK_READONLY
);
/* TODO: Implement direct loading into the gl volume instead of using
* memcpy and dirtification to improve loading performance. */
hr
=
wined3d_volume_map
(
src_volume
,
&
src
,
NULL
,
WINED3DLOCK_READONLY
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
wined3d_volume_map
(
pDestinationV
olume
,
&
dst
,
NULL
,
WINED3DLOCK_DISCARD
);
hr
=
wined3d_volume_map
(
dst_v
olume
,
&
dst
,
NULL
,
WINED3DLOCK_DISCARD
);
if
(
FAILED
(
hr
))
{
wined3d_volume_unmap
(
pSourceV
olume
);
wined3d_volume_unmap
(
src_v
olume
);
return
hr
;
}
memcpy
(
dst
.
pBits
,
src
.
pBits
,
((
IWineD3DVolumeImpl
*
)
pDestinationVolume
)
->
resource
.
size
);
memcpy
(
dst
.
pBits
,
src
.
pBits
,
dst_volume
->
resource
.
size
);
hr
=
wined3d_volume_unmap
(
pDestinationV
olume
);
hr
=
wined3d_volume_unmap
(
dst_v
olume
);
if
(
FAILED
(
hr
))
wined3d_volume_unmap
(
pSourceV
olume
);
wined3d_volume_unmap
(
src_v
olume
);
else
hr
=
wined3d_volume_unmap
(
pSourceV
olume
);
hr
=
wined3d_volume_unmap
(
src_v
olume
);
return
hr
;
}
...
...
@@ -5208,14 +5207,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface,
case
WINED3DRTYPE_VOLUMETEXTURE
:
{
IWineD3DVolume
*
src_volume
;
IWineD3DVolume
*
dst_volume
;
for
(
i
=
0
;
i
<
level_count
;
++
i
)
{
src_volume
=
(
IWineD3DVolume
*
)
volume_from_resource
(
wined3d_texture_get_sub_resource
(
src_texture
,
i
));
dst_volume
=
(
IWineD3DVolume
*
)
volume_from_resource
(
wined3d_texture_get_sub_resource
(
dst_texture
,
i
));
hr
=
IWineD3DDeviceImpl_UpdateVolume
(
iface
,
src_volume
,
dst_volume
);
hr
=
IWineD3DDeviceImpl_UpdateVolume
(
iface
,
volume_from_resource
(
wined3d_texture_get_sub_resource
(
src_texture
,
i
)),
volume_from_resource
(
wined3d_texture_get_sub_resource
(
dst_texture
,
i
))
);
if
(
FAILED
(
hr
))
{
WARN
(
"IWineD3DDeviceImpl_UpdateVolume failed, hr %#x.
\n
"
,
hr
);
...
...
dlls/wined3d/texture.c
View file @
89a4e696
...
...
@@ -1157,7 +1157,7 @@ static void texture3d_preload(struct wined3d_texture *texture, enum WINED3DSRGB
{
for
(
i
=
0
;
i
<
texture
->
level_count
;
++
i
)
{
IWineD3DVolumeImpl
*
volume
=
volume_from_resource
(
texture
->
sub_resources
[
i
]);
struct
wined3d_volume
*
volume
=
volume_from_resource
(
texture
->
sub_resources
[
i
]);
volume_add_dirty_box
(
volume
,
NULL
);
volume_load
(
volume
,
i
,
texture
->
flags
&
WINED3D_TEXTURE_IS_SRGB
);
}
...
...
@@ -1182,7 +1182,7 @@ static void texture3d_sub_resource_add_dirty_region(struct wined3d_resource *sub
static
void
texture3d_sub_resource_cleanup
(
struct
wined3d_resource
*
sub_resource
)
{
IWineD3DVolumeImpl
*
volume
=
volume_from_resource
(
sub_resource
);
struct
wined3d_volume
*
volume
=
volume_from_resource
(
sub_resource
);
/* Cleanup the container. */
volume_set_container
(
volume
,
NULL
);
...
...
@@ -1289,7 +1289,7 @@ HRESULT volumetexture_init(struct wined3d_texture *texture, UINT width, UINT hei
for
(
i
=
0
;
i
<
texture
->
level_count
;
++
i
)
{
IWineD3DV
olume
*
volume
;
struct
wined3d_v
olume
*
volume
;
/* Create the volume. */
hr
=
IWineD3DDeviceParent_CreateVolume
(
device
->
device_parent
,
parent
,
...
...
@@ -1302,8 +1302,8 @@ HRESULT volumetexture_init(struct wined3d_texture *texture, UINT width, UINT hei
}
/* Set its container to this texture. */
volume_set_container
(
(
IWineD3DVolumeImpl
*
)
volume
,
texture
);
texture
->
sub_resources
[
i
]
=
&
((
IWineD3DVolumeImpl
*
)
volume
)
->
resource
;
volume_set_container
(
volume
,
texture
);
texture
->
sub_resources
[
i
]
=
&
volume
->
resource
;
/* Calculate the next mipmap level. */
tmp_w
=
max
(
1
,
tmp_w
>>
1
);
...
...
dlls/wined3d/volume.c
View file @
89a4e696
/*
* IWineD3DVolume implementation
*
* Copyright 2002-2005 Jason Edmeades
* Copyright 2002-2005 Raphael Junqueira
* Copyright 2005 Oliver Stieber
...
...
@@ -85,7 +83,7 @@ void volume_add_dirty_box(struct wined3d_volume *volume, const WINED3DBOX *dirty
}
}
void
volume_set_container
(
IWineD3DVolumeImpl
*
volume
,
struct
wined3d_texture
*
container
)
void
volume_set_container
(
struct
wined3d_volume
*
volume
,
struct
wined3d_texture
*
container
)
{
TRACE
(
"volume %p, container %p.
\n
"
,
volume
,
container
);
...
...
@@ -93,7 +91,7 @@ void volume_set_container(IWineD3DVolumeImpl *volume, struct wined3d_texture *co
}
/* Context activation is done by the caller. */
void
volume_load
(
IWineD3DVolumeImpl
*
volume
,
UINT
level
,
BOOL
srgb_mode
)
void
volume_load
(
struct
wined3d_volume
*
volume
,
UINT
level
,
BOOL
srgb_mode
)
{
const
struct
wined3d_gl_info
*
gl_info
=
&
volume
->
resource
.
device
->
adapter
->
gl_info
;
const
struct
wined3d_format
*
format
=
volume
->
resource
.
format
;
...
...
@@ -287,7 +285,7 @@ static const struct wined3d_resource_ops volume_resource_ops =
volume_unload
,
};
HRESULT
volume_init
(
IWineD3DVolumeImpl
*
volume
,
IWineD3DDeviceImpl
*
device
,
UINT
width
,
HRESULT
volume_init
(
struct
wined3d_volume
*
volume
,
IWineD3DDeviceImpl
*
device
,
UINT
width
,
UINT
height
,
UINT
depth
,
DWORD
usage
,
enum
wined3d_format_id
format_id
,
WINED3DPOOL
pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
89a4e696
...
...
@@ -54,8 +54,6 @@
typedef
struct
IWineD3DSurfaceImpl
IWineD3DSurfaceImpl
;
typedef
struct
IWineD3DDeviceImpl
IWineD3DDeviceImpl
;
typedef
struct
wined3d_volume
IWineD3DVolumeImpl
;
typedef
struct
wined3d_volume
IWineD3DVolume
;
/* Texture format fixups */
...
...
@@ -1955,17 +1953,17 @@ struct wined3d_volume
BOOL
dirty
;
};
static
inline
IWineD3DVolumeImpl
*
volume_from_resource
(
struct
wined3d_resource
*
resource
)
static
inline
struct
wined3d_volume
*
volume_from_resource
(
struct
wined3d_resource
*
resource
)
{
return
CONTAINING_RECORD
(
resource
,
IWineD3DVolumeImpl
,
resource
);
return
CONTAINING_RECORD
(
resource
,
struct
wined3d_volume
,
resource
);
}
void
volume_add_dirty_box
(
struct
wined3d_volume
*
volume
,
const
WINED3DBOX
*
dirty_box
)
DECLSPEC_HIDDEN
;
HRESULT
volume_init
(
IWineD3DVolumeImpl
*
volume
,
IWineD3DDeviceImpl
*
device
,
UINT
width
,
HRESULT
volume_init
(
struct
wined3d_volume
*
volume
,
IWineD3DDeviceImpl
*
device
,
UINT
width
,
UINT
height
,
UINT
depth
,
DWORD
usage
,
enum
wined3d_format_id
format_id
,
WINED3DPOOL
pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
DECLSPEC_HIDDEN
;
void
volume_load
(
IWineD3DVolumeImpl
*
volume
,
UINT
level
,
BOOL
srgb_mode
)
DECLSPEC_HIDDEN
;
void
volume_set_container
(
IWineD3DVolumeImpl
*
volume
,
struct
wined3d_texture
*
container
)
DECLSPEC_HIDDEN
;
void
volume_load
(
struct
wined3d_volume
*
volume
,
UINT
level
,
BOOL
srgb_mode
)
DECLSPEC_HIDDEN
;
void
volume_set_container
(
struct
wined3d_volume
*
volume
,
struct
wined3d_texture
*
container
)
DECLSPEC_HIDDEN
;
/*****************************************************************************
* Structure for DIB Surfaces (GetDC and GDI surfaces)
...
...
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