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
6ea9afe7
Commit
6ea9afe7
authored
Nov 13, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Create textures for "standalone" surfaces.
parent
d6f12fcd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
16 deletions
+23
-16
ddraw.c
dlls/ddraw/ddraw.c
+2
-10
device.c
dlls/ddraw/device.c
+5
-3
surface.c
dlls/ddraw/surface.c
+16
-3
No files found.
dlls/ddraw/ddraw.c
View file @
6ea9afe7
...
@@ -3116,17 +3116,9 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
...
@@ -3116,17 +3116,9 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
}
}
}
}
if
(
desc2
.
ddsCaps
.
dwCaps
&
DDSCAPS_TEXTURE
)
if
(
FAILED
(
hr
=
ddraw_surface_create_texture
(
ddraw
,
&
desc2
,
version
,
flags
,
&
object
))
)
{
{
if
(
FAILED
(
hr
=
ddraw_surface_create_texture
(
ddraw
,
&
desc2
,
version
,
flags
,
&
object
)))
WARN
(
"Failed to create texture, hr %#x.
\n
"
,
hr
);
{
WARN
(
"Failed to create texture, hr %#x.
\n
"
,
hr
);
return
hr
;
}
}
else
if
(
FAILED
(
hr
=
ddraw_create_surface
(
ddraw
,
&
desc2
,
flags
,
&
object
,
version
)))
{
WARN
(
"ddraw_create_surface failed, hr %#x.
\n
"
,
hr
);
return
hr
;
return
hr
;
}
}
object
->
is_complex_root
=
TRUE
;
object
->
is_complex_root
=
TRUE
;
...
...
dlls/ddraw/device.c
View file @
6ea9afe7
...
@@ -4668,14 +4668,16 @@ static HRESULT d3d_device7_SetTexture(IDirect3DDevice7 *iface,
...
@@ -4668,14 +4668,16 @@ static HRESULT d3d_device7_SetTexture(IDirect3DDevice7 *iface,
{
{
struct
d3d_device
*
device
=
impl_from_IDirect3DDevice7
(
iface
);
struct
d3d_device
*
device
=
impl_from_IDirect3DDevice7
(
iface
);
struct
ddraw_surface
*
surf
=
unsafe_impl_from_IDirectDrawSurface7
(
texture
);
struct
ddraw_surface
*
surf
=
unsafe_impl_from_IDirectDrawSurface7
(
texture
);
struct
wined3d_texture
*
wined3d_texture
=
NULL
;
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"iface %p, stage %u, texture %p.
\n
"
,
iface
,
stage
,
texture
);
TRACE
(
"iface %p, stage %u, texture %p.
\n
"
,
iface
,
stage
,
texture
);
/* Texture may be NULL here */
if
(
surf
&&
(
surf
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_TEXTURE
))
wined3d_texture
=
surf
->
wined3d_texture
;
wined3d_mutex_lock
();
wined3d_mutex_lock
();
hr
=
wined3d_device_set_texture
(
device
->
wined3d_device
,
hr
=
wined3d_device_set_texture
(
device
->
wined3d_device
,
stage
,
wined3d_texture
);
stage
,
surf
?
surf
->
wined3d_texture
:
NULL
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
hr
;
return
hr
;
...
...
dlls/ddraw/surface.c
View file @
6ea9afe7
...
@@ -484,6 +484,9 @@ static void ddraw_surface_cleanup(struct ddraw_surface *surface)
...
@@ -484,6 +484,9 @@ static void ddraw_surface_cleanup(struct ddraw_surface *surface)
surface
,
surface
->
ref7
,
surface
->
ref4
,
surface
->
ref3
,
surface
->
ref2
,
surface
->
ref1
);
surface
,
surface
->
ref7
,
surface
->
ref4
,
surface
->
ref3
,
surface
->
ref2
,
surface
->
ref1
);
}
}
if
(
surface
->
wined3d_texture
&&
!
(
surface
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_TEXTURE
))
wined3d_texture_decref
(
surface
->
wined3d_texture
);
if
(
surface
->
wined3d_surface
)
if
(
surface
->
wined3d_surface
)
wined3d_surface_decref
(
surface
->
wined3d_surface
);
wined3d_surface_decref
(
surface
->
wined3d_surface
);
}
}
...
@@ -505,7 +508,8 @@ ULONG ddraw_surface_release_iface(struct ddraw_surface *This)
...
@@ -505,7 +508,8 @@ ULONG ddraw_surface_release_iface(struct ddraw_surface *This)
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
iface_count
;
return
iface_count
;
}
}
if
(
This
->
wined3d_texture
)
/* If it's a texture, destroy the wined3d texture. */
/* If it's a texture, destroy the wined3d texture. */
if
(
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_TEXTURE
)
wined3d_texture_decref
(
This
->
wined3d_texture
);
wined3d_texture_decref
(
This
->
wined3d_texture
);
else
else
ddraw_surface_cleanup
(
This
);
ddraw_surface_cleanup
(
This
);
...
@@ -5579,7 +5583,8 @@ static void STDMETHODCALLTYPE ddraw_texture_wined3d_object_destroyed(void *paren
...
@@ -5579,7 +5583,8 @@ static void STDMETHODCALLTYPE ddraw_texture_wined3d_object_destroyed(void *paren
TRACE
(
"texture %p.
\n
"
,
texture
);
TRACE
(
"texture %p.
\n
"
,
texture
);
ddraw_surface_cleanup
(
texture
->
root
);
if
(
texture
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_TEXTURE
)
ddraw_surface_cleanup
(
texture
->
root
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
}
}
...
@@ -5632,11 +5637,19 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, const DDSURFACEDESC2 *
...
@@ -5632,11 +5637,19 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, const DDSURFACEDESC2 *
}
}
else
else
{
{
wined3d_desc
.
usage
=
WINED3DUSAGE_TEXTURE
|
WINED3DUSAGE_DYNAMIC
;
wined3d_desc
.
usage
=
WINED3DUSAGE_DYNAMIC
;
if
(
desc
->
ddsCaps
.
dwCaps
&
DDSCAPS_TEXTURE
)
wined3d_desc
.
usage
|=
WINED3DUSAGE_TEXTURE
;
pool
=
WINED3D_POOL_DEFAULT
;
pool
=
WINED3D_POOL_DEFAULT
;
}
}
wined3d_desc
.
format
=
wined3dformat_from_ddrawformat
(
&
desc
->
u4
.
ddpfPixelFormat
);
wined3d_desc
.
format
=
wined3dformat_from_ddrawformat
(
&
desc
->
u4
.
ddpfPixelFormat
);
if
(
wined3d_desc
.
format
==
WINED3DFMT_UNKNOWN
)
{
WARN
(
"Unsupported / unknown pixelformat.
\n
"
);
return
DDERR_INVALIDPIXELFORMAT
;
}
wined3d_desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
wined3d_desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
wined3d_desc
.
multisample_quality
=
0
;
wined3d_desc
.
multisample_quality
=
0
;
wined3d_desc
.
pool
=
pool
;
wined3d_desc
.
pool
=
pool
;
...
...
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