Nikolay Sivov : d2d1/effect: Set initial value for uint32 properties.

Alexandre Julliard julliard at winehq.org
Mon Jun 27 16:12:51 CDT 2022


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sun Jun 26 14:22:05 2022 +0300

d2d1/effect: Set initial value for uint32 properties.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>

---

 dlls/d2d1/factory.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c
index 16e12d818bc..52e09033e6d 100644
--- a/dlls/d2d1/factory.c
+++ b/dlls/d2d1/factory.c
@@ -827,10 +827,32 @@ static HRESULT parse_effect_add_property(struct d2d_effect_properties *props, co
     }
     else
     {
+        void *src = NULL;
+        UINT32 _uint32;
+
         p->data.offset = props->offset;
         p->size = sizes[type];
         props->offset += p->size;
-        /* FIXME: convert and write initial value */
+
+        if (value)
+        {
+            switch (p->type)
+            {
+                case D2D1_PROPERTY_TYPE_UINT32:
+                    _uint32 = wcstoul(value, NULL, 10);
+                    src = &_uint32;
+                    break;
+                case D2D1_PROPERTY_TYPE_IUNKNOWN:
+                case D2D1_PROPERTY_TYPE_COLOR_CONTEXT:
+                    break;
+                default:
+                    FIXME("Initial value for property type %u is not handled.\n", p->type);
+            }
+
+            if (src && p->size) memcpy(props->data.ptr + p->data.offset, src, p->size);
+        }
+        else if (p->size)
+            memset(props->data.ptr + p->data.offset, 0, p->size);
     }
     p->set_function = NULL;
     p->get_function = NULL;




More information about the wine-cvs mailing list