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
5492560c
Commit
5492560c
authored
Apr 19, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Introduce a separate function for texture creation.
parent
2b1b5dba
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
40 deletions
+31
-40
ddraw.c
dlls/ddraw/ddraw.c
+2
-40
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
surface.c
dlls/ddraw/surface.c
+28
-0
No files found.
dlls/ddraw/ddraw.c
View file @
5492560c
...
...
@@ -3395,48 +3395,10 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
object
->
ifaceToRelease
=
(
IUnknown
*
)
&
ddraw
->
IDirectDraw7_iface
;
/* Create a WineD3DTexture if a texture was requested */
if
(
desc2
.
ddsCaps
.
dwCaps
&
DDSCAPS_TEXTURE
)
if
(
desc2
.
ddsCaps
.
dwCaps
&
DDSCAPS_TEXTURE
)
{
enum
wined3d_format_id
Format
;
UINT
levels
;
WINED3DPOOL
Pool
=
WINED3DPOOL_DEFAULT
;
ddraw
->
tex_root
=
object
;
if
(
desc2
.
ddsCaps
.
dwCaps
&
DDSCAPS_MIPMAP
)
{
/* a mipmap is created, create enough levels */
levels
=
desc2
.
u2
.
dwMipMapCount
;
}
else
{
/* No mipmap is created, create one level */
levels
=
1
;
}
/* DDSCAPS_SYSTEMMEMORY textures are in WINED3DPOOL_SYSTEMMEM */
if
(
DDSD
->
ddsCaps
.
dwCaps
&
DDSCAPS_SYSTEMMEMORY
)
{
Pool
=
WINED3DPOOL_SYSTEMMEM
;
}
/* Should I forward the MANAGED cap to the managed pool ? */
/* Get the format. It's set already by CreateNewSurface */
Format
=
PixelFormat_DD2WineD3D
(
&
object
->
surface_desc
.
u4
.
ddpfPixelFormat
);
/* The surfaces are already created, the callback only
* passes the IWineD3DSurface to WineD3D
*/
if
(
desc2
.
ddsCaps
.
dwCaps2
&
DDSCAPS2_CUBEMAP
)
{
hr
=
IWineD3DDevice_CreateCubeTexture
(
ddraw
->
wineD3DDevice
,
DDSD
->
dwWidth
,
levels
,
0
,
Format
,
Pool
,
object
,
&
ddraw_null_wined3d_parent_ops
,
&
object
->
wined3d_texture
);
}
else
{
hr
=
IWineD3DDevice_CreateTexture
(
ddraw
->
wineD3DDevice
,
DDSD
->
dwWidth
,
DDSD
->
dwHeight
,
levels
,
0
,
Format
,
Pool
,
object
,
&
ddraw_null_wined3d_parent_ops
,
&
object
->
wined3d_texture
);
}
ddraw_surface_create_texture
(
object
);
ddraw
->
tex_root
=
NULL
;
}
...
...
dlls/ddraw/ddraw_private.h
View file @
5492560c
...
...
@@ -219,6 +219,7 @@ struct IDirectDrawSurfaceImpl
DWORD
Handle
;
};
HRESULT
ddraw_surface_create_texture
(
IDirectDrawSurfaceImpl
*
surface
)
DECLSPEC_HIDDEN
;
void
ddraw_surface_destroy
(
IDirectDrawSurfaceImpl
*
surface
)
DECLSPEC_HIDDEN
;
HRESULT
ddraw_surface_init
(
IDirectDrawSurfaceImpl
*
surface
,
IDirectDrawImpl
*
ddraw
,
DDSURFACEDESC2
*
desc
,
UINT
mip_level
,
WINED3DSURFTYPE
surface_type
)
DECLSPEC_HIDDEN
;
...
...
dlls/ddraw/surface.c
View file @
5492560c
...
...
@@ -3490,6 +3490,34 @@ static const struct IDirect3DTextureVtbl d3d_texture1_vtbl =
d3d_texture1_Unload
,
};
HRESULT
ddraw_surface_create_texture
(
IDirectDrawSurfaceImpl
*
surface
)
{
const
DDSURFACEDESC2
*
desc
=
&
surface
->
surface_desc
;
enum
wined3d_format_id
format
;
WINED3DPOOL
pool
;
UINT
levels
;
if
(
desc
->
ddsCaps
.
dwCaps
&
DDSCAPS_MIPMAP
)
levels
=
desc
->
u2
.
dwMipMapCount
;
else
levels
=
1
;
/* DDSCAPS_SYSTEMMEMORY textures are in WINED3DPOOL_SYSTEMMEM.
* Should I forward the MANAGED cap to the managed pool? */
if
(
desc
->
ddsCaps
.
dwCaps
&
DDSCAPS_SYSTEMMEMORY
)
pool
=
WINED3DPOOL_SYSTEMMEM
;
else
pool
=
WINED3DPOOL_DEFAULT
;
format
=
PixelFormat_DD2WineD3D
(
&
surface
->
surface_desc
.
u4
.
ddpfPixelFormat
);
if
(
desc
->
ddsCaps
.
dwCaps2
&
DDSCAPS2_CUBEMAP
)
return
IWineD3DDevice_CreateCubeTexture
(
surface
->
ddraw
->
wineD3DDevice
,
desc
->
dwWidth
,
levels
,
0
,
format
,
pool
,
surface
,
&
ddraw_null_wined3d_parent_ops
,
&
surface
->
wined3d_texture
);
else
return
IWineD3DDevice_CreateTexture
(
surface
->
ddraw
->
wineD3DDevice
,
desc
->
dwWidth
,
desc
->
dwHeight
,
levels
,
0
,
format
,
pool
,
surface
,
&
ddraw_null_wined3d_parent_ops
,
&
surface
->
wined3d_texture
);
}
HRESULT
ddraw_surface_init
(
IDirectDrawSurfaceImpl
*
surface
,
IDirectDrawImpl
*
ddraw
,
DDSURFACEDESC2
*
desc
,
UINT
mip_level
,
WINED3DSURFTYPE
surface_type
)
{
...
...
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