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
5193f670
Commit
5193f670
authored
Oct 30, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 31, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Implement copy_mipmap_chain() on top of wined3d_surface_blt().
parent
94fd6dc0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
28 deletions
+13
-28
device.c
dlls/ddraw/device.c
+13
-28
No files found.
dlls/ddraw/device.c
View file @
5193f670
...
...
@@ -5942,12 +5942,11 @@ static void copy_mipmap_chain(IDirect3DDeviceImpl *device,
IDirectDrawSurface7
*
temp
;
DDSURFACEDESC2
ddsd
;
POINT
point
;
RECT
rect
;
RECT
src_
rect
;
HRESULT
hr
;
IDirectDrawPalette
*
pal
=
NULL
,
*
pal_src
=
NULL
;
DWORD
ckeyflag
;
DDCOLORKEY
ddckey
;
BOOL
palette_missing
=
FALSE
;
/* Copy palette, if possible. */
IDirectDrawSurface7_GetPalette
(
&
src
->
IDirectDrawSurface7_iface
,
&
pal_src
);
...
...
@@ -5961,12 +5960,6 @@ static void copy_mipmap_chain(IDirect3DDeviceImpl *device,
IDirectDrawPalette_SetEntries
(
pal
,
0
,
0
,
256
,
palent
);
}
if
(
dest
->
surface_desc
.
u4
.
ddpfPixelFormat
.
dwFlags
&
(
DDPF_PALETTEINDEXED1
|
DDPF_PALETTEINDEXED2
|
DDPF_PALETTEINDEXED4
|
DDPF_PALETTEINDEXED8
|
DDPF_PALETTEINDEXEDTO8
)
&&
!
pal
)
{
palette_missing
=
TRUE
;
}
if
(
pal
)
IDirectDrawPalette_Release
(
pal
);
if
(
pal_src
)
IDirectDrawPalette_Release
(
pal_src
);
...
...
@@ -5985,28 +5978,20 @@ static void copy_mipmap_chain(IDirect3DDeviceImpl *device,
dest_level
=
dest
;
point
=
*
DestPoint
;
rect
=
*
SrcRect
;
src_
rect
=
*
SrcRect
;
for
(;
src_level
&&
dest_level
;)
{
if
(
src_level
->
surface_desc
.
dwWidth
==
dest_level
->
surface_desc
.
dwWidth
&&
src_level
->
surface_desc
.
dwHeight
==
dest_level
->
surface_desc
.
dwHeight
)
{
/* Try UpdateSurface that may perform a more direct OpenGL
* loading. But skip this if destination is paletted texture and
* has no palette. Some games like Sacrifice set palette after
* Load, and it is a waste of effort to try to load texture
* without palette and generates warnings in wined3d. */
if
(
!
palette_missing
)
hr
=
wined3d_device_update_surface
(
device
->
wined3d_device
,
src_level
->
wined3d_surface
,
&
rect
,
dest_level
->
wined3d_surface
,
&
point
);
if
(
palette_missing
||
FAILED
(
hr
))
{
/* UpdateSurface may fail e.g. if dest is in system memory. Fall back to BltFast that is less strict. */
wined3d_surface_bltfast
(
dest_level
->
wined3d_surface
,
point
.
x
,
point
.
y
,
src_level
->
wined3d_surface
,
&
rect
,
0
);
}
UINT
src_w
=
src_rect
.
right
-
src_rect
.
left
;
UINT
src_h
=
src_rect
.
bottom
-
src_rect
.
top
;
RECT
dst_rect
=
{
point
.
x
,
point
.
y
,
point
.
x
+
src_w
,
point
.
y
+
src_h
};
if
(
FAILED
(
hr
=
wined3d_surface_blt
(
dest_level
->
wined3d_surface
,
&
dst_rect
,
src_level
->
wined3d_surface
,
&
src_rect
,
0
,
NULL
,
WINED3DTEXF_POINT
)))
ERR
(
"Blit failed, hr %#x.
\n
"
,
hr
);
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_TEXTURE
;
ddsd
.
ddsCaps
.
dwCaps2
=
DDSCAPS2_MIPMAPSUBLEVEL
;
...
...
@@ -6028,10 +6013,10 @@ static void copy_mipmap_chain(IDirect3DDeviceImpl *device,
point
.
x
/=
2
;
point
.
y
/=
2
;
rect
.
top
/=
2
;
rect
.
left
/=
2
;
rect
.
right
=
(
rect
.
right
+
1
)
/
2
;
rect
.
bottom
=
(
rect
.
bottom
+
1
)
/
2
;
src_
rect
.
top
/=
2
;
src_
rect
.
left
/=
2
;
src_rect
.
right
=
(
src_
rect
.
right
+
1
)
/
2
;
src_rect
.
bottom
=
(
src_
rect
.
bottom
+
1
)
/
2
;
}
if
(
src_level
&&
src_level
!=
src
)
IDirectDrawSurface7_Release
(
&
src_level
->
IDirectDrawSurface7_iface
);
...
...
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