mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-24 11:22:02 -05:00
Swizzle bits of a window correctly for mingw builds (#3521)
This commit is contained in:
parent
de02bbc922
commit
2c3a832970
1 changed files with 5 additions and 1 deletions
|
@ -806,7 +806,11 @@ HWND windows_get_window_handle()
|
|||
HWND handle = wmInfo.info.win.window;
|
||||
#ifdef __MINGW32__
|
||||
assert(sizeof(HWND) == sizeof(uint32));
|
||||
HWND result = (((uint32)handle & 0xff000000) >> 8) | (((uint32)handle & 0xff0000) << 8) | (((uint32)handle & 0xff00) >> 8) | (((uint32)handle & 0xff) << 8);
|
||||
uint8 A = (uint32)handle & 0xff000000 >> 24;
|
||||
uint8 B = (uint32)handle & 0xff0000 >> 16;
|
||||
uint8 C = (uint32)handle & 0xff00 >> 8;
|
||||
uint8 D = (uint32)handle & 0xff;
|
||||
HWND result = (HWND)(D << 24 | A << 16 | B << 8 | C);
|
||||
log_warning("twisting bits of handle, a workaround for mingw/sdl bug");
|
||||
#else
|
||||
HWND result = handle;
|
||||
|
|
Loading…
Add table
Reference in a new issue