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
f934ef1a
Commit
f934ef1a
authored
Sep 27, 2019
by
Matteo Bruni
Committed by
Alexandre Julliard
Sep 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Compute the correct source rect in D3DXLoadSurfaceFromFileInMemory().
Signed-off-by:
Matteo Bruni
<
mbruni@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
536fce7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
surface.c
dlls/d3dx9_36/surface.c
+1
-1
texture.c
dlls/d3dx9_36/tests/texture.c
+22
-0
No files found.
dlls/d3dx9_36/surface.c
View file @
f934ef1a
...
...
@@ -1168,7 +1168,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface,
wicrect
.
Height
=
imginfo
.
Height
;
}
SetRect
(
&
rect
,
0
,
0
,
wicrect
.
Width
,
wicrect
.
Height
);
SetRect
(
&
rect
,
wicrect
.
X
,
wicrect
.
Y
,
wicrect
.
X
+
wicrect
.
Width
,
wicrect
.
Y
+
wicrect
.
Height
);
if
(
imginfo
.
ImageFileFormat
==
D3DXIFF_DDS
)
{
...
...
dlls/d3dx9_36/tests/texture.c
View file @
f934ef1a
...
...
@@ -1824,6 +1824,28 @@ static void test_D3DXCreateTextureFromFileInMemory(IDirect3DDevice9 *device)
hr
=
IDirect3DSurface9_UnlockRect
(
uncompressed_surface
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
D3DXLoadSurfaceFromFileInMemory
(
surface
,
NULL
,
&
rect
,
dds_dxt5_8_8
,
sizeof
(
dds_dxt5_8_8
),
&
rect
,
D3DX_FILTER_POINT
,
0
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
D3DXLoadSurfaceFromSurface
(
uncompressed_surface
,
NULL
,
NULL
,
surface
,
NULL
,
NULL
,
D3DX_FILTER_NONE
,
0
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface9_LockRect
(
uncompressed_surface
,
&
lock_rect
,
NULL
,
D3DLOCK_READONLY
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
for
(
y
=
0
;
y
<
8
;
++
y
)
{
for
(
x
=
0
;
x
<
8
;
++
x
)
{
ok
(
compare_color
(((
DWORD
*
)
lock_rect
.
pBits
)[
lock_rect
.
Pitch
/
4
*
y
+
x
],
dds_dxt5_8_8_expected_misaligned_3
[
y
*
8
+
x
],
0
),
"Color at position %u, %u is 0x%08x, expected 0x%08x.
\n
"
,
x
,
y
,
((
DWORD
*
)
lock_rect
.
pBits
)[
lock_rect
.
Pitch
/
4
*
y
+
x
],
dds_dxt5_8_8_expected_misaligned_3
[
y
*
8
+
x
]);
}
}
hr
=
IDirect3DSurface9_UnlockRect
(
uncompressed_surface
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirect3DSurface9_Release
(
uncompressed_surface
);
IDirect3DSurface9_Release
(
surface
);
IDirect3DTexture9_Release
(
texture
);
...
...
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