[PATCH 4/4] wined3d: Get rid of the IWineD3DBaseTexture typedefs.

Henri Verbeet hverbeet at codeweavers.com
Fri Mar 18 13:11:00 CDT 2011


---
 dlls/wined3d/arb_program_shader.c |    4 +-
 dlls/wined3d/context.c            |    2 +-
 dlls/wined3d/device.c             |   92 ++++++++++++++++++-------------------
 dlls/wined3d/glsl_shader.c        |   10 ++--
 dlls/wined3d/shader.c             |    4 +-
 dlls/wined3d/state.c              |    8 ++--
 dlls/wined3d/stateblock.c         |    2 +-
 dlls/wined3d/surface.c            |    8 ++--
 dlls/wined3d/utils.c              |   11 +++--
 dlls/wined3d/volume.c             |    2 +-
 dlls/wined3d/wined3d_private.h    |   24 ++++------
 11 files changed, 80 insertions(+), 87 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 2f3cefb..161e9ae 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -492,7 +492,7 @@ static void shader_arb_load_np2fixup_constants(void *shader_priv,
 
         for (i = 0; active; active >>= 1, ++i)
         {
-            const IWineD3DBaseTextureImpl *tex = state->textures[i];
+            const struct wined3d_texture *tex = state->textures[i];
             const unsigned char idx = fixup->super.idx[i];
             GLfloat *tex_dim = &np2fixup_constants[(idx >> 1) * 4];
 
@@ -1325,7 +1325,7 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
 {
     struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
     DWORD sampler_type = ins->ctx->reg_maps->sampler_type[sampler_idx];
-    IWineD3DBaseTextureImpl *texture;
+    const struct wined3d_texture *texture;
     const char *tex_type;
     BOOL np2_fixup = FALSE;
     struct IWineD3DBaseShaderImpl *shader = ins->ctx->shader;
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 8f03b2f..5bea141 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -118,7 +118,7 @@ static void context_apply_attachment_filter_states(const struct wined3d_context
     /* Update base texture states array */
     if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
     {
-        IWineD3DBaseTextureImpl *texture = surface->container.u.texture;
+        struct wined3d_texture *texture = surface->container.u.texture;
         IWineD3DDeviceImpl *device = surface->resource.device;
         BOOL update_minfilter = FALSE;
         BOOL update_magfilter = FALSE;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index e16c22a..17b957b 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -455,7 +455,7 @@ void device_update_stream_info(IWineD3DDeviceImpl *device, const struct wined3d_
 
 static void device_preload_texture(const struct wined3d_state *state, unsigned int idx)
 {
-    IWineD3DBaseTextureImpl *texture;
+    struct wined3d_texture *texture;
     enum WINED3DSRGB srgb;
 
     if (!(texture = state->textures[idx])) return;
@@ -1101,10 +1101,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateRendertargetView(IWineD3DDevice *
 
 static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
         UINT Width, UINT Height, UINT Levels, DWORD Usage, enum wined3d_format_id Format, WINED3DPOOL Pool,
-        void *parent, const struct wined3d_parent_ops *parent_ops, IWineD3DBaseTexture **texture)
+        void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
 {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
-    IWineD3DBaseTextureImpl *object;
+    struct wined3d_texture *object;
     HRESULT hr;
 
     TRACE("(%p) : Width %d, Height %d, Levels %d, Usage %#x\n", This, Width, Height, Levels, Usage);
@@ -1128,7 +1128,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
         return hr;
     }
 
-    *texture = (IWineD3DBaseTexture *)object;
+    *texture = object;
 
     TRACE("(%p) : Created texture %p\n", This, object);
 
@@ -1137,10 +1137,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
 
 static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *iface,
         UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, enum wined3d_format_id Format, WINED3DPOOL Pool,
-        void *parent, const struct wined3d_parent_ops *parent_ops, IWineD3DBaseTexture **ppVolumeTexture)
+        void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
 {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
-    IWineD3DBaseTextureImpl *object;
+    struct wined3d_texture *object;
     HRESULT hr;
 
     TRACE("(%p) : W(%u) H(%u) D(%u), Lvl(%u) Usage(%#x), Fmt(%u,%s), Pool(%s)\n", This, Width, Height,
@@ -1150,7 +1150,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
     if (!object)
     {
         ERR("Out of memory\n");
-        *ppVolumeTexture = NULL;
+        *texture = NULL;
         return WINED3DERR_OUTOFVIDEOMEMORY;
     }
 
@@ -1159,12 +1159,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
     {
         WARN("Failed to initialize volumetexture, returning %#x\n", hr);
         HeapFree(GetProcessHeap(), 0, object);
-        *ppVolumeTexture = NULL;
+        *texture = NULL;
         return hr;
     }
 
     TRACE("(%p) : Created volume texture %p.\n", This, object);
-    *ppVolumeTexture = (IWineD3DBaseTexture *)object;
+    *texture = object;
 
     return WINED3D_OK;
 }
@@ -1204,10 +1204,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface, UIN
 
 static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface, UINT EdgeLength, UINT Levels,
         DWORD Usage, enum wined3d_format_id Format, WINED3DPOOL Pool, void *parent,
-        const struct wined3d_parent_ops *parent_ops, IWineD3DBaseTexture **texture)
+        const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
 {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
-    IWineD3DBaseTextureImpl *object;
+    struct wined3d_texture *object;
     HRESULT hr;
 
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
@@ -1228,7 +1228,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
     }
 
     TRACE("(%p) : Created Cube Texture %p\n", This, object);
-    *texture = (IWineD3DBaseTexture *)object;
+    *texture = object;
 
     return WINED3D_OK;
 }
@@ -4449,15 +4449,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetTextureStageState(IWineD3DDevice *if
     return WINED3D_OK;
 }
 
-/*****
- * Get / Set Texture
- *****/
 static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
-        DWORD stage, IWineD3DBaseTexture *texture)
+        DWORD stage, struct wined3d_texture *texture)
 {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
     const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
-    IWineD3DBaseTexture *prev;
+    struct wined3d_texture *prev;
 
     TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
 
@@ -4472,7 +4469,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
     }
 
     /* SetTexture isn't allowed on textures in WINED3DPOOL_SCRATCH */
-    if (texture && ((IWineD3DBaseTextureImpl *)texture)->resource.pool == WINED3DPOOL_SCRATCH)
+    if (texture && texture->resource.pool == WINED3DPOOL_SCRATCH)
     {
         WARN("Rejecting attempt to set scratch texture.\n");
         return WINED3DERR_INVALIDCALL;
@@ -4480,7 +4477,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
 
     This->updateStateBlock->changed.textures |= 1 << stage;
 
-    prev = (IWineD3DBaseTexture *)This->updateStateBlock->state.textures[stage];
+    prev = This->updateStateBlock->state.textures[stage];
     TRACE("Previous texture %p.\n", prev);
 
     if (texture == prev)
@@ -4490,7 +4487,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
     }
 
     TRACE("Setting new texture to %p.\n", texture);
-    This->updateStateBlock->state.textures[stage] = (IWineD3DBaseTextureImpl *)texture;
+    This->updateStateBlock->state.textures[stage] = texture;
 
     if (This->isRecordingState)
     {
@@ -4504,13 +4501,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
 
     if (texture)
     {
-        IWineD3DBaseTextureImpl *t = (IWineD3DBaseTextureImpl *)texture;
-        LONG bind_count = InterlockedIncrement(&t->baseTexture.bindCount);
-        GLenum dimensions = t->baseTexture.target;
+        LONG bind_count = InterlockedIncrement(&texture->baseTexture.bindCount);
 
         wined3d_texture_incref(texture);
 
-        if (!prev || dimensions != ((IWineD3DBaseTextureImpl *)prev)->baseTexture.target)
+        if (!prev || texture->baseTexture.target != prev->baseTexture.target)
             IWineD3DDeviceImpl_MarkStateDirty(This, STATE_PIXELSHADER);
 
         if (!prev && stage < gl_info->limits.texture_stages)
@@ -4522,13 +4517,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
             IWineD3DDeviceImpl_MarkStateDirty(This, STATE_TEXTURESTAGE(stage, WINED3DTSS_ALPHAOP));
         }
 
-        if (bind_count == 1) t->baseTexture.sampler = stage;
+        if (bind_count == 1)
+            texture->baseTexture.sampler = stage;
     }
 
     if (prev)
     {
-        IWineD3DBaseTextureImpl *t = (IWineD3DBaseTextureImpl *)prev;
-        LONG bind_count = InterlockedDecrement(&t->baseTexture.bindCount);
+        LONG bind_count = InterlockedDecrement(&prev->baseTexture.bindCount);
 
         wined3d_texture_decref(prev);
 
@@ -4538,7 +4533,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
             IWineD3DDeviceImpl_MarkStateDirty(This, STATE_TEXTURESTAGE(stage, WINED3DTSS_ALPHAOP));
         }
 
-        if (bind_count && t->baseTexture.sampler == stage)
+        if (bind_count && prev->baseTexture.sampler == stage)
         {
             unsigned int i;
 
@@ -4547,10 +4542,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
             TRACE("Searching for other stages the texture is bound to.\n");
             for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
             {
-                if (This->updateStateBlock->state.textures[i] == t)
+                if (This->updateStateBlock->state.textures[i] == prev)
                 {
                     TRACE("Texture is also bound to stage %u.\n", i);
-                    t->baseTexture.sampler = i;
+                    prev->baseTexture.sampler = i;
                     break;
                 }
             }
@@ -4562,26 +4557,27 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
     return WINED3D_OK;
 }
 
-static HRESULT WINAPI IWineD3DDeviceImpl_GetTexture(IWineD3DDevice *iface, DWORD Stage, IWineD3DBaseTexture** ppTexture) {
+static HRESULT WINAPI IWineD3DDeviceImpl_GetTexture(IWineD3DDevice *iface,
+        DWORD stage, struct wined3d_texture **texture)
+{
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
 
-    TRACE("(%p) : Stage %#x, ppTexture %p\n", This, Stage, ppTexture);
+    TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
 
-    if (Stage >= WINED3DVERTEXTEXTURESAMPLER0 && Stage <= WINED3DVERTEXTEXTURESAMPLER3) {
-        Stage -= (WINED3DVERTEXTEXTURESAMPLER0 - MAX_FRAGMENT_SAMPLERS);
-    }
+    if (stage >= WINED3DVERTEXTEXTURESAMPLER0 && stage <= WINED3DVERTEXTEXTURESAMPLER3)
+        stage -= (WINED3DVERTEXTEXTURESAMPLER0 - MAX_FRAGMENT_SAMPLERS);
 
-    if (Stage >= sizeof(This->stateBlock->state.textures) / sizeof(*This->stateBlock->state.textures))
+    if (stage >= sizeof(This->stateBlock->state.textures) / sizeof(*This->stateBlock->state.textures))
     {
-        ERR("Current stage overflows textures array (stage %d)\n", Stage);
+        WARN("Current stage overflows textures array (stage %u).\n", stage);
         return WINED3D_OK; /* Windows accepts overflowing this array ... we do not. */
     }
 
-    *ppTexture = (IWineD3DBaseTexture *)This->stateBlock->state.textures[Stage];
-    if (*ppTexture)
-        wined3d_texture_incref(*ppTexture);
+    *texture = This->stateBlock->state.textures[stage];
+    if (*texture)
+        wined3d_texture_incref(*texture);
 
-    TRACE("(%p) : Returning %p\n", This, *ppTexture);
+    TRACE("Returning %p.\n", *texture);
 
     return WINED3D_OK;
 }
@@ -5086,7 +5082,7 @@ static HRESULT IWineD3DDeviceImpl_UpdateVolume(IWineD3DDevice *iface,
 }
 
 static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface,
-        IWineD3DBaseTexture *src_texture, IWineD3DBaseTexture *dst_texture)
+        struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture)
 {
     unsigned int level_count, i;
     WINED3DRESOURCETYPE type;
@@ -5124,8 +5120,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface,
     }
 
     /* Make sure that the destination texture is loaded. */
-    ((IWineD3DBaseTextureImpl *)dst_texture)->baseTexture.texture_ops->texture_preload(
-            (IWineD3DBaseTextureImpl *)dst_texture, SRGB_RGB);
+    dst_texture->baseTexture.texture_ops->texture_preload(dst_texture, SRGB_RGB);
 
     /* Update every surface level of the texture. */
     switch (type)
@@ -5216,11 +5211,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetFrontBufferData(IWineD3DDevice *ifac
     return hr;
 }
 
-static HRESULT  WINAPI  IWineD3DDeviceImpl_ValidateDevice(IWineD3DDevice *iface, DWORD* pNumPasses) {
+static HRESULT WINAPI IWineD3DDeviceImpl_ValidateDevice(IWineD3DDevice *iface, DWORD *pNumPasses)
+{
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
-    IWineD3DBaseTextureImpl *texture;
-    DWORD i;
     const struct wined3d_state *state = &This->stateBlock->state;
+    struct wined3d_texture *texture;
+    DWORD i;
 
     TRACE("(%p) : %p\n", This, pNumPasses);
 
@@ -5285,7 +5281,7 @@ static void dirtify_p8_texture_samplers(IWineD3DDeviceImpl *device)
 
     for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
     {
-        IWineD3DBaseTextureImpl *texture = device->stateBlock->state.textures[i];
+        struct wined3d_texture *texture = device->stateBlock->state.textures[i];
         if (texture && (texture->resource.format->id == WINED3DFMT_P8_UINT
                 || texture->resource.format->id == WINED3DFMT_P8_UINT_A8_UNORM))
         {
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 9e4fa2a..d6c266e 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -701,7 +701,7 @@ static void shader_glsl_load_np2fixup_constants(void *shader_priv,
 
         for (i = 0; fixup; fixup >>= 1, ++i)
         {
-            const IWineD3DBaseTextureImpl *tex = state->textures[i];
+            const struct wined3d_texture *tex = state->textures[i];
             const unsigned char idx = prog->np2Fixup_info->idx[i];
             GLfloat *tex_dim = &np2fixup_constants[(idx >> 1) * 4];
 
@@ -1051,7 +1051,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
     {
         if (reg_maps->sampler_type[i])
         {
-            IWineD3DBaseTextureImpl *texture;
+            const struct wined3d_texture *texture;
 
             switch (reg_maps->sampler_type[i])
             {
@@ -3029,7 +3029,7 @@ static void shader_glsl_tex(const struct wined3d_shader_instruction *ins)
     DWORD shader_version = WINED3D_SHADER_VERSION(ins->ctx->reg_maps->shader_version.major,
             ins->ctx->reg_maps->shader_version.minor);
     glsl_sample_function_t sample_function;
-    IWineD3DBaseTextureImpl *texture;
+    const struct wined3d_texture *texture;
     DWORD sample_flags = 0;
     DWORD sampler_idx;
     DWORD mask = 0, swizzle;
@@ -3122,7 +3122,7 @@ static void shader_glsl_texldd(const struct wined3d_shader_instruction *ins)
     DWORD sample_flags = WINED3D_GLSL_SAMPLE_GRAD;
     DWORD sampler_idx;
     DWORD swizzle = ins->src[1].swizzle;
-    IWineD3DBaseTextureImpl *texture;
+    const struct wined3d_texture *texture;
 
     if (!gl_info->supported[ARB_SHADER_TEXTURE_LOD] && !gl_info->supported[EXT_GPU_SHADER4])
     {
@@ -3155,7 +3155,7 @@ static void shader_glsl_texldl(const struct wined3d_shader_instruction *ins)
     DWORD sample_flags = WINED3D_GLSL_SAMPLE_LOD;
     DWORD sampler_idx;
     DWORD swizzle = ins->src[1].swizzle;
-    IWineD3DBaseTextureImpl *texture;
+    const struct wined3d_texture *texture;
 
     sampler_idx = ins->src[1].reg.idx;
     texture = device->stateBlock->state.textures[sampler_idx];
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 086936c..ac707d9 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -2063,7 +2063,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
         IWineD3DPixelShaderImpl *shader, struct ps_compile_args *args)
 {
     IWineD3DDeviceImpl *device = shader->baseShader.device;
-    IWineD3DBaseTextureImpl *texture;
+    const struct wined3d_texture *texture;
     UINT i;
 
     memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */
@@ -2313,7 +2313,7 @@ HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *de
     return WINED3D_OK;
 }
 
-void pixelshader_update_samplers(struct wined3d_shader_reg_maps *reg_maps, IWineD3DBaseTextureImpl * const *textures)
+void pixelshader_update_samplers(struct wined3d_shader_reg_maps *reg_maps, struct wined3d_texture * const *textures)
 {
     WINED3DSAMPLER_TEXTURE_TYPE *sampler_type = reg_maps->sampler_type;
     unsigned int i;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 8885ba6..0d9b1b6 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -498,7 +498,7 @@ static void state_alpha(DWORD state, struct wined3d_stateblock *stateblock, stru
      */
     if (stateblock->state.textures[0])
     {
-        IWineD3DBaseTextureImpl *texture = stateblock->state.textures[0];
+        struct wined3d_texture *texture = stateblock->state.textures[0];
         GLenum texture_dimensions = texture->baseTexture.target;
 
         if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
@@ -3191,7 +3191,7 @@ void tex_alphaop(DWORD state, struct wined3d_stateblock *stateblock, struct wine
 
     if (stateblock->state.render_states[WINED3DRS_COLORKEYENABLE] && !stage && stateblock->state.textures[0])
     {
-        IWineD3DBaseTextureImpl *texture = stateblock->state.textures[0];
+        struct wined3d_texture *texture = stateblock->state.textures[0];
         GLenum texture_dimensions = texture->baseTexture.target;
 
         if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
@@ -3586,7 +3586,7 @@ static void tex_bumpenvlscale(DWORD state, struct wined3d_stateblock *stateblock
 static void sampler_texmatrix(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context)
 {
     const DWORD sampler = state - STATE_SAMPLER(0);
-    IWineD3DBaseTextureImpl *texture = stateblock->state.textures[sampler];
+    struct wined3d_texture *texture = stateblock->state.textures[sampler];
 
     TRACE("state %#x, stateblock %p, context %p\n", state, stateblock, context);
 
@@ -3643,7 +3643,7 @@ static void sampler(DWORD state_id, struct wined3d_stateblock *stateblock, struc
 
     if (state->textures[sampler])
     {
-        IWineD3DBaseTextureImpl *texture = state->textures[sampler];
+        struct wined3d_texture *texture = state->textures[sampler];
         BOOL srgb = state->sampler_states[sampler][WINED3DSAMP_SRGBTEXTURE];
 
         texture->baseTexture.texture_ops->texture_bind(texture, gl_info, srgb);
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 44f30a1..e47891b 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1033,7 +1033,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
         if (!(map & 1)) continue;
 
         stage = i < MAX_FRAGMENT_SAMPLERS ? i : WINED3DVERTEXTEXTURESAMPLER0 + i - MAX_FRAGMENT_SAMPLERS;
-        IWineD3DDevice_SetTexture(device, stage, (IWineD3DBaseTexture *)stateblock->state.textures[i]);
+        IWineD3DDevice_SetTexture(device, stage, stateblock->state.textures[i]);
     }
 
     map = stateblock->changed.clipplane;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index bdb0e48..104b445 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -326,7 +326,7 @@ void draw_textured_quad(IWineD3DSurfaceImpl *src_surface, const RECT *src_rect,
      * container about this to get the filters reset properly next draw. */
     if (src_surface->container.type == WINED3D_CONTAINER_TEXTURE)
     {
-        IWineD3DBaseTextureImpl *texture = src_surface->container.u.texture;
+        struct wined3d_texture *texture = src_surface->container.u.texture;
         texture->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT;
         texture->baseTexture.texture_rgb.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT;
         texture->baseTexture.texture_rgb.states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE;
@@ -697,7 +697,7 @@ void surface_bind(IWineD3DSurfaceImpl *surface, const struct wined3d_gl_info *gl
 
     if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
     {
-        IWineD3DBaseTextureImpl *texture = surface->container.u.texture;
+        struct wined3d_texture *texture = surface->container.u.texture;
 
         TRACE("Passing to container (%p).\n", texture);
         texture->baseTexture.texture_ops->texture_bind(texture, gl_info, srgb);
@@ -1362,7 +1362,7 @@ void surface_internal_preload(IWineD3DSurfaceImpl *surface, enum WINED3DSRGB srg
 
     if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
     {
-        IWineD3DBaseTextureImpl *texture = surface->container.u.texture;
+        struct wined3d_texture *texture = surface->container.u.texture;
 
         TRACE("Passing to container (%p).\n", texture);
         texture->baseTexture.texture_ops->texture_preload(texture, srgb);
@@ -1751,7 +1751,7 @@ void surface_prepare_texture(IWineD3DSurfaceImpl *surface, const struct wined3d_
 {
     if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
     {
-        IWineD3DBaseTextureImpl *texture = surface->container.u.texture;
+        struct wined3d_texture *texture = surface->container.u.texture;
         UINT sub_count = texture->baseTexture.level_count * texture->baseTexture.layer_count;
         UINT i;
 
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 7a156ad..e3628f3 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -2777,7 +2777,8 @@ void gen_ffp_frag_op(struct wined3d_stateblock *stateblock, struct ffp_frag_sett
 
     for (i = 0; i < gl_info->limits.texture_stages; ++i)
     {
-        IWineD3DBaseTextureImpl *texture;
+        const struct wined3d_texture *texture;
+
         settings->op[i].padding = 0;
         if (stateblock->state.texture_states[i][WINED3DTSS_COLOROP] == WINED3DTOP_DISABLE)
         {
@@ -2859,8 +2860,10 @@ void gen_ffp_frag_op(struct wined3d_stateblock *stateblock, struct ffp_frag_sett
 
         if (!i && stateblock->state.textures[0] && stateblock->state.render_states[WINED3DRS_COLORKEYENABLE])
         {
-            IWineD3DBaseTextureImpl *texture = stateblock->state.textures[0];
-            GLenum texture_dimensions = texture->baseTexture.target;
+            GLenum texture_dimensions;
+
+            texture = stateblock->state.textures[0];
+            texture_dimensions = texture->baseTexture.target;
 
             if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
             {
@@ -3025,7 +3028,7 @@ void add_ffp_frag_shader(struct wine_rb_tree *shaders, struct ffp_frag_desc *des
  * Requires the caller to activate the correct unit before
  */
 /* GL locking is done by the caller (state handler) */
-void texture_activate_dimensions(IWineD3DBaseTextureImpl *texture, const struct wined3d_gl_info *gl_info)
+void texture_activate_dimensions(const struct wined3d_texture *texture, const struct wined3d_gl_info *gl_info)
 {
     if (texture)
     {
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 4e13904..9c867ed 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -29,7 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface);
 /* Context activation is done by the caller. */
 static void volume_bind_and_dirtify(struct IWineD3DVolumeImpl *volume, const struct wined3d_gl_info *gl_info)
 {
-    IWineD3DBaseTextureImpl *container = (IWineD3DBaseTextureImpl *)volume->container;
+    struct wined3d_texture *container = volume->container;
     DWORD active_sampler;
 
     /* We don't need a specific texture unit, but after binding the texture the current unit is dirty.
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 5b8df4f..235a2dd 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -55,8 +55,6 @@
 typedef struct IWineD3DSurfaceImpl    IWineD3DSurfaceImpl;
 typedef struct IWineD3DDeviceImpl     IWineD3DDeviceImpl;
 typedef struct IWineD3DSwapChainImpl  IWineD3DSwapChainImpl;
-typedef struct wined3d_texture IWineD3DBaseTextureImpl;
-typedef struct wined3d_texture IWineD3DBaseTexture;
 struct IWineD3DBaseShaderImpl;
 
 /* Texture format fixups */
@@ -1850,10 +1848,6 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
 /* Tests show that the start address of resources is 32 byte aligned */
 #define RESOURCE_ALIGNMENT 16
 
-/*****************************************************************************
- * IWineD3DBaseTexture D3D- > openGL state map lookups
- */
-
 typedef enum winetexturestates {
     WINED3DTEXSTA_ADDRESSU       = 0,
     WINED3DTEXSTA_ADDRESSV       = 1,
@@ -1922,7 +1916,7 @@ struct wined3d_texture
 
 static inline struct wined3d_texture *wined3d_texture_from_resource(struct wined3d_resource *resource)
 {
-    return CONTAINING_RECORD(resource, IWineD3DBaseTextureImpl, resource);
+    return CONTAINING_RECORD(resource, struct wined3d_texture, resource);
 }
 
 static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_texture *texture,
@@ -1933,20 +1927,20 @@ static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_t
             : &texture->baseTexture.texture_rgb;
 }
 
-void wined3d_texture_apply_state_changes(IWineD3DBaseTextureImpl *texture,
+void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
         const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1],
         const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
-void wined3d_texture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty) DECLSPEC_HIDDEN;
+void wined3d_texture_set_dirty(struct wined3d_texture *texture, BOOL dirty) DECLSPEC_HIDDEN;
 
-HRESULT cubetexture_init(IWineD3DBaseTextureImpl *texture, UINT edge_length, UINT levels,
+HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT levels,
         IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
         void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
 
-HRESULT texture_init(IWineD3DBaseTextureImpl *texture, UINT width, UINT height, UINT levels,
+HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, UINT levels,
         IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
         void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
 
-HRESULT volumetexture_init(IWineD3DBaseTextureImpl *texture, UINT width, UINT height,
+HRESULT volumetexture_init(struct wined3d_texture *texture, UINT width, UINT height,
         UINT depth, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id,
         WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
 
@@ -2356,7 +2350,7 @@ struct wined3d_state
     INT ps_consts_i[MAX_CONST_I * 4];
     float *ps_consts_f;
 
-    IWineD3DBaseTextureImpl *textures[MAX_COMBINED_SAMPLERS];
+    struct wined3d_texture *textures[MAX_COMBINED_SAMPLERS];
     DWORD sampler_states[MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1];
     DWORD texture_states[MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1];
     DWORD lowest_disabled_stage;
@@ -2632,7 +2626,7 @@ void set_tex_op_nvrc(const struct wined3d_gl_info *gl_info, const struct wined3d
         INT texture_idx, DWORD dst) DECLSPEC_HIDDEN;
 void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords,
         BOOL transformed, enum wined3d_format_id coordtype, BOOL ffp_can_disable_proj) DECLSPEC_HIDDEN;
-void texture_activate_dimensions(IWineD3DBaseTextureImpl *texture,
+void texture_activate_dimensions(const struct wined3d_texture *texture,
         const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
 void sampler_texdim(DWORD state, struct wined3d_stateblock *stateblock,
         struct wined3d_context *context) DECLSPEC_HIDDEN;
@@ -2897,7 +2891,7 @@ HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *de
         const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
         void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
 void pixelshader_update_samplers(struct wined3d_shader_reg_maps *reg_maps,
-        IWineD3DBaseTextureImpl * const *textures) DECLSPEC_HIDDEN;
+        struct wined3d_texture * const *textures) DECLSPEC_HIDDEN;
 void find_ps_compile_args(const struct wined3d_state *state,
         IWineD3DPixelShaderImpl *shader, struct ps_compile_args *args) DECLSPEC_HIDDEN;
 
-- 
1.7.3.4




More information about the wine-patches mailing list