Closed Moros1138 closed 4 years ago
I think I see the issue, that loop there is meant to be readability thing, it's adding all the 20 possible buttons to the array that keeps track of them. Seems like in vs FIELD_OFFSET expands to non const but in mingw it does or something.
Try the following fix:
Remove the loop from init and add the 20 hardcoded lines to the g_aObjectFormats array like so
{0, (DWORD)FIELD_OFFSET(GamePadState, buttons[0]), DIDFT_BUTTON | DIDFT_ANYINSTANCE | 0x80000000, 0},
Add this line 20 times to the end of that array with buttons[X] going from 0 to 19.
I was running a test compile of PGEXes in my test build environments. Compiled fine on Linux, but when I compile with MinGW (From MSYS2) I get an error about using an integer inside a constant expression. I have provided the build command and it's output. Hope it's useful to you.