瀏覽代碼

Copy properties when converting a surface to a new format

This fixes retaining the cursor hotspot when converting cursor frames to SDL_PIXELFORMAT_ARGB8888
Sam Lantinga 4 天之前
父節點
當前提交
2f810e0a5f
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/video/SDL_surface.c

+ 7 - 0
src/video/SDL_surface.c

@@ -2147,6 +2147,13 @@ end:
         }
     }
 
+    // Copy properties
+    if (surface->props) {
+        if (!SDL_CopyProperties(surface->props, SDL_GetSurfaceProperties(convert))) {
+            goto error;
+        }
+    }
+
     // We're ready to go!
     return convert;