Commit 7459180a authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the WINED3DCOLORVALUE typedef.

parent be712203
...@@ -385,7 +385,7 @@ static void STDMETHODCALLTYPE d3d10_device_ClearRenderTargetView(ID3D10Device *i ...@@ -385,7 +385,7 @@ static void STDMETHODCALLTYPE d3d10_device_ClearRenderTargetView(ID3D10Device *i
{ {
struct d3d10_device *This = impl_from_ID3D10Device(iface); struct d3d10_device *This = impl_from_ID3D10Device(iface);
struct d3d10_rendertarget_view *view = unsafe_impl_from_ID3D10RenderTargetView(render_target_view); struct d3d10_rendertarget_view *view = unsafe_impl_from_ID3D10RenderTargetView(render_target_view);
const WINED3DCOLORVALUE color = {color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]}; const struct wined3d_color color = {color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]};
TRACE("iface %p, render_target_view %p, color_rgba [%f %f %f %f]\n", TRACE("iface %p, render_target_view %p, color_rgba [%f %f %f %f]\n",
iface, render_target_view, color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]); iface, render_target_view, color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]);
......
...@@ -1015,7 +1015,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_StretchRect(IDirect3DDevice9Ex *iface ...@@ -1015,7 +1015,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_StretchRect(IDirect3DDevice9Ex *iface
static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(IDirect3DDevice9Ex *iface, static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(IDirect3DDevice9Ex *iface,
IDirect3DSurface9 *pSurface, const RECT *pRect, D3DCOLOR color) IDirect3DSurface9 *pSurface, const RECT *pRect, D3DCOLOR color)
{ {
const WINED3DCOLORVALUE c = const struct wined3d_color c =
{ {
((color >> 16) & 0xff) / 255.0f, ((color >> 16) & 0xff) / 255.0f,
((color >> 8) & 0xff) / 255.0f, ((color >> 8) & 0xff) / 255.0f,
......
...@@ -7327,7 +7327,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter, ...@@ -7327,7 +7327,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface, static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface,
const RECT *dst_rect, const WINED3DCOLORVALUE *color) const RECT *dst_rect, const struct wined3d_color *color)
{ {
FIXME("Color filling not implemented by arbfp_blit\n"); FIXME("Color filling not implemented by arbfp_blit\n");
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
......
...@@ -645,7 +645,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context ...@@ -645,7 +645,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb, HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb,
UINT rect_count, const RECT *rects, const RECT *draw_rect, DWORD flags, const WINED3DCOLORVALUE *color, UINT rect_count, const RECT *rects, const RECT *draw_rect, DWORD flags, const struct wined3d_color *color,
float depth, DWORD stencil) float depth, DWORD stencil)
{ {
const RECT *clear_rect = (rect_count > 0 && rects) ? (const RECT *)rects : NULL; const RECT *clear_rect = (rect_count > 0 && rects) ? (const RECT *)rects : NULL;
...@@ -956,7 +956,7 @@ static void device_load_logo(struct wined3d_device *device, const char *filename ...@@ -956,7 +956,7 @@ static void device_load_logo(struct wined3d_device *device, const char *filename
} }
else else
{ {
const WINED3DCOLORVALUE c = {1.0f, 1.0f, 1.0f, 1.0f}; const struct wined3d_color c = {1.0f, 1.0f, 1.0f, 1.0f};
/* Fill the surface with a white color to show that wined3d is there */ /* Fill the surface with a white color to show that wined3d is there */
wined3d_device_color_fill(device, device->logo_surface, NULL, &c); wined3d_device_color_fill(device, device->logo_surface, NULL, &c);
} }
...@@ -4027,7 +4027,7 @@ HRESULT CDECL wined3d_device_present(const struct wined3d_device *device, const ...@@ -4027,7 +4027,7 @@ HRESULT CDECL wined3d_device_present(const struct wined3d_device *device, const
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count,
const RECT *rects, DWORD flags, WINED3DCOLOR color, float depth, DWORD stencil) const RECT *rects, DWORD flags, WINED3DCOLOR color, float depth, DWORD stencil)
{ {
const WINED3DCOLORVALUE c = {D3DCOLOR_R(color), D3DCOLOR_G(color), D3DCOLOR_B(color), D3DCOLOR_A(color)}; const struct wined3d_color c = {D3DCOLOR_R(color), D3DCOLOR_G(color), D3DCOLOR_B(color), D3DCOLOR_A(color)};
RECT draw_rect; RECT draw_rect;
TRACE("device %p, rect_count %u, rects %p, flags %#x, color 0x%08x, depth %.8e, stencil %u.\n", TRACE("device %p, rect_count %u, rects %p, flags %#x, color 0x%08x, depth %.8e, stencil %u.\n",
...@@ -4780,7 +4780,7 @@ HRESULT CDECL wined3d_device_delete_patch(struct wined3d_device *device, UINT ha ...@@ -4780,7 +4780,7 @@ HRESULT CDECL wined3d_device_delete_patch(struct wined3d_device *device, UINT ha
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
HRESULT CDECL wined3d_device_color_fill(struct wined3d_device *device, HRESULT CDECL wined3d_device_color_fill(struct wined3d_device *device,
struct wined3d_surface *surface, const RECT *rect, const WINED3DCOLORVALUE *color) struct wined3d_surface *surface, const RECT *rect, const struct wined3d_color *color)
{ {
RECT r; RECT r;
...@@ -4805,7 +4805,7 @@ HRESULT CDECL wined3d_device_color_fill(struct wined3d_device *device, ...@@ -4805,7 +4805,7 @@ HRESULT CDECL wined3d_device_color_fill(struct wined3d_device *device,
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
void CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, void CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
struct wined3d_rendertarget_view *rendertarget_view, const WINED3DCOLORVALUE *color) struct wined3d_rendertarget_view *rendertarget_view, const struct wined3d_color *color)
{ {
struct wined3d_resource *resource; struct wined3d_resource *resource;
HRESULT hr; HRESULT hr;
......
...@@ -1283,7 +1283,7 @@ static BOOL primary_render_target_is_p8(const struct wined3d_device *device) ...@@ -1283,7 +1283,7 @@ static BOOL primary_render_target_is_p8(const struct wined3d_device *device)
} }
static BOOL surface_convert_color_to_float(const struct wined3d_surface *surface, static BOOL surface_convert_color_to_float(const struct wined3d_surface *surface,
DWORD color, WINED3DCOLORVALUE *float_color) DWORD color, struct wined3d_color *float_color)
{ {
const struct wined3d_format *format = surface->resource.format; const struct wined3d_format *format = surface->resource.format;
const struct wined3d_device *device = surface->resource.device; const struct wined3d_device *device = surface->resource.device;
...@@ -1652,7 +1652,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC ...@@ -1652,7 +1652,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
if (flags & WINEDDBLT_COLORFILL) if (flags & WINEDDBLT_COLORFILL)
{ {
WINED3DCOLORVALUE color; struct wined3d_color color;
TRACE("Color fill.\n"); TRACE("Color fill.\n");
...@@ -5290,7 +5290,7 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, ...@@ -5290,7 +5290,7 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
} }
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const WINED3DCOLORVALUE *color) HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color)
{ {
struct wined3d_device *device = s->resource.device; struct wined3d_device *device = s->resource.device;
const struct blit_shader *blitter; const struct blit_shader *blitter;
...@@ -6330,7 +6330,7 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info, enum wined ...@@ -6330,7 +6330,7 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info, enum wined
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface, static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface,
const RECT *dst_rect, const WINED3DCOLORVALUE *color) const RECT *dst_rect, const struct wined3d_color *color)
{ {
const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height};
struct wined3d_fb_state fb = {&dst_surface, NULL}; struct wined3d_fb_state fb = {&dst_surface, NULL};
...@@ -7057,7 +7057,7 @@ release: ...@@ -7057,7 +7057,7 @@ release:
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
static HRESULT cpu_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface, static HRESULT cpu_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface,
const RECT *dst_rect, const WINED3DCOLORVALUE *color) const RECT *dst_rect, const struct wined3d_color *color)
{ {
static const RECT src_rect; static const RECT src_rect;
WINEDDBLTFX BltFx; WINEDDBLTFX BltFx;
......
...@@ -2708,7 +2708,7 @@ BOOL getDepthStencilBits(const struct wined3d_format *format, BYTE *depthSize, B ...@@ -2708,7 +2708,7 @@ BOOL getDepthStencilBits(const struct wined3d_format *format, BYTE *depthSize, B
/* 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 WINED3DCOLORVALUE *color) DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface, const struct wined3d_color *color)
{ {
static const struct static const struct
{ {
......
...@@ -1206,7 +1206,7 @@ struct blit_shader ...@@ -1206,7 +1206,7 @@ struct blit_shader
const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool, const struct wined3d_format *src_format, const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool, const struct wined3d_format *src_format,
const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool, const struct wined3d_format *dst_format); const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool, const struct wined3d_format *dst_format);
HRESULT (*color_fill)(struct wined3d_device *device, struct wined3d_surface *dst_surface, HRESULT (*color_fill)(struct wined3d_device *device, struct wined3d_surface *dst_surface,
const RECT *dst_rect, const WINED3DCOLORVALUE *color); const RECT *dst_rect, const struct wined3d_color *color);
HRESULT (*depth_fill)(struct wined3d_device *device, HRESULT (*depth_fill)(struct wined3d_device *device,
struct wined3d_surface *surface, const RECT *rect, float depth); struct wined3d_surface *surface, const RECT *rect, float depth);
}; };
...@@ -1757,7 +1757,7 @@ struct wined3d_device ...@@ -1757,7 +1757,7 @@ struct wined3d_device
HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb, HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb,
UINT rect_count, const RECT *rects, const RECT *draw_rect, DWORD flags, UINT rect_count, const RECT *rects, const RECT *draw_rect, DWORD flags,
const WINED3DCOLORVALUE *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN;
BOOL device_context_add(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; BOOL device_context_add(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
void device_context_remove(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; void device_context_remove(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
...@@ -2073,7 +2073,8 @@ static inline GLuint surface_get_texture_name(const struct wined3d_surface *surf ...@@ -2073,7 +2073,8 @@ static inline GLuint surface_get_texture_name(const struct wined3d_surface *surf
void surface_add_dirty_rect(struct wined3d_surface *surface, const WINED3DBOX *dirty_rect) DECLSPEC_HIDDEN; void surface_add_dirty_rect(struct wined3d_surface *surface, const WINED3DBOX *dirty_rect) DECLSPEC_HIDDEN;
void surface_bind(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void surface_bind(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const WINED3DCOLORVALUE *color) DECLSPEC_HIDDEN; HRESULT surface_color_fill(struct wined3d_surface *s,
const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN;
GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN; GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN;
BOOL surface_init_sysmem(struct wined3d_surface *surface) DECLSPEC_HIDDEN; BOOL surface_init_sysmem(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void surface_internal_preload(struct wined3d_surface *surface, enum WINED3DSRGB srgb) DECLSPEC_HIDDEN; void surface_internal_preload(struct wined3d_surface *surface, enum WINED3DSRGB srgb) DECLSPEC_HIDDEN;
...@@ -2823,7 +2824,7 @@ const struct wined3d_format *wined3d_get_format(const struct wined3d_gl_info *gl ...@@ -2823,7 +2824,7 @@ const struct wined3d_format *wined3d_get_format(const struct wined3d_gl_info *gl
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) DECLSPEC_HIDDEN; UINT alignment, UINT width, UINT height) DECLSPEC_HIDDEN;
DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface, DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface,
const WINED3DCOLORVALUE *color) DECLSPEC_HIDDEN; const struct wined3d_color *color) DECLSPEC_HIDDEN;
static inline BOOL use_vs(const struct wined3d_state *state) static inline BOOL use_vs(const struct wined3d_state *state)
{ {
......
...@@ -1519,13 +1519,13 @@ typedef struct _WINED3DDISPLAYMODE ...@@ -1519,13 +1519,13 @@ typedef struct _WINED3DDISPLAYMODE
enum wined3d_format_id Format; enum wined3d_format_id Format;
} WINED3DDISPLAYMODE; } WINED3DDISPLAYMODE;
typedef struct _WINED3DCOLORVALUE struct wined3d_color
{ {
float r; float r;
float g; float g;
float b; float b;
float a; float a;
} WINED3DCOLORVALUE; };
typedef struct _WINED3DVECTOR typedef struct _WINED3DVECTOR
{ {
...@@ -1552,9 +1552,9 @@ typedef struct _WINED3DMATRIX ...@@ -1552,9 +1552,9 @@ typedef struct _WINED3DMATRIX
typedef struct _WINED3DLIGHT typedef struct _WINED3DLIGHT
{ {
WINED3DLIGHTTYPE Type; WINED3DLIGHTTYPE Type;
WINED3DCOLORVALUE Diffuse; struct wined3d_color Diffuse;
WINED3DCOLORVALUE Specular; struct wined3d_color Specular;
WINED3DCOLORVALUE Ambient; struct wined3d_color Ambient;
WINED3DVECTOR Position; WINED3DVECTOR Position;
WINED3DVECTOR Direction; WINED3DVECTOR Direction;
float Range; float Range;
...@@ -1568,10 +1568,10 @@ typedef struct _WINED3DLIGHT ...@@ -1568,10 +1568,10 @@ typedef struct _WINED3DLIGHT
typedef struct _WINED3DMATERIAL typedef struct _WINED3DMATERIAL
{ {
WINED3DCOLORVALUE Diffuse; struct wined3d_color Diffuse;
WINED3DCOLORVALUE Ambient; struct wined3d_color Ambient;
WINED3DCOLORVALUE Specular; struct wined3d_color Specular;
WINED3DCOLORVALUE Emissive; struct wined3d_color Emissive;
float Power; float Power;
} WINED3DMATERIAL; } WINED3DMATERIAL;
...@@ -2170,9 +2170,9 @@ HRESULT __cdecl wined3d_device_begin_stateblock(struct wined3d_device *device); ...@@ -2170,9 +2170,9 @@ HRESULT __cdecl wined3d_device_begin_stateblock(struct wined3d_device *device);
HRESULT __cdecl wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, HRESULT __cdecl wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags,
WINED3DCOLOR color, float z, DWORD stencil); WINED3DCOLOR color, float z, DWORD stencil);
void __cdecl wined3d_device_clear_rendertarget_view(struct wined3d_device *device, void __cdecl wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
struct wined3d_rendertarget_view *rendertarget_view, const WINED3DCOLORVALUE *color); struct wined3d_rendertarget_view *rendertarget_view, const struct wined3d_color *color);
HRESULT __cdecl wined3d_device_color_fill(struct wined3d_device *device, struct wined3d_surface *surface, HRESULT __cdecl wined3d_device_color_fill(struct wined3d_device *device, struct wined3d_surface *surface,
const RECT *rect, const WINED3DCOLORVALUE *color); const RECT *rect, const struct wined3d_color *color);
HRESULT __cdecl wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx, HRESULT __cdecl wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx,
WINED3DDEVTYPE device_type, HWND focus_window, DWORD behaviour_flags, BYTE surface_alignment, WINED3DDEVTYPE device_type, HWND focus_window, DWORD behaviour_flags, BYTE surface_alignment,
struct wined3d_device_parent *device_parent, struct wined3d_device **device); struct wined3d_device_parent *device_parent, struct wined3d_device **device);
......
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