diff options
author | aap <aap@papnet.eu> | 2019-05-29 18:06:33 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-05-29 18:06:33 +0200 |
commit | 820fd66a94c20c4e1dab21f6abda4138eaefbe79 (patch) | |
tree | 445a810baf60f29c455dbaf4b3e82934806b49a8 /src/Pad.cpp | |
parent | more CVehicleModelInfo (diff) | |
download | re3-820fd66a94c20c4e1dab21f6abda4138eaefbe79.tar re3-820fd66a94c20c4e1dab21f6abda4138eaefbe79.tar.gz re3-820fd66a94c20c4e1dab21f6abda4138eaefbe79.tar.bz2 re3-820fd66a94c20c4e1dab21f6abda4138eaefbe79.tar.lz re3-820fd66a94c20c4e1dab21f6abda4138eaefbe79.tar.xz re3-820fd66a94c20c4e1dab21f6abda4138eaefbe79.tar.zst re3-820fd66a94c20c4e1dab21f6abda4138eaefbe79.zip |
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; } |