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
ec517834
Commit
ec517834
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 mapping from WICPixelFormat GUIDs to D3DFORMATs.
parent
9f05f545
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
15 deletions
+30
-15
surface.c
dlls/d3dx9_36/surface.c
+30
-15
No files found.
dlls/d3dx9_36/surface.c
View file @
ec517834
...
...
@@ -31,6 +31,34 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
/* Wine-specific WIC GUIDs */
DEFINE_GUID
(
GUID_WineContainerFormatTga
,
0x0c44fda1
,
0xa5c5
,
0x4298
,
0x96
,
0x85
,
0x47
,
0x3f
,
0xc1
,
0x7c
,
0xd3
,
0x22
);
static
const
struct
{
const
GUID
*
wic_guid
;
D3DFORMAT
d3dformat
;
}
wic_pixel_formats
[]
=
{
{
&
GUID_WICPixelFormat8bppIndexed
,
D3DFMT_L8
},
{
&
GUID_WICPixelFormat1bppIndexed
,
D3DFMT_L8
},
{
&
GUID_WICPixelFormat4bppIndexed
,
D3DFMT_L8
},
{
&
GUID_WICPixelFormat16bppBGR555
,
D3DFMT_X1R5G5B5
},
{
&
GUID_WICPixelFormat16bppBGR565
,
D3DFMT_R5G6B5
},
{
&
GUID_WICPixelFormat24bppBGR
,
D3DFMT_R8G8B8
},
{
&
GUID_WICPixelFormat32bppBGR
,
D3DFMT_X8R8G8B8
},
{
&
GUID_WICPixelFormat32bppBGRA
,
D3DFMT_A8R8G8B8
}
};
static
D3DFORMAT
wic_guid_to_d3dformat
(
const
GUID
*
guid
)
{
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
wic_pixel_formats
)
/
sizeof
(
wic_pixel_formats
[
0
]);
i
++
)
{
if
(
IsEqualGUID
(
wic_pixel_formats
[
i
].
wic_guid
,
guid
))
return
wic_pixel_formats
[
i
].
d3dformat
;
}
return
D3DFMT_UNKNOWN
;
}
/* dds_header.flags */
#define DDS_CAPS 0x1
#define DDS_HEIGHT 0x2
...
...
@@ -370,21 +398,8 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(LPCVOID data, UINT datasize, D3D
hr
=
IWICBitmapFrameDecode_GetPixelFormat
(
frame
,
&
pixel_format
);
if
(
SUCCEEDED
(
hr
))
{
if
(
IsEqualGUID
(
&
pixel_format
,
&
GUID_WICPixelFormat1bppIndexed
))
info
->
Format
=
D3DFMT_L8
;
else
if
(
IsEqualGUID
(
&
pixel_format
,
&
GUID_WICPixelFormat4bppIndexed
))
info
->
Format
=
D3DFMT_L8
;
else
if
(
IsEqualGUID
(
&
pixel_format
,
&
GUID_WICPixelFormat8bppIndexed
))
info
->
Format
=
D3DFMT_L8
;
else
if
(
IsEqualGUID
(
&
pixel_format
,
&
GUID_WICPixelFormat16bppBGR555
))
info
->
Format
=
D3DFMT_X1R5G5B5
;
else
if
(
IsEqualGUID
(
&
pixel_format
,
&
GUID_WICPixelFormat24bppBGR
))
info
->
Format
=
D3DFMT_R8G8B8
;
else
if
(
IsEqualGUID
(
&
pixel_format
,
&
GUID_WICPixelFormat32bppBGR
))
info
->
Format
=
D3DFMT_X8R8G8B8
;
else
if
(
IsEqualGUID
(
&
pixel_format
,
&
GUID_WICPixelFormat32bppBGRA
))
info
->
Format
=
D3DFMT_A8R8G8B8
;
else
{
info
->
Format
=
wic_guid_to_d3dformat
(
&
pixel_format
);
if
(
info
->
Format
==
D3DFMT_UNKNOWN
)
{
WARN
(
"Unsupported pixel format %s
\n
"
,
debugstr_guid
(
&
pixel_format
));
hr
=
D3DXERR_INVALIDDATA
;
}
...
...
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