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
0321e636
Commit
0321e636
authored
Apr 22, 2013
by
Christian Costa
Committed by
Alexandre Julliard
Apr 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: Add DIB file support to D3DXSaveSurfaceToFileInMemory.
parent
792e2ee2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
surface.c
dlls/d3dx9_36/surface.c
+8
-1
No files found.
dlls/d3dx9_36/surface.c
View file @
0321e636
...
...
@@ -1941,6 +1941,7 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
switch
(
file_format
)
{
case
D3DXIFF_BMP
:
case
D3DXIFF_DIB
:
encoder_clsid
=
&
CLSID_WICBmpEncoder
;
break
;
case
D3DXIFF_PNG
:
...
...
@@ -1951,7 +1952,6 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
break
;
case
D3DXIFF_DDS
:
return
save_dds_surface_to_memory
(
dst_buffer
,
src_surface
,
src_rect
);
case
D3DXIFF_DIB
:
case
D3DXIFF_HDR
:
case
D3DXIFF_PFM
:
case
D3DXIFF_TGA
:
...
...
@@ -2088,6 +2088,10 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
}
size
=
stream_stats
.
cbSize
.
u
.
LowPart
;
/* Remove BMP header for DIB */
if
(
file_format
==
D3DXIFF_DIB
)
size
-=
sizeof
(
BITMAPFILEHEADER
);
hr
=
D3DXCreateBuffer
(
size
,
&
buffer
);
if
(
FAILED
(
hr
))
goto
cleanup
;
...
...
@@ -2096,6 +2100,9 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
{
void
*
buffer_pointer
=
ID3DXBuffer_GetBufferPointer
(
buffer
);
void
*
stream_data
=
GlobalLock
(
stream_hglobal
);
/* Remove BMP header for DIB */
if
(
file_format
==
D3DXIFF_DIB
)
stream_data
=
(
void
*
)((
BYTE
*
)
stream_data
+
sizeof
(
BITMAPFILEHEADER
));
memcpy
(
buffer_pointer
,
stream_data
,
size
);
GlobalUnlock
(
stream_hglobal
);
*
dst_buffer
=
buffer
;
...
...
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