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
c0c2319c
Commit
c0c2319c
authored
Sep 01, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement UpdateTexture for volumes.
parent
bc69315f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
9 deletions
+40
-9
device.c
dlls/wined3d/device.c
+40
-9
No files found.
dlls/wined3d/device.c
View file @
c0c2319c
...
...
@@ -4966,6 +4966,37 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveStrided(IWineD3DDev
return
WINED3D_OK
;
}
static
HRESULT
IWineD3DDeviceImpl_UpdateVolume
(
IWineD3DDevice
*
iface
,
IWineD3DVolume
*
pSourceVolume
,
IWineD3DVolume
*
pDestinationVolume
)
{
/* This is a helper function for UpdateTexture, there is no public UpdateVolume method in d3d. Since it's
* not callable by the app directly no parameter validation checks are needed here.
*/
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
WINED3DLOCKED_BOX
src
;
WINED3DLOCKED_BOX
dst
;
HRESULT
hr
;
TRACE
(
"(%p)->(%p, %p)
\n
"
,
This
,
pSourceVolume
,
pDestinationVolume
);
/* TODO: Implement direct loading into the gl volume instead of using memcpy and
* dirtification to improve loading performance.
*/
hr
=
IWineD3DVolume_LockBox
(
pSourceVolume
,
&
src
,
NULL
,
WINED3DLOCK_READONLY
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IWineD3DVolume_LockBox
(
pDestinationVolume
,
&
dst
,
NULL
,
WINED3DLOCK_DISCARD
);
if
(
FAILED
(
hr
))
{
IWineD3DVolume_UnlockBox
(
pSourceVolume
);
return
hr
;
}
memcpy
(
dst
.
pBits
,
src
.
pBits
,
((
IWineD3DVolumeImpl
*
)
pDestinationVolume
)
->
resource
.
size
);
hr
=
IWineD3DVolume_UnlockBox
(
pDestinationVolume
);
if
(
FAILED
(
hr
))
{
IWineD3DVolume_UnlockBox
(
pSourceVolume
);
}
else
{
hr
=
IWineD3DVolume_UnlockBox
(
pSourceVolume
);
}
return
hr
;
}
/* Yet another way to update a texture, some apps use this to load default textures instead of using surface/texture lock/unlock */
static
HRESULT
WINAPI
IWineD3DDeviceImpl_UpdateTexture
(
IWineD3DDevice
*
iface
,
IWineD3DBaseTexture
*
pSourceTexture
,
IWineD3DBaseTexture
*
pDestinationTexture
){
...
...
@@ -5066,18 +5097,18 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture (IWineD3DDevice *iface, I
}
}
break
;
#if 0 /* TODO: Add support for volume textures */
case
WINED3DRTYPE_VOLUMETEXTURE
:
{
IWineD3DVolume srcVolume = NULL;
IWineD3D
Surface
destVolume = NULL;
IWineD3DVolume
*
srcVolume
=
NULL
;
IWineD3D
Volume
*
destVolume
=
NULL
;
for
(
i
=
0
;
i
<
levels
;
++
i
)
{
IWineD3DVolumeTexture_GetVolume((IWineD3DVolumeTexture *)pSourceTexture, i, &srcVolume);
IWineD3DVolumeTexture_GetVolume((IWineD3DVolumeTexture *)pDestinationTexture, i, &destVolume);
hr = IWineD3D
Foo_UpdateVolume(iface, srcVolume, NULL, destVolume, NULL
);
IWineD3DVolume_Release(src
Surfac
e);
IWineD3DVolume_Release(dest
Surfac
e);
IWineD3DVolumeTexture_GetVolume
Level
((
IWineD3DVolumeTexture
*
)
pSourceTexture
,
i
,
&
srcVolume
);
IWineD3DVolumeTexture_GetVolume
Level
((
IWineD3DVolumeTexture
*
)
pDestinationTexture
,
i
,
&
destVolume
);
hr
=
IWineD3D
DeviceImpl_UpdateVolume
(
iface
,
srcVolume
,
destVolume
);
IWineD3DVolume_Release
(
src
Volum
e
);
IWineD3DVolume_Release
(
dest
Volum
e
);
if
(
WINED3D_OK
!=
hr
)
{
WARN
(
"(%p) : Call to update volume failed
\n
"
,
This
);
return
hr
;
...
...
@@ -5085,7 +5116,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture (IWineD3DDevice *iface, I
}
}
break
;
#endif
default
:
FIXME
(
"(%p) : Unsupported source and destination type
\n
"
,
This
);
hr
=
WINED3DERR_INVALIDCALL
;
...
...
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