Commit 0ec54027 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass a format instead of a surface to wined3d_format_convert_from_float().

parent 03ced2e0
...@@ -4685,7 +4685,7 @@ static HRESULT cpu_blit_color_fill(struct wined3d_device *device, struct wined3d ...@@ -4685,7 +4685,7 @@ static HRESULT cpu_blit_color_fill(struct wined3d_device *device, struct wined3d
static const RECT src_rect; static const RECT src_rect;
struct wined3d_blt_fx fx; struct wined3d_blt_fx fx;
fx.fill_color = wined3d_format_convert_from_float(surface, color); fx.fill_color = wined3d_format_convert_from_float(view->format, color);
return surface_cpu_blt(surface, rect, NULL, &src_rect, return surface_cpu_blt(surface, rect, NULL, &src_rect,
WINED3D_BLT_COLOR_FILL, &fx, WINED3D_TEXF_POINT); WINED3D_BLT_COLOR_FILL, &fx, WINED3D_TEXF_POINT);
} }
......
...@@ -4393,7 +4393,7 @@ void get_fog_start_end(const struct wined3d_context *context, const struct wined ...@@ -4393,7 +4393,7 @@ void get_fog_start_end(const struct wined3d_context *context, const struct wined
/* Note: It's the caller's responsibility to ensure values can be expressed /* 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 requested format. UNORM formats for example can only express values
* in the range 0.0f -> 1.0f. */ * in the range 0.0f -> 1.0f. */
DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface, const struct wined3d_color *color) DWORD wined3d_format_convert_from_float(const struct wined3d_format *format, const struct wined3d_color *color)
{ {
static const struct static const struct
{ {
...@@ -4426,7 +4426,6 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface, c ...@@ -4426,7 +4426,6 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface, c
{WINED3DFMT_R10G10B10A2_UNORM, 1023.0f, 1023.0f, 1023.0f, 3.0f, 0, 10, 20, 30}, {WINED3DFMT_R10G10B10A2_UNORM, 1023.0f, 1023.0f, 1023.0f, 3.0f, 0, 10, 20, 30},
{WINED3DFMT_P8_UINT, 0.0f, 0.0f, 0.0f, 255.0f, 0, 0, 0, 0}, {WINED3DFMT_P8_UINT, 0.0f, 0.0f, 0.0f, 255.0f, 0, 0, 0, 0},
}; };
const struct wined3d_format *format = surface->resource.format;
unsigned int i; unsigned int i;
TRACE("Converting color {%.8e %.8e %.8e %.8e} to format %s.\n", TRACE("Converting color {%.8e %.8e %.8e %.8e} to format %s.\n",
......
...@@ -3354,7 +3354,7 @@ void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigne ...@@ -3354,7 +3354,7 @@ void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigne
unsigned int width, unsigned int height, unsigned int *row_pitch, unsigned int *slice_pitch) DECLSPEC_HIDDEN; unsigned int width, unsigned int height, unsigned int *row_pitch, unsigned int *slice_pitch) DECLSPEC_HIDDEN;
UINT wined3d_format_calculate_size(const struct wined3d_format *format, UINT wined3d_format_calculate_size(const struct wined3d_format *format,
UINT alignment, UINT width, UINT height, UINT depth) DECLSPEC_HIDDEN; UINT alignment, UINT width, UINT height, UINT depth) DECLSPEC_HIDDEN;
DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface, DWORD wined3d_format_convert_from_float(const struct wined3d_format *format,
const struct wined3d_color *color) DECLSPEC_HIDDEN; const struct wined3d_color *color) DECLSPEC_HIDDEN;
BOOL wined3d_format_convert_color_to_float(const struct wined3d_format *format, BOOL wined3d_format_convert_color_to_float(const struct wined3d_format *format,
const struct wined3d_palette *palette, DWORD color, struct wined3d_color *float_color) DECLSPEC_HIDDEN; const struct wined3d_palette *palette, DWORD color, struct wined3d_color *float_color) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment