d3dx9: Avoid LPDIRECT3DBASETEXTURE9.

This commit is contained in:
Henri Verbeet 2012-10-25 21:21:37 +02:00 committed by Alexandre Julliard
parent a42d4c4b95
commit c4f7bcc653
6 changed files with 40 additions and 42 deletions

View File

@ -2646,7 +2646,8 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetString(ID3DXBaseEffect *iface, D3DX
return D3DERR_INVALIDCALL;
}
static HRESULT WINAPI ID3DXBaseEffectImpl_SetTexture(ID3DXBaseEffect *iface, D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture)
static HRESULT WINAPI ID3DXBaseEffectImpl_SetTexture(struct ID3DXBaseEffect *iface,
D3DXHANDLE parameter, struct IDirect3DBaseTexture9 *texture)
{
struct ID3DXBaseEffectImpl *This = impl_from_ID3DXBaseEffect(iface);
struct d3dx_parameter *param = get_valid_parameter(This, parameter);
@ -2658,12 +2659,12 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_SetTexture(ID3DXBaseEffect *iface, D3D
|| param->type == D3DXPT_TEXTURE2D || param->type == D3DXPT_TEXTURE3D
|| param->type == D3DXPT_TEXTURECUBE))
{
LPDIRECT3DBASETEXTURE9 oltexture = *(LPDIRECT3DBASETEXTURE9 *)param->data;
struct IDirect3DBaseTexture9 *oltexture = *(struct IDirect3DBaseTexture9 **)param->data;
if (texture) IDirect3DBaseTexture9_AddRef(texture);
if (oltexture) IDirect3DBaseTexture9_Release(oltexture);
*(LPDIRECT3DBASETEXTURE9 *)param->data = texture;
*(struct IDirect3DBaseTexture9 **)param->data = texture;
return D3D_OK;
}
@ -2673,7 +2674,8 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_SetTexture(ID3DXBaseEffect *iface, D3D
return D3DERR_INVALIDCALL;
}
static HRESULT WINAPI ID3DXBaseEffectImpl_GetTexture(ID3DXBaseEffect *iface, D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 *texture)
static HRESULT WINAPI ID3DXBaseEffectImpl_GetTexture(struct ID3DXBaseEffect *iface,
D3DXHANDLE parameter, struct IDirect3DBaseTexture9 **texture)
{
struct ID3DXBaseEffectImpl *This = impl_from_ID3DXBaseEffect(iface);
struct d3dx_parameter *param = get_valid_parameter(This, parameter);
@ -2685,7 +2687,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetTexture(ID3DXBaseEffect *iface, D3D
|| param->type == D3DXPT_TEXTURE2D || param->type == D3DXPT_TEXTURE3D
|| param->type == D3DXPT_TEXTURECUBE))
{
*texture = *(LPDIRECT3DBASETEXTURE9 *)param->data;
*texture = *(struct IDirect3DBaseTexture9 **)param->data;
if (*texture) IDirect3DBaseTexture9_AddRef(*texture);
TRACE("Returning %p\n", *texture);
return D3D_OK;
@ -3349,7 +3351,8 @@ static HRESULT WINAPI ID3DXEffectImpl_GetString(ID3DXEffect *iface, D3DXHANDLE p
return ID3DXBaseEffectImpl_GetString(base, parameter, string);
}
static HRESULT WINAPI ID3DXEffectImpl_SetTexture(ID3DXEffect *iface, D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture)
static HRESULT WINAPI ID3DXEffectImpl_SetTexture(struct ID3DXEffect *iface,
D3DXHANDLE parameter, struct IDirect3DBaseTexture9 *texture)
{
struct ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
ID3DXBaseEffect *base = This->base_effect;
@ -3359,7 +3362,8 @@ static HRESULT WINAPI ID3DXEffectImpl_SetTexture(ID3DXEffect *iface, D3DXHANDLE
return ID3DXBaseEffectImpl_SetTexture(base, parameter, texture);
}
static HRESULT WINAPI ID3DXEffectImpl_GetTexture(ID3DXEffect *iface, D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 *texture)
static HRESULT WINAPI ID3DXEffectImpl_GetTexture(struct ID3DXEffect *iface,
D3DXHANDLE parameter, struct IDirect3DBaseTexture9 **texture)
{
struct ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
ID3DXBaseEffect *base = This->base_effect;
@ -4316,7 +4320,8 @@ static HRESULT WINAPI ID3DXEffectCompilerImpl_GetString(ID3DXEffectCompiler *ifa
return ID3DXBaseEffectImpl_GetString(base, parameter, string);
}
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetTexture(ID3DXEffectCompiler *iface, D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture)
static HRESULT WINAPI ID3DXEffectCompilerImpl_SetTexture(struct ID3DXEffectCompiler *iface,
D3DXHANDLE parameter, struct IDirect3DBaseTexture9 *texture)
{
struct ID3DXEffectCompilerImpl *This = impl_from_ID3DXEffectCompiler(iface);
ID3DXBaseEffect *base = This->base_effect;
@ -4326,7 +4331,8 @@ static HRESULT WINAPI ID3DXEffectCompilerImpl_SetTexture(ID3DXEffectCompiler *if
return ID3DXBaseEffectImpl_SetTexture(base, parameter, texture);
}
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetTexture(ID3DXEffectCompiler *iface, D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 *texture)
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetTexture(struct ID3DXEffectCompiler *iface,
D3DXHANDLE parameter, struct IDirect3DBaseTexture9 **texture)
{
struct ID3DXEffectCompilerImpl *This = impl_from_ID3DXEffectCompiler(iface);
ID3DXBaseEffect *base = This->base_effect;

View File

@ -434,7 +434,7 @@ static HRESULT WINAPI ID3DXSpriteImpl_Flush(ID3DXSprite *iface)
i++;
}
IDirect3DDevice9_SetTexture(This->device, 0, (LPDIRECT3DBASETEXTURE9)(This->sprites[start].texture));
IDirect3DDevice9_SetTexture(This->device, 0, (struct IDirect3DBaseTexture9 *)This->sprites[start].texture);
IDirect3DDevice9_SetVertexDeclaration(This->device, This->vdecl);
IDirect3DDevice9_DrawPrimitiveUP(This->device, D3DPT_TRIANGLELIST, 2*count, vertices+6*start, sizeof(SPRITEVERTEX));

View File

@ -46,8 +46,8 @@ static UINT make_pow2(UINT num)
return result;
}
static HRESULT get_surface(D3DRESOURCETYPE type, LPDIRECT3DBASETEXTURE9 tex,
int face, UINT level, LPDIRECT3DSURFACE9 *surf)
static HRESULT get_surface(D3DRESOURCETYPE type, struct IDirect3DBaseTexture9 *tex,
int face, UINT level, struct IDirect3DSurface9 **surf)
{
switch (type)
{

View File

@ -148,8 +148,8 @@ DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown)
STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE;
STDMETHOD(SetString)(THIS_ D3DXHANDLE parameter, LPCSTR string) PURE;
STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, LPCSTR* string) PURE;
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture) PURE;
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9* texture) PURE;
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, struct IDirect3DBaseTexture9 *texture) PURE;
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, struct IDirect3DBaseTexture9 **texture) PURE;
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader) PURE;
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE parameter, struct IDirect3DVertexShader9 **shader) PURE;
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE parameter, UINT start, UINT end) PURE;
@ -174,7 +174,7 @@ DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown)
STDMETHOD(SetLight)(THIS_ DWORD index, CONST D3DLIGHT9* light) PURE;
STDMETHOD(LightEnable)(THIS_ DWORD index, BOOL enable) PURE;
STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE state, DWORD value) PURE;
STDMETHOD(SetTexture)(THIS_ DWORD stage, LPDIRECT3DBASETEXTURE9 texture) PURE;
STDMETHOD(SetTexture)(THIS_ DWORD stage, struct IDirect3DBaseTexture9 *texture) PURE;
STDMETHOD(SetTextureStageState)(THIS_ DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value) PURE;
STDMETHOD(SetSamplerState)(THIS_ DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value) PURE;
STDMETHOD(SetNPatchMode)(THIS_ FLOAT num_segments) PURE;
@ -252,8 +252,8 @@ DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect)
STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE;
STDMETHOD(SetString)(THIS_ D3DXHANDLE parameter, LPCSTR string) PURE;
STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, LPCSTR* string) PURE;
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture) PURE;
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9* texture) PURE;
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, struct IDirect3DBaseTexture9 *texture) PURE;
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, struct IDirect3DBaseTexture9 **texture) PURE;
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader) PURE;
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE parameter, struct IDirect3DVertexShader9 **shader) PURE;
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE parameter, UINT start, UINT end) PURE;
@ -345,8 +345,8 @@ DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect)
STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE;
STDMETHOD(SetString)(THIS_ D3DXHANDLE parameter, LPCSTR string) PURE;
STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, LPCSTR* string) PURE;
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture) PURE;
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9* texture) PURE;
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, struct IDirect3DBaseTexture9 *texture) PURE;
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, struct IDirect3DBaseTexture9 **texture) PURE;
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader) PURE;
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE parameter, struct IDirect3DVertexShader9 **shader) PURE;
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE parameter, UINT start, UINT end) PURE;

