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
111e8fe7
Commit
111e8fe7
authored
Aug 02, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add WINED3DFMT_P8_UINT support to wined3d_format_convert_from_float().
parent
cf1c641c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
3 deletions
+38
-3
surface.c
dlls/wined3d/surface.c
+1
-1
utils.c
dlls/wined3d/utils.c
+36
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/surface.c
View file @
111e8fe7
...
...
@@ -7355,7 +7355,7 @@ static HRESULT cpu_blit_color_fill(struct wined3d_device *device, struct wined3d
memset
(
&
BltFx
,
0
,
sizeof
(
BltFx
));
BltFx
.
dwSize
=
sizeof
(
BltFx
);
BltFx
.
u5
.
dwFillColor
=
wined3d_format_convert_from_float
(
dst_surface
->
resource
.
format
,
color
);
BltFx
.
u5
.
dwFillColor
=
wined3d_format_convert_from_float
(
dst_surface
,
color
);
return
wined3d_surface_blt
(
dst_surface
,
dst_rect
,
NULL
,
NULL
,
WINEDDBLT_COLORFILL
,
&
BltFx
,
WINED3DTEXF_POINT
);
}
...
...
dlls/wined3d/utils.c
View file @
111e8fe7
...
...
@@ -2622,7 +2622,7 @@ BOOL getDepthStencilBits(const struct wined3d_format *format, BYTE *depthSize, B
/* Note: It's the caller's responsibility to ensure values can be expressed
* in the requested format. UNORM formats for example can only express values
* in the range 0.0f -> 1.0f. */
DWORD
wined3d_format_convert_from_float
(
const
struct
wined3d_
format
*
format
,
const
WINED3DCOLORVALUE
*
color
)
DWORD
wined3d_format_convert_from_float
(
const
struct
wined3d_
surface
*
surface
,
const
WINED3DCOLORVALUE
*
color
)
{
static
const
struct
{
...
...
@@ -2653,6 +2653,7 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_format *format, con
{
WINED3DFMT_B10G10R10A2_UNORM
,
1023
.
0
f
,
1023
.
0
f
,
1023
.
0
f
,
3
.
0
f
,
20
,
10
,
0
,
30
},
{
WINED3DFMT_R10G10B10A2_UNORM
,
1023
.
0
f
,
1023
.
0
f
,
1023
.
0
f
,
3
.
0
f
,
0
,
10
,
20
,
30
},
};
const
struct
wined3d_format
*
format
=
surface
->
resource
.
format
;
unsigned
int
i
;
TRACE
(
"Converting color {%.8e %.8e %.8e %.8e} to format %s.
\n
"
,
...
...
@@ -2674,6 +2675,40 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_format *format, con
return
ret
;
}
if
(
format
->
id
==
WINED3DFMT_P8_UINT
)
{
PALETTEENTRY
*
e
;
BYTE
r
,
g
,
b
,
a
;
if
(
!
surface
->
palette
)
{
WARN
(
"Surface doesn't have a palette, returning 0.
\n
"
);
return
0
;
}
r
=
(
BYTE
)((
color
->
r
*
255
.
0
f
)
+
0
.
5
f
);
g
=
(
BYTE
)((
color
->
g
*
255
.
0
f
)
+
0
.
5
f
);
b
=
(
BYTE
)((
color
->
b
*
255
.
0
f
)
+
0
.
5
f
);
a
=
(
BYTE
)((
color
->
a
*
255
.
0
f
)
+
0
.
5
f
);
e
=
&
surface
->
palette
->
palents
[
a
];
if
(
e
->
peRed
==
r
&&
e
->
peGreen
==
g
&&
e
->
peBlue
==
b
)
return
a
;
WARN
(
"Alpha didn't match index, searching full palette.
\n
"
);
for
(
i
=
0
;
i
<
256
;
++
i
)
{
e
=
&
surface
->
palette
->
palents
[
i
];
if
(
e
->
peRed
==
r
&&
e
->
peGreen
==
g
&&
e
->
peBlue
==
b
)
return
i
;
}
FIXME
(
"Unable to convert color to palette index.
\n
"
);
return
0
;
}
FIXME
(
"Conversion for format %s not implemented.
\n
"
,
debug_d3dformat
(
format
->
id
));
return
0
;
...
...
dlls/wined3d/wined3d_private.h
View file @
111e8fe7
...
...
@@ -2805,7 +2805,7 @@ const struct wined3d_format *wined3d_get_format(const struct wined3d_gl_info *gl
enum
wined3d_format_id
format_id
)
DECLSPEC_HIDDEN
;
UINT
wined3d_format_calculate_size
(
const
struct
wined3d_format
*
format
,
UINT
alignment
,
UINT
width
,
UINT
height
)
DECLSPEC_HIDDEN
;
DWORD
wined3d_format_convert_from_float
(
const
struct
wined3d_
format
*
format
,
DWORD
wined3d_format_convert_from_float
(
const
struct
wined3d_
surface
*
surface
,
const
WINED3DCOLORVALUE
*
color
)
DECLSPEC_HIDDEN
;
static
inline
BOOL
use_vs
(
const
struct
wined3d_state
*
state
)
...
...
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