Added ball, touchpad, and sensor support for virtual joysticks
Fixes https://github.com/libsdl-org/SDL/issues/9542
This commit is contained in:
@@ -191,6 +191,7 @@ void GetGamepadImageArea(GamepadImage *ctx, SDL_Rect *area)
|
||||
{
|
||||
if (!ctx) {
|
||||
SDL_zerop(area);
|
||||
return;
|
||||
}
|
||||
|
||||
area->x = ctx->x;
|
||||
@@ -202,6 +203,19 @@ void GetGamepadImageArea(GamepadImage *ctx, SDL_Rect *area)
|
||||
}
|
||||
}
|
||||
|
||||
void GetGamepadTouchpadArea(GamepadImage *ctx, SDL_Rect *area)
|
||||
{
|
||||
if (!ctx) {
|
||||
SDL_zerop(area);
|
||||
return;
|
||||
}
|
||||
|
||||
area->x = (float)ctx->x + (ctx->gamepad_width - ctx->touchpad_width) / 2 + touchpad_area.x;
|
||||
area->y = (float)ctx->y + ctx->gamepad_height + touchpad_area.y;
|
||||
area->w = (float)touchpad_area.w;
|
||||
area->h = (float)touchpad_area.h;
|
||||
}
|
||||
|
||||
void SetGamepadImageShowingFront(GamepadImage *ctx, SDL_bool showing_front)
|
||||
{
|
||||
if (!ctx) {
|
||||
|
||||
Reference in New Issue
Block a user