Skip to content

Commit

Permalink
Added XBOXController files to project.
Browse files Browse the repository at this point in the history
Slightly changed XBOXController vibration parameters.
  • Loading branch information
fluffyfreak committed May 3, 2012
1 parent c33e47b commit 8354926
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
8 changes: 8 additions & 0 deletions StuntCarRacer_2008.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,14 @@
RelativePath=".\Sounds\Wreck.wav"
>
</File>
<File
RelativePath=".\XBOXController.cpp"
>
</File>
<File
RelativePath=".\XBOXController.h"
>
</File>
</Files>
<Globals>
</Globals>
Expand Down
6 changes: 4 additions & 2 deletions XBOXController.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "dxstdafx.h"
#include "XBOXController.h"

CXBOXController::CXBOXController(int playerNumber)
// ctor - playerNumber 1<>4
CXBOXController::CXBOXController(const int playerNumber)
{
// Set the Controller Number
_controllerNum = playerNumber - 1;
Expand Down Expand Up @@ -35,7 +37,7 @@ bool CXBOXController::IsConnected()
}
}

void CXBOXController::Vibrate(int leftVal, int rightVal)
void CXBOXController::Vibrate(const unsigned short leftVal, const unsigned short rightVal)
{
// Create a Vibraton State
XINPUT_VIBRATION Vibration;
Expand Down
5 changes: 3 additions & 2 deletions XBOXController.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ class CXBOXController
XINPUT_STATE _controllerState;
int _controllerNum;
public:
CXBOXController(int playerNumber);
// ctor - playerNumber 1<>4
CXBOXController(const int playerNumber);
XINPUT_STATE GetState();
bool IsConnected();
void Vibrate(int leftVal = 0, int rightVal = 0);
void Vibrate(const unsigned short leftVal = 0, const unsigned short rightVal = 0);
};

#endif

0 comments on commit 8354926

Please sign in to comment.