Commit 1eefb46a authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Remove IWineD3DVolume::LoadTexture() from the public interface.

parent ce050c89
......@@ -93,6 +93,31 @@ void volume_set_container(IWineD3DVolumeImpl *volume, struct IWineD3DVolumeTextu
volume->container = container;
}
/* Context activation is done by the caller. */
void volume_load(IWineD3DVolumeImpl *volume, UINT level, BOOL srgb_mode)
{
const struct wined3d_gl_info *gl_info = &volume->resource.device->adapter->gl_info;
const struct wined3d_format *format = volume->resource.format;
TRACE("volume %p, level %u, srgb %#x, format %s (%#x).\n",
volume, level, srgb_mode, debug_d3dformat(format->id), format->id);
volume_bind_and_dirtify(volume);
ENTER_GL();
GL_EXTCALL(glTexImage3DEXT(GL_TEXTURE_3D, level, format->glInternal,
volume->currentDesc.Width, volume->currentDesc.Height, volume->currentDesc.Depth,
0, format->glFormat, format->glType, volume->resource.allocatedMemory));
checkGLcall("glTexImage3D");
LEAVE_GL();
/* When adding code releasing volume->resource.allocatedMemory to save
* data keep in mind that GL_UNPACK_CLIENT_STORAGE_APPLE is enabled by
* default if supported(GL_APPLE_client_storage). Thus do not release
* volume->resource.allocatedMemory if GL_APPLE_client_storage is
* supported. */
}
/* *******************************************
IWineD3DVolume IUnknown parts follow
******************************************* */
......@@ -277,39 +302,6 @@ static HRESULT WINAPI IWineD3DVolumeImpl_Unmap(IWineD3DVolume *iface)
return WINED3D_OK;
}
/* Internal use functions follow : */
/* Context activation is done by the caller. */
static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int gl_level, BOOL srgb_mode)
{
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
const struct wined3d_gl_info *gl_info = &This->resource.device->adapter->gl_info;
const struct wined3d_format *format = This->resource.format;
TRACE("iface %p, level %u, srgb %#x, format %s (%#x).\n",
iface, gl_level, srgb_mode, debug_d3dformat(format->id), format->id);
volume_bind_and_dirtify(This);
TRACE("Calling glTexImage3D %x level=%d, intfmt=%x, w=%d, h=%d,d=%d, 0=%d, glFmt=%x, glType=%x, Mem=%p\n",
GL_TEXTURE_3D, gl_level, format->glInternal, This->currentDesc.Width, This->currentDesc.Height,
This->currentDesc.Depth, 0, format->glFormat, format->glType, This->resource.allocatedMemory);
ENTER_GL();
GL_EXTCALL(glTexImage3DEXT(GL_TEXTURE_3D, gl_level, format->glInternal,
This->currentDesc.Width, This->currentDesc.Height, This->currentDesc.Depth,
0, format->glFormat, format->glType, This->resource.allocatedMemory));
checkGLcall("glTexImage3D");
LEAVE_GL();
/* When adding code releasing This->resource.allocatedMemory to save data keep in mind that
* GL_UNPACK_CLIENT_STORAGE_APPLE is enabled by default if supported(GL_APPLE_client_storage).
* Thus do not release This->resource.allocatedMemory if GL_APPLE_client_storage is supported.
*/
return WINED3D_OK;
}
static const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =
{
/* IUnknown */
......@@ -330,8 +322,6 @@ static const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =
IWineD3DVolumeImpl_GetDesc,
IWineD3DVolumeImpl_Map,
IWineD3DVolumeImpl_Unmap,
/* Internal interface */
IWineD3DVolumeImpl_LoadTexture,
};
HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT width,
......
......@@ -62,8 +62,7 @@ static void volumetexture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3D
{
for (i = 0; i < texture->baseTexture.level_count; ++i)
{
IWineD3DVolume *volume = (IWineD3DVolume *)texture->baseTexture.sub_resources[i];
IWineD3DVolume_LoadTexture(volume, i, srgb_mode);
volume_load((IWineD3DVolumeImpl *)texture->baseTexture.sub_resources[i], i, srgb_mode);
}
}
else if (srgb_was_toggled)
......@@ -72,7 +71,7 @@ static void volumetexture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3D
{
IWineD3DVolumeImpl *volume = (IWineD3DVolumeImpl *)texture->baseTexture.sub_resources[i];
volume_add_dirty_box(volume, NULL);
IWineD3DVolume_LoadTexture((IWineD3DVolume *)volume, i, srgb_mode);
volume_load(volume, i, srgb_mode);
}
}
else
......
......@@ -2005,6 +2005,7 @@ void volume_add_dirty_box(struct IWineD3DVolumeImpl *volume, const WINED3DBOX *d
HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT width,
UINT height, UINT depth, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
void volume_load(IWineD3DVolumeImpl *volume, UINT level, BOOL srgb_mode) DECLSPEC_HIDDEN;
void volume_set_container(IWineD3DVolumeImpl *volume, struct IWineD3DVolumeTextureImpl *container) DECLSPEC_HIDDEN;
/*****************************************************************************
......
......@@ -2490,10 +2490,6 @@ interface IWineD3DVolume : IWineD3DResource
);
HRESULT Unmap(
);
HRESULT LoadTexture(
[in] int gl_level,
[in] BOOL srgb_mode
);
}
[
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment