texture.c revision 4237d5a79f48789aacc67dc43378d2d7813a39f4
/*
* Copyright 2005 Oliver Stieber
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#include "config.h"
#include "d3d8_private.h"
{
}
{
}
static inline struct d3d8_texture *impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
{
}
static HRESULT WINAPI d3d8_texture_2d_QueryInterface(IDirect3DTexture8 *iface, REFIID riid, void **out)
{
{
return S_OK;
}
return E_NOINTERFACE;
}
{
if (ref == 1)
{
}
return ref;
}
{
if (!ref)
{
/* Release the device last, as it may cause the device to be destroyed. */
}
return ref;
}
static HRESULT WINAPI d3d8_texture_2d_GetDevice(IDirect3DTexture8 *iface, IDirect3DDevice8 **device)
{
return D3D_OK;
}
{
struct wined3d_resource *resource;
TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
return hr;
}
{
struct wined3d_resource *resource;
TRACE("iface %p, guid %s, data %p, data_size %p.\n",
return hr;
}
{
struct wined3d_resource *resource;
return hr;
}
{
return ret;
}
{
return ret;
}
{
}
{
return D3DRTYPE_TEXTURE;
}
{
return ret;
}
{
return ret;
}
{
return ret;
}
static HRESULT WINAPI d3d8_texture_2d_GetLevelDesc(IDirect3DTexture8 *iface, UINT level, D3DSURFACE_DESC *desc)
{
struct wined3d_resource *sub_resource;
else
{
struct wined3d_resource_desc wined3d_desc;
}
return hr;
}
{
struct wined3d_resource *sub_resource;
struct d3d8_surface *surface_impl;
{
return D3DERR_INVALIDCALL;
}
return D3D_OK;
}
{
struct wined3d_resource *sub_resource;
struct d3d8_surface *surface_impl;
TRACE("iface %p, level %u, locked_rect %p, rect %p, flags %#x.\n",
else
{
}
return hr;
}
{
struct wined3d_resource *sub_resource;
struct d3d8_surface *surface_impl;
else
{
}
return hr;
}
static HRESULT WINAPI d3d8_texture_2d_AddDirtyRect(IDirect3DTexture8 *iface, const RECT *dirty_rect)
{
TRACE("iface %p, dirty_rect %s.\n",
if (!dirty_rect)
else
{
struct wined3d_box dirty_region;
dirty_region.front = 0;
}
return hr;
}
static const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl =
{
/* IUnknown */
/* IDirect3DResource8 */
/* IDirect3dBaseTexture8 */
/* IDirect3DTexture8 */
};
static HRESULT WINAPI d3d8_texture_cube_QueryInterface(IDirect3DCubeTexture8 *iface, REFIID riid, void **out)
{
{
return S_OK;
}
return E_NOINTERFACE;
}
{
if (ref == 1)
{
}
return ref;
}
{
if (!ref)
{
/* Release the device last, as it may cause the device to be destroyed. */
}
return ref;
}
static HRESULT WINAPI d3d8_texture_cube_GetDevice(IDirect3DCubeTexture8 *iface, IDirect3DDevice8 **device)
{
return D3D_OK;
}
{
struct wined3d_resource *resource;
TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
return hr;
}
{
struct wined3d_resource *resource;
TRACE("iface %p, guid %s, data %p, data_size %p.\n",
return hr;
}
{
struct wined3d_resource *resource;
return hr;
}
{
return ret;
}
{
return ret;
}
{
}
{
return D3DRTYPE_CUBETEXTURE;
}
{
return ret;
}
{
return ret;
}
{
return ret;
}
static HRESULT WINAPI d3d8_texture_cube_GetLevelDesc(IDirect3DCubeTexture8 *iface, UINT level, D3DSURFACE_DESC *desc)
{
struct wined3d_resource *sub_resource;
{
return D3DERR_INVALIDCALL;
}
else
{
struct wined3d_resource_desc wined3d_desc;
}
return hr;
}
{
struct wined3d_resource *sub_resource;
struct d3d8_surface *surface_impl;
if (level >= level_count)
{
return D3DERR_INVALIDCALL;
}
{
return D3DERR_INVALIDCALL;
}
return D3D_OK;
}
{
struct wined3d_resource *sub_resource;
struct d3d8_surface *surface_impl;
TRACE("iface %p, face %#x, level %u, locked_rect %p, rect %p, flags %#x.\n",
else
{
}
return hr;
}
{
struct wined3d_resource *sub_resource;
struct d3d8_surface *surface_impl;
else
{
}
return hr;
}
{
TRACE("iface %p, face %#x, dirty_rect %s.\n",
if (!dirty_rect)
else
{
struct wined3d_box dirty_region;
dirty_region.front = 0;
}
return hr;
}
static const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl =
{
/* IUnknown */
/* IDirect3DResource8 */
/* IDirect3DBaseTexture8 */
/* IDirect3DCubeTexture8 */
};
static HRESULT WINAPI d3d8_texture_3d_QueryInterface(IDirect3DVolumeTexture8 *iface, REFIID riid, void **out)
{
{
return S_OK;
}
return E_NOINTERFACE;
}
{
if (ref == 1)
{
}
return ref;
}
{
if (!ref)
{
/* Release the device last, as it may cause the device to be destroyed. */
}
return ref;
}
static HRESULT WINAPI d3d8_texture_3d_GetDevice(IDirect3DVolumeTexture8 *iface, IDirect3DDevice8 **device)
{
return D3D_OK;
}
{
struct wined3d_resource *resource;
TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
return hr;
}
{
struct wined3d_resource *resource;
TRACE("iface %p, guid %s, data %p, data_size %p.\n",
return hr;
}
{
struct wined3d_resource *resource;
return hr;
}
{
return ret;
}
{
return ret;
}
{
}
{
return D3DRTYPE_VOLUMETEXTURE;
}
{
return ret;
}
{
return ret;
}
{
return ret;
}
static HRESULT WINAPI d3d8_texture_3d_GetLevelDesc(IDirect3DVolumeTexture8 *iface, UINT level, D3DVOLUME_DESC *desc)
{
struct wined3d_resource *sub_resource;
else
{
struct wined3d_resource_desc wined3d_desc;
}
return hr;
}
{
struct wined3d_resource *sub_resource;
struct d3d8_volume *volume_impl;
{
return D3DERR_INVALIDCALL;
}
return D3D_OK;
}
{
struct wined3d_resource *sub_resource;
struct d3d8_volume *volume_impl;
TRACE("iface %p, level %u, locked_box %p, box %p, flags %#x.\n",
else
{
}
return hr;
}
{
struct wined3d_resource *sub_resource;
struct d3d8_volume *volume_impl;
else
{
}
return hr;
}
static HRESULT WINAPI d3d8_texture_3d_AddDirtyBox(IDirect3DVolumeTexture8 *iface, const D3DBOX *dirty_box)
{
hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, (const struct wined3d_box *)dirty_box);
return hr;
}
static const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl =
{
/* IUnknown */
/* IDirect3DResource8 */
/* IDirect3DBaseTexture8 */
/* IDirect3DVolumeTexture8 */
};
{
if (!iface)
return NULL;
/* SetTexture() in particular doesn't do a lot of validation on the pointer
* that gets passed in, and passing an invalid pointer works as long as the
* application doesn't try to actually render anything with it, so we print
* a WARN and return NULL instead of having the usual assert() here.
* One application affected by this is Fishdom 2. */
{
return NULL;
}
}
{
}
static const struct wined3d_parent_ops d3d8_texture_wined3d_parent_ops =
{
};
{
struct wined3d_resource_desc desc;
DWORD surface_flags = 0;
texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DTexture8_Vtbl;
desc.multisample_quality = 0;
{
return hr;
}
return D3D_OK;
}
{
struct wined3d_resource_desc desc;
DWORD surface_flags = 0;
texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DCubeTexture8_Vtbl;
desc.multisample_quality = 0;
{
return hr;
}
return D3D_OK;
}
{
struct wined3d_resource_desc desc;
texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DVolumeTexture8_Vtbl;
desc.multisample_quality = 0;
{
return hr;
}
return D3D_OK;
}