summaryrefslogtreecommitdiff
path: root/src/joyGet.cpp
blob: 0de5cc0c8da69f08fd30668acdff745f127f7b90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "FLD.hpp"

FLD::InputState
FLD::joyGet(Uint8 btn) const
{
	return joystates[btn];
}

bool
FLD::joyDown(Uint8 btn) const
{
	const auto state = joyGet(btn);
	return (state == InputState::Down || state == InputState::Press);
}

bool
FLD::joyUp(Uint8 btn) const
{
	return !joyDown(btn);
}

bool
FLD::joyPressed(Uint8 btn) const
{
	return (joyGet(btn) == InputState::Press);
}

bool
FLD::joyReleased(Uint8 btn) const
{
	return (joyGet(btn) == InputState::Release);
}