View File

@ -486,10 +486,12 @@ DECLARE_INTERFACE_(ID3DXPatchMesh, IUnknown)
STDMETHOD(GenerateAdjacency)(THIS_ FLOAT tolerance) PURE;
STDMETHOD(CloneMesh)(THIS_ DWORD options, CONST D3DVERTEXELEMENT9* declaration, LPD3DXPATCHMESH *clone_mesh) PURE;
STDMETHOD(Optimize)(THIS_ DWORD flags) PURE;
STDMETHOD(SetDisplaceParam)(THIS_ LPDIRECT3DBASETEXTURE9 texture, D3DTEXTUREFILTERTYPE min_filter,
D3DTEXTUREFILTERTYPE mag_filter, D3DTEXTUREFILTERTYPE mip_filter, D3DTEXTUREADDRESS wrap, DWORD lod_bias) PURE;
STDMETHOD(GetDisplaceParam)(THIS_ LPDIRECT3DBASETEXTURE9* texture, D3DTEXTUREFILTERTYPE* min_filter,
D3DTEXTUREFILTERTYPE* mag_filter, D3DTEXTUREFILTERTYPE* mip_filter, D3DTEXTUREADDRESS* wrap, DWORD* lod_bias) PURE;
STDMETHOD(SetDisplaceParam)(THIS_ struct IDirect3DBaseTexture9 *texture, D3DTEXTUREFILTERTYPE min_filter,
D3DTEXTUREFILTERTYPE mag_filter, D3DTEXTUREFILTERTYPE mip_filter, D3DTEXTUREADDRESS wrap,
DWORD lod_bias) PURE;
STDMETHOD(GetDisplaceParam)(THIS_ struct IDirect3DBaseTexture9 **texture, D3DTEXTUREFILTERTYPE *min_filter,
D3DTEXTUREFILTERTYPE *mag_filter, D3DTEXTUREFILTERTYPE *mip_filter, D3DTEXTUREADDRESS *wrap,
DWORD *lod_bias) PURE;
STDMETHOD(Tessellate)(THIS_ FLOAT tess_level, LPD3DXMESH mesh) PURE;
STDMETHOD(TessellateAdaptive)(THIS_ CONST D3DXVECTOR4* trans, DWORD max_tess_level, DWORD min_tess_level, LPD3DXMESH mesh) PURE;
};

