diff options
Diffstat (limited to 'src/Pad.cpp')
-rw-r--r-- | src/Pad.cpp | 107 |
1 files changed, 87 insertions, 20 deletions
diff --git a/src/Pad.cpp b/src/Pad.cpp index ab6bf154..44bde467 100644 --- a/src/Pad.cpp +++ b/src/Pad.cpp @@ -14,24 +14,91 @@ CMouseControllerState &CPad::PCTempMouseControllerState = *(CMouseControllerStat void CControllerState::Clear(void) { - leftX = 0; - leftY = 0; - rightX = 0; - rightY = 0; - l1 = 0; - l2 = 0; - r1 = 0; - r2 = 0; - up = 0; - down = 0; - left = 0; - right = 0; - start = 0; - select = 0; - square = 0; - triangle = 0; - cross = 0; - circle = 0; - leftshock = 0; - rightshock = 0; + LeftStickX = 0; + LeftStickY = 0; + RightStickX = 0; + RightStickY = 0; + LeftShoulder1 = 0; + LeftShoulder2 = 0; + RightShoulder1 = 0; + RightShoulder2 = 0; + DPadUp = 0; + DPadDown = 0; + DPadLeft = 0; + DPadRight = 0; + Start = 0; + Select = 0; + Square = 0; + Triangle = 0; + Cross = 0; + Circle = 0; + LeftShock = 0; + RightShock = 0; + NetworkTalk = 0; +} + +bool +CPad::ForceCameraBehindPlayer(void) +{ + if(DisablePlayerControls) + return false; + switch(Mode){ + case 0: + case 1: + return !!NewState.LeftShoulder1; + case 2: + return !!NewState.Triangle; + case 3: + return !!NewState.Circle; + } + return false; +} + +bool +CPad::GetWeapon(void) +{ + if(DisablePlayerControls) + return false; + switch(Mode){ + case 0: + case 1: + return !!NewState.Circle; + case 2: + return !!NewState.Cross; + case 3: + return !!NewState.RightShoulder1; + } + return false; +} + +bool +CPad::GetLookBehindForCar(void) +{ + if(DisablePlayerControls) + return false; + return NewState.LeftShoulder2 && NewState.RightShoulder2; +} + +bool +CPad::GetLookBehindForPed(void) +{ + if(DisablePlayerControls) + return false; + return !!NewState.RightShock; +} + +bool +CPad::GetLookLeft(void) +{ + if(DisablePlayerControls) + return false; + return !!NewState.LeftShoulder2; +} + +bool +CPad::GetLookRight(void) +{ + if(DisablePlayerControls) + return false; + return !!NewState.RightShoulder2; } |