On 28 March 2016 at 20:02, Aaryaman Vasishta <jem456.vasishta@gmail.com> wrote:
> v3: Add bitmap verification, use InitFromFile and other minor improvements.
>
Implementing InitFromFile() should be a separate patch from
implementing LoadTexture().
>�� �� �� if (FAILED(hr = d3drm_texture_create(&object)))
>�� �� �� �� �� return hr;
>
> +�� �� if (FAILED(hr = IDirect3DRMTexture_InitFromFile(&object->IDirect3DRMTexture_iface, filename)))
> +�� �� {
> +�� �� �� �� d3drm_texture_destroy(object);
> +�� �� �� �� return hr;
> +�� �� }
> +
> +�� �� object->d3drm = iface;
> +�� �� IDirect3DRM_AddRef(iface);
It would be good to back this up with tests. It would seem more
natural to pass the IDirect3DRM interface to d3drm_texture_create().
If that's how it's supposed to work, you can make that change in a
separate patch.
> @@ -39,6 +40,9 @@ struct d3drm_texture
>�� �� �� IDirect3DRMTexture IDirect3DRMTexture_iface;
>�� �� �� IDirect3DRMTexture2 IDirect3DRMTexture2_iface;
>�� �� �� IDirect3DRMTexture3 IDirect3DRMTexture3_iface;
> +�� �� IDirect3DRM *d3drm;
> +�� �� D3DRMIMAGE *image;
> +�� �� BOOL internal_image_created;
You don't really need internal_image_created, you can probably just
add a destroy callback.
This is very suspicious, since you always assign "object->d3drm" after
calling InitFromFile(). It's not backed up by tests either.