On 24 September 2014 17:06, Johannes Brandstätter <jbrandst(a)2ds.eu> wrote:
> + DWORD wine_map_flags = wined3d_map_flags_from_d3d10_map_type(map_type);
>
> TRACE("iface %p, map_type %u, map_flags %#x, data %p.\n", iface, map_type, map_flags, data);
>
> - if (map_type != D3D10_MAP_READ_WRITE)
> - FIXME("Ignoring map_type %#x.\n", map_type);
> if (map_flags)
> FIXME("Ignoring map_flags %#x.\n", map_flags);
>
> - return wined3d_buffer_map(buffer->wined3d_buffer, 0, 0, (BYTE **)data, 0);
> + return wined3d_buffer_map(buffer->wined3d_buffer, 0, 0, (BYTE **)data, wine_map_flags);
You don't really need the wine_map_flags variable here.
> +DWORD wined3d_map_flags_from_d3d10_map_type(D3D10_MAP map_type)
> +{
> + switch (map_type)
> + {
> + case D3D10_MAP_READ_WRITE:
> + return 0;
> +
> + case D3D10_MAP_READ:
> + return WINED3D_MAP_READONLY;
> +
> + case D3D10_MAP_WRITE_DISCARD:
> + return WINED3D_MAP_DISCARD;
> +
> + case D3D10_MAP_WRITE_NO_OVERWRITE:
> + return WINED3D_MAP_NOOVERWRITE;
> +
> + default:
> + FIXME("Unhandled map_type %#x.\n", map_type);
> + }
> +
> + return 0;
You can just return in the default case.