[PATCH 4/4] wined3d: Remove IWineD3DVolume::LoadTexture() from the public interface.
Henri Verbeet
hverbeet at codeweavers.com
Thu Jan 20 12:52:01 CST 2011
---
dlls/wined3d/volume.c | 60 ++++++++++++++++-----------------------
dlls/wined3d/volumetexture.c | 5 +--
dlls/wined3d/wined3d_private.h | 1 +
include/wine/wined3d.idl | 4 --
4 files changed, 28 insertions(+), 42 deletions(-)
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index a75ca78..060e361 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -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,
diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c
index 4a744eb..ac7674a 100644
--- a/dlls/wined3d/volumetexture.c
+++ b/dlls/wined3d/volumetexture.c
@@ -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
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 5cd4bb6..66532e6 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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;
/*****************************************************************************
diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl
index 2be655b..585932b 100644
--- a/include/wine/wined3d.idl
+++ b/include/wine/wined3d.idl
@@ -2490,10 +2490,6 @@ interface IWineD3DVolume : IWineD3DResource
);
HRESULT Unmap(
);
- HRESULT LoadTexture(
- [in] int gl_level,
- [in] BOOL srgb_mode
- );
}
[
--
1.7.3.4
More information about the wine-patches
mailing list