Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
42dd957c
Commit
42dd957c
authored
May 13, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
May 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Add missing pixel formats.
parent
5e4d64d1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
3 deletions
+25
-3
surface.c
dlls/d3dx9_36/surface.c
+20
-3
surface.c
dlls/d3dx9_36/tests/surface.c
+4
-0
util.c
dlls/d3dx9_36/util.c
+1
-0
No files found.
dlls/d3dx9_36/surface.c
View file @
42dd957c
...
...
@@ -104,6 +104,7 @@ static const GUID *d3dformat_to_wic_guid(D3DFORMAT format)
#define DDS_PF_RGB 0x40
#define DDS_PF_YUV 0x200
#define DDS_PF_LUMINANCE 0x20000
#define DDS_PF_BUMPDUDV 0x80000
struct
dds_pixel_format
{
...
...
@@ -217,6 +218,8 @@ static D3DFORMAT dds_luminance_to_d3dformat(const struct dds_pixel_format *pixel
}
if
(
pixel_format
->
bpp
==
16
)
{
if
(
pixel_format
->
rmask
==
0xffff
)
return
D3DFMT_L16
;
if
((
pixel_format
->
flags
&
DDS_PF_ALPHA
)
&&
pixel_format
->
rmask
==
0x00ff
&&
pixel_format
->
amask
==
0xff00
)
return
D3DFMT_A8L8
;
}
...
...
@@ -235,6 +238,18 @@ static D3DFORMAT dds_alpha_to_d3dformat(const struct dds_pixel_format *pixel_for
return
D3DFMT_UNKNOWN
;
}
static
D3DFORMAT
dds_bump_to_d3dformat
(
const
struct
dds_pixel_format
*
pixel_format
)
{
if
(
pixel_format
->
bpp
==
16
&&
pixel_format
->
rmask
==
0x00ff
&&
pixel_format
->
gmask
==
0xff00
)
return
D3DFMT_V8U8
;
if
(
pixel_format
->
bpp
==
32
&&
pixel_format
->
rmask
==
0x0000ffff
&&
pixel_format
->
gmask
==
0xffff0000
)
return
D3DFMT_V16U16
;
WARN
(
"Unknown bump pixel format (%#x, %#x, %#x, %#x, %#x)
\n
"
,
pixel_format
->
bpp
,
pixel_format
->
rmask
,
pixel_format
->
gmask
,
pixel_format
->
bmask
,
pixel_format
->
amask
);
return
D3DFMT_UNKNOWN
;
}
static
D3DFORMAT
dds_pixel_format_to_d3dformat
(
const
struct
dds_pixel_format
*
pixel_format
)
{
if
(
pixel_format
->
flags
&
DDS_PF_FOURCC
)
...
...
@@ -245,10 +260,12 @@ static D3DFORMAT dds_pixel_format_to_d3dformat(const struct dds_pixel_format *pi
return
dds_luminance_to_d3dformat
(
pixel_format
);
if
(
pixel_format
->
flags
&
DDS_PF_ALPHA_ONLY
)
return
dds_alpha_to_d3dformat
(
pixel_format
);
if
(
pixel_format
->
flags
&
DDS_PF_BUMPDUDV
)
return
dds_bump_to_d3dformat
(
pixel_format
);
WARN
(
"Unknown pixel format (fourcc %#x, bpp %#x, r %#x, g %#x, b %#x, a %#x)
\n
"
,
pixel_format
->
f
ourcc
,
pixel_format
->
bpp
,
pixel_format
->
rmask
,
pixel_format
->
gmask
,
pixel_format
->
bmask
,
pixel_format
->
amask
);
WARN
(
"Unknown pixel format (f
lags %#x, f
ourcc %#x, bpp %#x, r %#x, g %#x, b %#x, a %#x)
\n
"
,
pixel_format
->
f
lags
,
pixel_format
->
fourcc
,
pixel_format
->
bpp
,
pixel_format
->
rmask
,
pixel_format
->
gmask
,
pixel_format
->
bmask
,
pixel_format
->
amask
);
return
D3DFMT_UNKNOWN
;
}
...
...
dlls/d3dx9_36/tests/surface.c
View file @
42dd957c
...
...
@@ -150,6 +150,7 @@ static HRESULT create_file(const char *filename, const unsigned char *data, cons
#define DDS_PF_FOURCC 0x00000004
#define DDS_PF_RGB 0x00000040
#define DDS_PF_LUMINANCE 0x00020000
#define DDS_PF_BUMPDUDV 0x00080000
static
void
check_dds_pixel_format
(
DWORD
flags
,
DWORD
fourcc
,
DWORD
bpp
,
DWORD
rmask
,
DWORD
gmask
,
DWORD
bmask
,
DWORD
amask
,
...
...
@@ -397,8 +398,11 @@ static void test_D3DXGetImageInfo(void)
check_dds_pixel_format
(
DDS_PF_RGB
,
0
,
32
,
0xff0000
,
0x00ff00
,
0x0000ff
,
0
,
D3DFMT_X8R8G8B8
);
check_dds_pixel_format
(
DDS_PF_RGB
,
0
,
32
,
0x0000ffff
,
0xffff0000
,
0
,
0
,
D3DFMT_G16R16
);
check_dds_pixel_format
(
DDS_PF_LUMINANCE
,
0
,
8
,
0xff
,
0
,
0
,
0
,
D3DFMT_L8
);
check_dds_pixel_format
(
DDS_PF_LUMINANCE
,
0
,
16
,
0xffff
,
0
,
0
,
0
,
D3DFMT_L16
);
check_dds_pixel_format
(
DDS_PF_LUMINANCE
|
DDS_PF_ALPHA
,
0
,
16
,
0x00ff
,
0
,
0
,
0xff00
,
D3DFMT_A8L8
);
check_dds_pixel_format
(
DDS_PF_LUMINANCE
|
DDS_PF_ALPHA
,
0
,
8
,
0x0f
,
0
,
0
,
0xf0
,
D3DFMT_A4L4
);
check_dds_pixel_format
(
DDS_PF_BUMPDUDV
,
0
,
16
,
0x00ff
,
0xff00
,
0
,
0
,
D3DFMT_V8U8
);
check_dds_pixel_format
(
DDS_PF_BUMPDUDV
,
0
,
32
,
0x0000ffff
,
0xffff0000
,
0
,
0
,
D3DFMT_V16U16
);
todo_wine
{
hr
=
D3DXGetImageInfoFromFileInMemory
(
dds_16bit
,
sizeof
(
dds_16bit
)
-
1
,
&
info
);
...
...
dlls/d3dx9_36/util.c
View file @
42dd957c
...
...
@@ -62,6 +62,7 @@ static const PixelFormatDesc formats[] =
{
D3DFMT_G16R16
,
{
0
,
16
,
16
,
0
},
{
0
,
0
,
16
,
0
},
4
,
1
,
1
,
4
,
FORMAT_ARGB
,
NULL
,
NULL
},
{
D3DFMT_A8
,
{
8
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
1
,
1
,
1
,
1
,
FORMAT_ARGB
,
NULL
,
NULL
},
{
D3DFMT_A8L8
,
{
8
,
8
,
0
,
0
},
{
8
,
0
,
0
,
0
},
2
,
1
,
1
,
2
,
FORMAT_ARGB
,
la_from_rgba
,
la_to_rgba
},
{
D3DFMT_A4L4
,
{
4
,
4
,
0
,
0
},
{
4
,
0
,
0
,
0
},
1
,
1
,
1
,
1
,
FORMAT_ARGB
,
la_from_rgba
,
la_to_rgba
},
{
D3DFMT_DXT1
,
{
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
1
,
4
,
4
,
8
,
FORMAT_ARGB
,
NULL
,
NULL
},
{
D3DFMT_DXT2
,
{
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
1
,
4
,
4
,
16
,
FORMAT_ARGB
,
NULL
,
NULL
},
{
D3DFMT_DXT3
,
{
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
1
,
4
,
4
,
16
,
FORMAT_ARGB
,
NULL
,
NULL
},
...
...
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