We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4596

Summary: [Patch] Clean up WIC backend to work with C, MinGW
Product: SDL_image Reporter: Ethan Lee <flibitijibibo>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.3   
Hardware: All   
OS: Windows (All)   
Attachments: Patch to clean up IMG_WIC.c
Patch to clean up IMG_WIC.c

Description Ethan Lee 2019-04-12 14:54:10 UTC
Created attachment 3746 [details]
Patch to clean up IMG_WIC.c

The current IMG_WIC implementation uses C++ and IWIC2, which wasn't as compatible as C and IWIC, so I cleaned up the file and made it work with MinGW. It should be functionally the same with the following exceptions:

1. Changed the channel mask to match the other backends' output data (maybe IWIC2 swapped R and B?)
2. Check for WIC_Init when calling WIC_LoadImage, similar to other backends
Comment 1 Ethan Lee 2019-04-12 20:31:50 UTC
Created attachment 3747 [details]
Patch to clean up IMG_WIC.c

Quick update to make the WIC_Init check more correct.
Comment 2 Sam Lantinga 2019-04-17 03:16:59 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL_image/rev/61f1bf992955