On 2 May 2012 23:32, Józef Kucia joseph.kucia@gmail.com wrote:
- if(wic_pixel_formats[i].d3dformat == format)
Missing whitespace.
+HRESULT WINAPI D3DXSaveSurfaceToFileW(LPCWSTR dst_filename, D3DXIMAGE_FILEFORMAT file_format,
"LPCWSTR" -> "const WCHAR *"
- TRACE("(%s, %d, %p, %p, %p)\n",
- wine_dbgstr_w(dst_filename), file_format, src_surface, src_palette, src_rect);
wine_dbgstr_rect().
- memcpy(&wic_pixel_format, pixel_format_guid, sizeof(GUID));
- hr = IWICBitmapFrameEncode_SetPixelFormat(frame, &wic_pixel_format);
- d3d_pixel_format = wic_guid_to_d3dformat(&wic_pixel_format);
What is all this for?
Also, how do you intend to implement D3DXSaveSurfaceToFileInMemory()?
Thanks for the review.
On Thu, May 3, 2012 at 1:08 PM, Henri Verbeet hverbeet@gmail.com wrote:
- memcpy(&wic_pixel_format, pixel_format_guid, sizeof(GUID));
- hr = IWICBitmapFrameEncode_SetPixelFormat(frame, &wic_pixel_format);
- d3d_pixel_format = wic_guid_to_d3dformat(&wic_pixel_format);
What is all this for?
If a WIC bitmap encoder doesn't support a given pixel format, it returns the closest supported pixel format.
Also, how do you intend to implement D3DXSaveSurfaceToFileInMemory()?
It can be implemented by renaming D3DXSaveSurfaceToFileW() to D3DXSaveSurfaceToFileInMemory(), and making it to use IStream which uses the memory storage. Then, D3DXSaveSurfaceToFileW() will just call D3DXSaveSurfaceToFileInMemory() and write the returned buffer to a file. Do I have to implement D3DXSaveSurfaceToFileInMemory() first?
On 3 May 2012 15:48, Józef Kucia joseph.kucia@gmail.com wrote:
Thanks for the review.
On Thu, May 3, 2012 at 1:08 PM, Henri Verbeet hverbeet@gmail.com wrote:
- memcpy(&wic_pixel_format, pixel_format_guid, sizeof(GUID));
- hr = IWICBitmapFrameEncode_SetPixelFormat(frame, &wic_pixel_format);
- d3d_pixel_format = wic_guid_to_d3dformat(&wic_pixel_format);
What is all this for?
If a WIC bitmap encoder doesn't support a given pixel format, it returns the closest supported pixel format.
Right, make sense.
Also, how do you intend to implement D3DXSaveSurfaceToFileInMemory()?
It can be implemented by renaming D3DXSaveSurfaceToFileW() to D3DXSaveSurfaceToFileInMemory(), and making it to use IStream which uses the memory storage. Then, D3DXSaveSurfaceToFileW() will just call D3DXSaveSurfaceToFileInMemory() and write the returned buffer to a file. Do I have to implement D3DXSaveSurfaceToFileInMemory() first?
Not necessarily, but it's probably just as easy to start with that one.