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
20b50c00
Commit
20b50c00
authored
Feb 29, 2024
by
Connor McAdams
Committed by
Alexandre Julliard
Mar 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Use base image pointer when decompressing source image.
Signed-off-by:
Connor McAdams
<
cmcadams@codeweavers.com
>
parent
b5cd4c47
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
surface.c
dlls/d3dx9_36/surface.c
+6
-5
surface.c
dlls/d3dx9_36/tests/surface.c
+4
-4
No files found.
dlls/d3dx9_36/surface.c
View file @
20b50c00
...
...
@@ -1914,6 +1914,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
{
const
struct
pixel_format_desc
*
srcformatdesc
,
*
destformatdesc
;
struct
volume
src_size
,
dst_size
,
dst_size_aligned
;
const
BYTE
*
src_memory_offset
=
src_memory
;
RECT
dst_rect_temp
,
dst_rect_aligned
;
IDirect3DSurface9
*
surface
;
D3DSURFACE_DESC
surfdesc
;
...
...
@@ -2000,7 +2001,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
if
(
FAILED
(
hr
=
lock_surface
(
dst_surface
,
&
dst_rect_aligned
,
&
lockrect
,
&
surface
,
TRUE
)))
return
hr
;
src_memory
=
(
BYTE
*
)
src_memory
+
src_rect
->
top
/
srcformatdesc
->
block_height
*
src_pitch
src_memory
_offset
+=
src_rect
->
top
/
srcformatdesc
->
block_height
*
src_pitch
+
src_rect
->
left
/
srcformatdesc
->
block_width
*
srcformatdesc
->
block_byte_count
;
if
(
src_format
==
surfdesc
.
Format
...
...
@@ -2013,7 +2014,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
&&
!
(
dst_rect
->
top
&
(
destformatdesc
->
block_height
-
1
)))
{
TRACE
(
"Simple copy.
\n
"
);
copy_pixels
(
src_memory
,
src_pitch
,
0
,
lockrect
.
pBits
,
lockrect
.
Pitch
,
0
,
copy_pixels
(
src_memory
_offset
,
src_pitch
,
0
,
lockrect
.
pBits
,
lockrect
.
Pitch
,
0
,
&
src_size
,
srcformatdesc
);
}
else
/* Stretching or format conversion. */
...
...
@@ -2075,7 +2076,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
++
ptr
;
}
}
src_memory
=
src_uncompressed
;
src_memory
_offset
=
(
BYTE
*
)
src_uncompressed
;
src_pitch
=
src_size
.
width
*
sizeof
(
DWORD
);
srcformatdesc
=
get_format_info
(
D3DFMT_A8B8G8R8
);
}
...
...
@@ -2110,7 +2111,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
if
((
filter
&
0xf
)
==
D3DX_FILTER_NONE
)
{
convert_argb_pixels
(
src_memory
,
src_pitch
,
0
,
&
src_size
,
srcformatdesc
,
convert_argb_pixels
(
src_memory
_offset
,
src_pitch
,
0
,
&
src_size
,
srcformatdesc
,
dst_mem
,
dst_pitch
,
0
,
&
dst_size
,
dst_format
,
color_key
,
src_palette
);
}
else
/* if ((filter & 0xf) == D3DX_FILTER_POINT) */
...
...
@@ -2120,7 +2121,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
/* Always apply a point filter until D3DX_FILTER_LINEAR,
* D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */
point_filter_argb_pixels
(
src_memory
,
src_pitch
,
0
,
&
src_size
,
srcformatdesc
,
point_filter_argb_pixels
(
src_memory
_offset
,
src_pitch
,
0
,
&
src_size
,
srcformatdesc
,
dst_mem
,
dst_pitch
,
0
,
&
dst_size
,
dst_format
,
color_key
,
src_palette
);
}
...
...
dlls/d3dx9_36/tests/surface.c
View file @
20b50c00
...
...
@@ -1652,12 +1652,12 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
get_surface_decompressed_readback
(
device
,
newsurf
,
&
surface_rb
);
check_readback_pixel_4bpp
(
&
surface_rb
,
0
,
0
,
0xff0000ff
,
TRUE
);
/* Blue block, top left. */
check_readback_pixel_4bpp
(
&
surface_rb
,
3
,
3
,
0xff000000
,
TRU
E
);
/* Blue block, bottom right. */
check_readback_pixel_4bpp
(
&
surface_rb
,
3
,
3
,
0xff000000
,
FALS
E
);
/* Blue block, bottom right. */
check_readback_pixel_4bpp
(
&
surface_rb
,
7
,
0
,
0xff00ff00
,
TRUE
);
/* Green block, top right. */
check_readback_pixel_4bpp
(
&
surface_rb
,
4
,
3
,
0xff000000
,
TRU
E
);
/* Green block, bottom left. */
check_readback_pixel_4bpp
(
&
surface_rb
,
3
,
4
,
0xff000000
,
TRU
E
);
/* Red block, top right. */
check_readback_pixel_4bpp
(
&
surface_rb
,
4
,
3
,
0xff000000
,
FALS
E
);
/* Green block, bottom left. */
check_readback_pixel_4bpp
(
&
surface_rb
,
3
,
4
,
0xff000000
,
FALS
E
);
/* Red block, top right. */
check_readback_pixel_4bpp
(
&
surface_rb
,
0
,
7
,
0xffff0000
,
TRUE
);
/* Red block, bottom left. */
check_readback_pixel_4bpp
(
&
surface_rb
,
4
,
4
,
0xff000000
,
TRU
E
);
/* Black block, top left. */
check_readback_pixel_4bpp
(
&
surface_rb
,
4
,
4
,
0xff000000
,
FALS
E
);
/* Black block, top left. */
check_readback_pixel_4bpp
(
&
surface_rb
,
7
,
7
,
0xff000000
,
TRUE
);
/* Black block, bottom right. */
release_surface_readback
(
&
surface_rb
);
...
...
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