mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-17 07:16:00 +00:00
Cleaned up various type conversion issues
This makes sure SDL_PixelFormatEnum flows through the internal code correctly, as well as fixing a number of other minor issues.
This commit is contained in:
@@ -128,6 +128,14 @@ typedef struct
|
||||
Uint8 ucNExtensionBytes;
|
||||
} WiiButtonData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Uint16 min;
|
||||
Uint16 max;
|
||||
Uint16 center;
|
||||
Uint16 deadzone;
|
||||
} StickCalibrationData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SDL_HIDAPI_Device *device;
|
||||
@@ -147,13 +155,7 @@ typedef struct
|
||||
Uint64 m_ulNextMotionPlusCheck;
|
||||
SDL_bool m_bDisconnected;
|
||||
|
||||
struct StickCalibrationData
|
||||
{
|
||||
Uint16 min;
|
||||
Uint16 max;
|
||||
Uint16 center;
|
||||
Uint16 deadzone;
|
||||
} m_StickCalibrationData[6];
|
||||
StickCalibrationData m_StickCalibrationData[6];
|
||||
} SDL_DriverWii_Context;
|
||||
|
||||
static void HIDAPI_DriverWii_RegisterHints(SDL_HintCallback callback, void *userdata)
|
||||
@@ -857,7 +859,7 @@ static int HIDAPI_DriverWii_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void PostStickCalibrated(Uint64 timestamp, SDL_Joystick *joystick, struct StickCalibrationData *calibration, Uint8 axis, Uint16 data)
|
||||
static void PostStickCalibrated(Uint64 timestamp, SDL_Joystick *joystick, StickCalibrationData *calibration, Uint8 axis, Uint16 data)
|
||||
{
|
||||
Sint16 value = 0;
|
||||
if (!calibration->center) {
|
||||
@@ -1366,7 +1368,7 @@ static void HandleStatus(SDL_DriverWii_Context *ctx, SDL_Joystick *joystick)
|
||||
|
||||
static void HandleResponse(SDL_DriverWii_Context *ctx, SDL_Joystick *joystick)
|
||||
{
|
||||
EWiiInputReportIDs type = ctx->m_rgucReadBuffer[0];
|
||||
EWiiInputReportIDs type = (EWiiInputReportIDs)ctx->m_rgucReadBuffer[0];
|
||||
WiiButtonData data;
|
||||
SDL_assert(type == k_eWiiInputReportIDs_Acknowledge || type == k_eWiiInputReportIDs_ReadMemory);
|
||||
SDL_zero(data);
|
||||
@@ -1473,7 +1475,7 @@ static void HandleButtonPacket(SDL_DriverWii_Context *ctx, SDL_Joystick *joystic
|
||||
|
||||
static void HandleInput(SDL_DriverWii_Context *ctx, SDL_Joystick *joystick)
|
||||
{
|
||||
EWiiInputReportIDs type = ctx->m_rgucReadBuffer[0];
|
||||
EWiiInputReportIDs type = (EWiiInputReportIDs)ctx->m_rgucReadBuffer[0];
|
||||
|
||||
/* Set up for handling input */
|
||||
ctx->timestamp = SDL_GetTicksNS();
|
||||
|
Reference in New Issue
Block a user