View File

@ -421,27 +421,17 @@ HRESULT WINAPI D3DXCreateVolumeTextureFromFileInMemoryEx(struct IDirect3DDevice9
D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo,
PALETTEENTRY *palette, struct IDirect3DVolumeTexture9 **volume);
HRESULT WINAPI D3DXSaveTextureToFileInMemory(LPD3DXBUFFER *destbuffer,
D3DXIMAGE_FILEFORMAT destformat,
LPDIRECT3DBASETEXTURE9 srctexture,
CONST PALETTEENTRY *srcpalette);
HRESULT WINAPI D3DXSaveTextureToFileA(LPCSTR destfile,
D3DXIMAGE_FILEFORMAT destformat,
LPDIRECT3DBASETEXTURE9 srctexture,
CONST PALETTEENTRY *srcpalette);
HRESULT WINAPI D3DXSaveTextureToFileW(LPCWSTR destfile,
D3DXIMAGE_FILEFORMAT destformat,
LPDIRECT3DBASETEXTURE9 srctexture,
CONST PALETTEENTRY *srcpalette);
#define D3DXSaveTextureToFile WINELIB_NAME_AW(D3DXSaveTextureToFile)
HRESULT WINAPI D3DXSaveTextureToFileInMemory(struct ID3DXBuffer **destbuffer, D3DXIMAGE_FILEFORMAT destformat,
struct IDirect3DBaseTexture9 *srctexture, const PALETTEENTRY *srcpalette);
HRESULT WINAPI D3DXSaveTextureToFileA(const char *destfile, D3DXIMAGE_FILEFORMAT destformat,
struct IDirect3DBaseTexture9 *srctexture, const PALETTEENTRY *srcpalette);
HRESULT WINAPI D3DXSaveTextureToFileW(const WCHAR *destfile, D3DXIMAGE_FILEFORMAT destformat,
struct IDirect3DBaseTexture9 *srctexture, const PALETTEENTRY *srcpalette);
#define D3DXSaveTextureToFile WINELIB_NAME_AW(D3DXSaveTextureToFile)
/* Other functions */
HRESULT WINAPI D3DXFilterTexture( LPDIRECT3DBASETEXTURE9 texture,
CONST PALETTEENTRY *palette,
UINT srclevel,
DWORD filter);
HRESULT WINAPI D3DXFilterTexture(struct IDirect3DBaseTexture9 *texture,
const PALETTEENTRY *palette, UINT srclevel, DWORD filter);
#define D3DXFilterCubeTexture D3DXFilterTexture
#define D3DXFilterVolumeTexture D3DXFilterTexture