Jacek Caban : gdi32: Use NtGdiDoPalette for AnimatePalette.

Alexandre Julliard julliard at winehq.org
Mon Aug 16 18:07:24 CDT 2021


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Aug 16 10:27:50 2021 +0200

gdi32: Use NtGdiDoPalette for AnimatePalette.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/objects.c |  8 ++++++++
 dlls/gdi32/palette.c | 22 +++++-----------------
 2 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/dlls/gdi32/objects.c b/dlls/gdi32/objects.c
index b1723b20085..4f7932be329 100644
--- a/dlls/gdi32/objects.c
+++ b/dlls/gdi32/objects.c
@@ -542,3 +542,11 @@ UINT WINAPI SetPaletteEntries( HPALETTE palette, UINT start, UINT count,
 {
     return NtGdiDoPalette( palette, start, count, (void *)entries, NtGdiSetPaletteEntries, FALSE );
 }
+
+/***********************************************************************
+ *           AnimatePalette    (GDI32.@)
+ */
+BOOL WINAPI AnimatePalette( HPALETTE palette, UINT start, UINT count, const PALETTEENTRY *entries )
+{
+    return NtGdiDoPalette( palette, start, count, (void *)entries, NtGdiAnimatePalette, FALSE );
+}
diff --git a/dlls/gdi32/palette.c b/dlls/gdi32/palette.c
index a46d75e9970..cd4fac217be 100644
--- a/dlls/gdi32/palette.c
+++ b/dlls/gdi32/palette.c
@@ -248,23 +248,9 @@ BOOL WINAPI NtGdiResizePalette( HPALETTE hPal, UINT cEntries )
 }
 
 
-/***********************************************************************
- * AnimatePalette [GDI32.@]
- *
- * Replaces entries in logical palette.
- *
- * RETURNS
- *    Success: TRUE
- *    Failure: FALSE
- *
- * FIXME
- *    Should use existing mapping when animating a primary palette
- */
-BOOL WINAPI AnimatePalette(
-    HPALETTE hPal,              /* [in] Handle to logical palette */
-    UINT StartIndex,            /* [in] First entry in palette */
-    UINT NumEntries,            /* [in] Count of entries in palette */
-    const PALETTEENTRY* PaletteColors) /* [in] Pointer to first replacement */
+/* Replaces entries in logical palette. */
+static BOOL animate_palette( HPALETTE hPal, UINT StartIndex, UINT NumEntries,
+                             const PALETTEENTRY *PaletteColors )
 {
     TRACE("%p (%i - %i)\n", hPal, StartIndex,StartIndex+NumEntries);
 
@@ -679,6 +665,8 @@ LONG WINAPI NtGdiDoPalette( HGDIOBJ handle, WORD start, WORD count, void *entrie
 {
     switch (func)
     {
+    case NtGdiAnimatePalette:
+        return animate_palette( handle, start, count, entries );
     case NtGdiSetPaletteEntries:
         return set_palette_entries( handle, start, count, entries );
     case NtGdiGetPaletteEntries:




More information about the wine-cvs mailing list