git repos / blockattack-game

commit 3ee31498

sago007 · 2018-06-30 11:56
3ee3149811085d4e29237a7b30f13fd44e597b2b patch · browse files
parent 146ce3eb57e1dd5d9d583722d32a41e3b39828c1

You can now push with L2 and R2

Changed files

M source/code/gamecontroller.cpp before
diff --git a/source/code/gamecontroller.cpp b/source/code/gamecontroller.cpp index 7a2178c..bbb4029 100644 --- a/source/code/gamecontroller.cpp +++ b/source/code/gamecontroller.cpp
@@ -258,5 +258,15 @@ bool isPlayerPushEvent(int playerNumber, const SDL_Event& event) {
return true;
}
}
+ if (event.type == SDL_CONTROLLERAXISMOTION && (event.caxis.axis == SDL_CONTROLLER_AXIS_TRIGGERLEFT || event.caxis.axis == SDL_CONTROLLER_AXIS_TRIGGERRIGHT ) ) {
+ checkDeadZone(event);
+ const SDL_ControllerAxisEvent& a = event.caxis;
+ if (getDeadZone(a.which, a.axis)) {
+ if (event.caxis.value > deadZoneLimit) {
+ setDeadZone(a.which,a.axis,false);
+ return true;
+ }
+ }
+ }
return false;
}
\ No newline at end of file