Michael Stefaniuc : d3dx9: Move object_count out of struct d3dx9_base_effect.

Alexandre Julliard julliard at winehq.org
Thu Mar 7 16:27:59 CST 2019


Module: wine
Branch: master
Commit: 54bdc66acf4abe1f1fa38238ed824c2372e1ff91
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=54bdc66acf4abe1f1fa38238ed824c2372e1ff91

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Tue Mar  5 22:34:21 2019 +0100

d3dx9: Move object_count out of struct d3dx9_base_effect.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3dx9_36/effect.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index bbbfb45..992d7b4 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -153,7 +153,6 @@ struct d3dx9_base_effect
     struct d3dx_effect *effect;
 
     UINT technique_count;
-    UINT object_count;
 
     struct d3dx_top_level_parameter *parameters;
     struct d3dx_technique *techniques;
@@ -176,6 +175,7 @@ struct d3dx_effect
 
     struct d3dx9_base_effect base_effect;
     unsigned int parameter_count;
+    unsigned int object_count;
 
     struct ID3DXEffectStateManager *manager;
     struct IDirect3DDevice9 *device;
@@ -707,7 +707,7 @@ static void d3dx9_base_effect_cleanup(struct d3dx9_base_effect *base)
 
     if (base->objects)
     {
-        for (i = 0; i < base->object_count; ++i)
+        for (i = 0; i < base->effect->object_count; ++i)
         {
             free_object(&base->objects[i]);
         }
@@ -6270,10 +6270,10 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U
 
     skip_dword_unknown(&ptr, 1);
 
-    read_dword(&ptr, &base->object_count);
-    TRACE("Object count: %u.\n", base->object_count);
+    read_dword(&ptr, &effect->object_count);
+    TRACE("Object count: %u.\n", effect->object_count);
 
-    base->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*base->objects) * base->object_count);
+    base->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*base->objects) * effect->object_count);
     if (!base->objects)
     {
         ERR("Out of memory.\n");
@@ -6399,7 +6399,7 @@ err_out:
 
     if (base->objects)
     {
-        for (i = 0; i < base->object_count; ++i)
+        for (i = 0; i < effect->object_count; ++i)
         {
             free_object(&base->objects[i]);
         }




More information about the wine-cvs mailing list