Am 28.04.2016 um 20:17 schrieb Aaryaman Vasishta jem456.vasishta@gmail.com:
- if (texture->d3drm && texture->initialized)
IDirect3DRM_Release(texture->d3drm);
I thought the idea was to use AddDestroyCallback instead of a flag to control the Release call. Do I remember this incorrectly, or what's the reason for going back to a flag?
Also, what's the difference between image != NULL and initialized? Or, in a later stage when you have initFromTexture or what it is called, image != NULL || ddraw_texture != NULL?
IDirect3DRM_AddRef(texture->d3drm);
- if (texture->image)
return D3DRMERR_BADOBJECT;
Afair the ref leak here is intentional. If it is, I think it's worth adding a comment.