From ffc6c41201ba514524710f4c29af8f9f333c489f Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 25 Jan 2016 17:58:33 +1100 Subject: [PATCH] [wx] Hack wxRGBToColour to hide VS size check --- Source/3rdParty/wx/include/wx/msw/private.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/3rdParty/wx/include/wx/msw/private.h b/Source/3rdParty/wx/include/wx/msw/private.h index c4d37c8c3..aebcdf756 100644 --- a/Source/3rdParty/wx/include/wx/msw/private.h +++ b/Source/3rdParty/wx/include/wx/msw/private.h @@ -226,7 +226,10 @@ inline COLORREF wxColourToPalRGB(const wxColour& c) inline wxColour wxRGBToColour(COLORREF rgb) { - return wxColour(GetRValue(rgb), GetGValue(rgb), GetBValue(rgb)); + unsigned char red = ((unsigned char)((rgb) >> 16)); + unsigned char green = ((unsigned char)(((unsigned short)(rgb & 0xFFFF)) >> 8)); + unsigned char blue = ((unsigned char)(rgb & 0xFF)); + return wxColour(red, green, blue); } inline void wxRGBToColour(wxColour& c, COLORREF rgb)