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
f0bb4255
Commit
f0bb4255
authored
May 04, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
May 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Implement the pixel format conversion in D3DXSaveSurfaceToFileW.
parent
ec70b67b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
4 deletions
+50
-4
surface.c
dlls/d3dx9_36/surface.c
+50
-4
No files found.
dlls/d3dx9_36/surface.c
View file @
f0bb4255
...
...
@@ -1527,15 +1527,61 @@ HRESULT WINAPI D3DXSaveSurfaceToFileW(const WCHAR *dst_filename, D3DXIMAGE_FILEF
IWICBitmapFrameEncode_WritePixels
(
frame
,
height
,
locked_rect
.
Pitch
,
height
*
locked_rect
.
Pitch
,
locked_rect
.
pBits
);
IDirect3DSurface9_UnlockRect
(
src_surface
);
hr
=
IWICBitmapFrameEncode_Commit
(
frame
);
}
}
else
FIXME
(
"Unsupported pixel format conversion %#x -> %#x
\n
"
,
src_surface_desc
.
Format
,
d3d_pixel_format
);
else
/* Pixel format conversion */
{
const
PixelFormatDesc
*
src_format_desc
,
*
dst_format_desc
;
SIZE
size
;
DWORD
dst_pitch
;
void
*
dst_data
;
src_format_desc
=
get_format_info
(
src_surface_desc
.
Format
);
dst_format_desc
=
get_format_info
(
d3d_pixel_format
);
if
(
src_format_desc
->
format
==
D3DFMT_UNKNOWN
||
dst_format_desc
->
format
==
D3DFMT_UNKNOWN
)
{
FIXME
(
"Unsupported pixel format conversion %#x -> %#x
\n
"
,
src_format_desc
->
format
,
dst_format_desc
->
format
);
hr
=
E_NOTIMPL
;
goto
cleanup
;
}
if
(
src_format_desc
->
bytes_per_pixel
>
4
||
dst_format_desc
->
bytes_per_pixel
>
4
||
src_format_desc
->
block_height
!=
1
||
src_format_desc
->
block_width
!=
1
||
dst_format_desc
->
block_height
!=
1
||
dst_format_desc
->
block_width
!=
1
)
{
hr
=
E_NOTIMPL
;
goto
cleanup
;
}
size
.
cx
=
width
;
size
.
cy
=
height
;
dst_pitch
=
width
*
dst_format_desc
->
bytes_per_pixel
;
dst_data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dst_pitch
*
height
);
if
(
!
dst_data
)
{
hr
=
E_OUTOFMEMORY
;
goto
cleanup
;
}
hr
=
IDirect3DSurface9_LockRect
(
src_surface
,
&
locked_rect
,
src_rect
,
D3DLOCK_READONLY
);
if
(
SUCCEEDED
(
hr
))
{
copy_simple_data
(
locked_rect
.
pBits
,
locked_rect
.
Pitch
,
size
,
src_format_desc
,
dst_data
,
dst_pitch
,
size
,
dst_format_desc
,
0
);
IDirect3DSurface9_UnlockRect
(
src_surface
);
}
IWICBitmapFrameEncode_WritePixels
(
frame
,
height
,
dst_pitch
,
dst_pitch
*
height
,
dst_data
);
HeapFree
(
GetProcessHeap
(),
0
,
dst_data
);
}
hr
=
IWICBitmapFrameEncode_Commit
(
frame
);
if
(
SUCCEEDED
(
hr
))
hr
=
IWICBitmapEncoder_Commit
(
encoder
);
}
else
WARN
(
"Unsupported pixel format %#x
\n
"
,
src_surface_desc
.
Format
);
if
(
SUCCEEDED
(
hr
))
hr
=
IWICBitmapEncoder_Commit
(
encoder
);
cleanup_err:
if
(
FAILED
(
hr
))
hr
=
D3DERR_INVALIDCALL
;
...
...
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