You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
878 B
28 lines
878 B
|
7 years ago
|
#pragma once
|
||
|
|
|
||
|
|
// Processes and stores mouse and joystick motion.
|
||
|
|
|
||
|
5 years ago
|
#include <SDL.h>
|
||
|
|
|
||
|
5 years ago
|
#include "./axis_direction.h"
|
||
|
5 years ago
|
#include "./controller.h"
|
||
|
7 years ago
|
|
||
|
5 years ago
|
namespace devilution {
|
||
|
7 years ago
|
|
||
|
5 years ago
|
// Raw axis values.
|
||
|
|
extern float leftStickXUnscaled, leftStickYUnscaled, rightStickXUnscaled, rightStickYUnscaled;
|
||
|
|
|
||
|
|
// Axis values scaled to [-1, 1] range and clamped to a deadzone.
|
||
|
|
extern float leftStickX, leftStickY, rightStickX, rightStickY;
|
||
|
|
|
||
|
|
// Whether stick positions have been updated and need rescaling.
|
||
|
|
extern bool leftStickNeedsScaling, rightStickNeedsScaling;
|
||
|
7 years ago
|
|
||
|
|
// Updates motion state for mouse and joystick sticks.
|
||
|
5 years ago
|
bool ProcessControllerMotion(const SDL_Event &event, ControllerButtonEvent ctrl_event);
|
||
|
7 years ago
|
|
||
|
5 years ago
|
// Returns direction of the left thumb stick or DPad (if allow_dpad = true).
|
||
|
|
AxisDirection GetLeftStickOrDpadDirection(bool allow_dpad = true);
|
||
|
|
|
||
|
5 years ago
|
} // namespace devilution
|