Skip to content

Commit

Permalink
Changed Axes into GPAxes for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
gorbit99 authored Aug 3, 2019
1 parent 036f2b1 commit 56c9933
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions olcPGEX_Gamepad.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace olc
DPAD_D = 17,
};

enum class Axes {
enum class GPAxes {
LX = 1,
LY = 0,
RX = 5,
Expand All @@ -115,7 +115,7 @@ namespace olc
static std::vector<GamePad> getGamepads();
bool valid = true;
void poll();
float getAxis(Axes a);
float getAxis(GPAxes a);
HWButton getButton(GPButtons b);
std::string getName();
int getAxisCount();
Expand Down Expand Up @@ -770,7 +770,7 @@ olc::GamePad olc::GamePad::selectWithButton(std::vector<olc::GamePad> &pads, olc
#ifndef OLC_GAMEPAD_DEADZONE
#define OLC_GAMEPAD_DEADZONE 0.2f
#endif
float olc::GamePad::getAxis(olc::Axes a) {
float olc::GamePad::getAxis(olc::GPAxes a) {

float axis = axes[static_cast<int>(a)];
if (axis > 1) axis = 1;
Expand All @@ -779,7 +779,7 @@ float olc::GamePad::getAxis(olc::Axes a) {
axis = 0;

#ifdef WIN32
if (!xInput && (a == Axes::TL || a == Axes::TR))
if (!xInput && (a == GPAxes::TL || a == GPAxes::TR))
return (axis + 1) / 2;
#endif
return axis;
Expand Down Expand Up @@ -816,4 +816,4 @@ void olc::GamePad::handleButton(int id, bool value) {

#endif //OLC_PGE_GAMEPAD

#pragma endregion
#pragma endregion

0 comments on commit 56c9933

Please sign in to comment.