diff --git a/demos/FFConsoleDemo/FFConsoleDemo.cpp b/demos/FFConsoleDemo/FFConsoleDemo.cpp index 7334ef0..77d4613 100644 --- a/demos/FFConsoleDemo/FFConsoleDemo.cpp +++ b/demos/FFConsoleDemo/FFConsoleDemo.cpp @@ -110,16 +110,16 @@ class Variable return oss.str(); } - virtual void update(){}; + virtual void update() {}; }; class Constant : public Variable { public: Constant(double dInitValue) : - Variable(dInitValue) {} + Variable(dInitValue) { } - virtual void setValue(double dValue) {} + virtual void setValue(double dValue) { } }; class LimitedVariable : public Variable @@ -131,7 +131,7 @@ class LimitedVariable : public Variable public: LimitedVariable(double dInitValue, double dMinValue, double dMaxValue) : Variable(dInitValue), _dMinValue(dMinValue), _dMaxValue(dMaxValue) - {} + { } virtual void setValue(double dValue) { @@ -158,7 +158,7 @@ class TriangleVariable : public LimitedVariable public: TriangleVariable(double dInitValue, double dDeltaValue, double dMinValue, double dMaxValue) : - LimitedVariable(dInitValue, dMinValue, dMaxValue), _dDeltaValue(dDeltaValue){}; + LimitedVariable(dInitValue, dMinValue, dMaxValue), _dDeltaValue(dDeltaValue) {}; virtual void update() { @@ -207,7 +207,7 @@ class VariableEffect VariableEffect(const char* pszDesc, Effect* pEffect, const MapVariables& mapVars, const EffectVariablesApplier pfApplyVars) : _pszDesc(pszDesc), _pEffect(pEffect), _mapVariables(mapVars), _pfApplyVariables(pfApplyVars), _bActive(false) - {} + { } ~VariableEffect() { @@ -459,7 +459,7 @@ void forceVariableApplier(MapVariables& mapVars, Effect* pEffect) ConstantEffect* pConstForce = dynamic_cast(pEffect->getForceEffect()); pConstForce->level = (int)dForce; pConstForce->envelope.attackLevel = (unsigned short)fabs(dForce * dAttackFactor); - pConstForce->envelope.fadeLevel = (unsigned short)fabs(dForce); // Fade never reached, in fact. + pConstForce->envelope.fadeLevel = (unsigned short)fabs(dForce); // Fade never reached, in fact. } // Variable "Period" on an OIS::PeriodicEffect @@ -535,17 +535,17 @@ class EffectManager // Linux2.6.22.9=Not supported pEffect = new Effect(Effect::ConstantForce, Effect::Constant); pEffect->direction = Effect::North; - pEffect->trigger_button = 0; + pEffect->trigger_button = 0; pEffect->trigger_interval = 0; - pEffect->replay_length = Effect::OIS_INFINITE; // Linux/Win32: Same behaviour as 0. - pEffect->replay_delay = 0; + pEffect->replay_length = Effect::OIS_INFINITE; // Linux/Win32: Same behaviour as 0. + pEffect->replay_delay = 0; pEffect->setNumAxes(1); pConstForce = dynamic_cast(pEffect->getForceEffect()); pConstForce->level = 5000; //-10K to +10k pConstForce->envelope.attackLength = 0; pConstForce->envelope.attackLevel = (unsigned short)pConstForce->level; pConstForce->envelope.fadeLength = 0; - pConstForce->envelope.fadeLevel = (unsigned short)pConstForce->level; + pConstForce->envelope.fadeLevel = (unsigned short)pConstForce->level; mapVars.clear(); mapVars["Force"] = new TriangleVariable(0.0, // F0 @@ -568,17 +568,17 @@ class EffectManager // Linux2.6.22.9=Not supported. pEffect = new Effect(Effect::ConstantForce, Effect::Constant); pEffect->direction = Effect::North; - pEffect->trigger_button = 0; + pEffect->trigger_button = 0; pEffect->trigger_interval = 0; - pEffect->replay_length = Effect::OIS_INFINITE; //(unsigned int)(1000000.0/_nUpdateFreq); // Linux: Does not work. - pEffect->replay_delay = 0; + pEffect->replay_length = Effect::OIS_INFINITE; //(unsigned int)(1000000.0/_nUpdateFreq); // Linux: Does not work. + pEffect->replay_delay = 0; pEffect->setNumAxes(1); pConstForce = dynamic_cast(pEffect->getForceEffect()); pConstForce->level = 5000; //-10K to +10k pConstForce->envelope.attackLength = (unsigned int)(1000000.0 / _nUpdateFreq / 2); pConstForce->envelope.attackLevel = (unsigned short)(pConstForce->level * 0.1); pConstForce->envelope.fadeLength = 0; // Never reached, actually. - pConstForce->envelope.fadeLevel = (unsigned short)pConstForce->level; // Idem + pConstForce->envelope.fadeLevel = (unsigned short)pConstForce->level; // Idem mapVars.clear(); mapVars["Force"] = new TriangleVariable(0.0, // F0 @@ -601,10 +601,10 @@ class EffectManager // Linux2.6.22.9=Failed. pEffect = new Effect(Effect::PeriodicForce, Effect::Triangle); pEffect->direction = Effect::North; - pEffect->trigger_button = 0; + pEffect->trigger_button = 0; pEffect->trigger_interval = 0; - pEffect->replay_length = Effect::OIS_INFINITE; - pEffect->replay_delay = 0; + pEffect->replay_length = Effect::OIS_INFINITE; + pEffect->replay_delay = 0; pEffect->setNumAxes(1); pPeriodForce = dynamic_cast(pEffect->getForceEffect()); pPeriodForce->magnitude = 10000; // 0 to +10k @@ -612,8 +612,8 @@ class EffectManager pPeriodForce->phase = 0; // 0 to 35599 pPeriodForce->period = 10000; // Micro-seconds pPeriodForce->envelope.attackLength = 0; - pPeriodForce->envelope.attackLevel = (unsigned short)pPeriodForce->magnitude; - pPeriodForce->envelope.fadeLength = 0; + pPeriodForce->envelope.attackLevel = (unsigned short)pPeriodForce->magnitude; + pPeriodForce->envelope.fadeLength = 0; pPeriodForce->envelope.fadeLevel = (unsigned short)pPeriodForce->magnitude; mapVars.clear(); @@ -657,7 +657,7 @@ class EffectManager for(size_t nEffInd = 0; nEffInd < _vecEffects.size(); nEffInd++) { const Effect::EForce eForce = _vecEffects[nEffInd]->getFFEffect()->force; - const Effect::EType eType = _vecEffects[nEffInd]->getFFEffect()->type; + const Effect::EType eType = _vecEffects[nEffInd]->getFFEffect()->type; if(_pJoystickMgr->getCurrentFFDevice()->supportsEffect(eForce, eType)) { _vecPlayableEffectInd.push_back(nEffInd); @@ -683,8 +683,8 @@ class EffectManager } enum EWhichEffect { ePrevious = -1, - eNone = 0, - eNext = +1 }; + eNone = 0, + eNext = +1 }; void selectEffect(EWhichEffect eWhich) { @@ -799,17 +799,17 @@ class Application public: Application(int argc, const char* argv[]) { - _pInputMgr = nullptr; - _pEventHdlr = nullptr; - _pKeyboard = nullptr; + _pInputMgr = nullptr; + _pEventHdlr = nullptr; + _pKeyboard = nullptr; _pJoystickMgr = nullptr; - _pEffectMgr = nullptr; + _pEffectMgr = nullptr; #if defined OIS_WIN32_PLATFORM _hWnd = nullptr; #elif defined OIS_LINUX_PLATFORM _pXDisp = 0; - _xWin = 0; + _xWin = 0; #endif _bMustStop = false; @@ -1048,12 +1048,12 @@ class Application EventHandler::EventHandler(Application* pApp) : _pApplication(pApp) -{} +{ } void EventHandler::initialize(JoystickManager* pJoystickMgr, EffectManager* pEffectMgr) { _pJoystickMgr = pJoystickMgr; - _pEffectMgr = pEffectMgr; + _pEffectMgr = pEffectMgr; } bool EventHandler::keyPressed(const KeyEvent& arg) diff --git a/demos/OISConsoleDemo/OISConsole.cpp b/demos/OISConsoleDemo/OISConsole.cpp index 18f8c2b..1b72cb9 100644 --- a/demos/OISConsoleDemo/OISConsole.cpp +++ b/demos/OISConsoleDemo/OISConsole.cpp @@ -75,9 +75,9 @@ bool appRunning = true; //Global Exit Flag const char* g_DeviceType[6] = { "OISUnknown", "OISKeyboard", "OISMouse", "OISJoyStick", "OISTablet", "OISOther" }; -InputManager* g_InputManager = nullptr; //Our Input System -Keyboard* g_kb = nullptr; //Keyboard Device -Mouse* g_m = nullptr; //Mouse Device +InputManager* g_InputManager = nullptr; //Our Input System +Keyboard* g_kb = nullptr; //Keyboard Device +Mouse* g_m = nullptr; //Mouse Device JoyStick* g_joys[4] = { nullptr, nullptr, nullptr, nullptr }; //This demo supports up to 4 controllers //-- OS Specific Globals --// @@ -85,7 +85,7 @@ JoyStick* g_joys[4] = { nullptr, nullptr, nullptr, nullptr }; //This demo sup HWND hWnd = nullptr; #elif defined OIS_LINUX_PLATFORM Display* xDisp = 0; -Window xWin = 0; +Window xWin = 0; #elif defined OIS_APPLE_PLATFORM WindowRef mWin = 0; #endif @@ -94,8 +94,8 @@ WindowRef mWin = 0; class EventHandler : public KeyListener, public MouseListener, public JoyStickListener { public: - EventHandler() {} - ~EventHandler() {} + EventHandler() { } + ~EventHandler() { } bool keyPressed(const KeyEvent& arg) { std::cout << " KeyPressed {" << std::hex << arg.key << std::dec @@ -163,7 +163,7 @@ class EventHandler : public KeyListener, public MouseListener, public JoyStickLi bool sliderMoved(const JoyStickEvent& arg, int index) { std::cout << std::endl - << arg.device->vendor() << ". Slider # " << index + << arg.device->vendor() << ". Slider # " << index << " X Value: " << arg.state.mSliders[index].abX << " Y Value: " << arg.state.mSliders[index].abY; return true; @@ -344,7 +344,7 @@ void doStartup() [NSAutoreleasePool new]; [NSApplication sharedApplication]; [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; - id menubar = [[NSMenu new] autorelease]; + id menubar = [[NSMenu new] autorelease]; id appMenuItem = [[NSMenuItem new] autorelease]; [menubar addItem:appMenuItem]; [NSApp setMainMenu:menubar]; diff --git a/includes/OISEffect.h b/includes/OISEffect.h index 1308272..67ab02b 100644 --- a/includes/OISEffect.h +++ b/includes/OISEffect.h @@ -67,14 +67,14 @@ namespace OIS enum EType { //Type ----- Pairs with force: Unknown = 0, //UnknownForce - Constant, //ConstantForce + Constant, //ConstantForce Ramp, //RampForce Square, //PeriodicForce - Triangle, //PeriodicForce + Triangle, //PeriodicForce Sine, //PeriodicForce - SawToothUp, //PeriodicForce + SawToothUp, //PeriodicForce SawToothDown, //PeriodicForce - Friction, //ConditionalForce + Friction, //ConditionalForce Damper, //ConditionalForce Inertia, //ConditionalForce Spring, //ConditionalForce @@ -170,7 +170,7 @@ namespace OIS class _OISExport ForceEffect { public: - virtual ~ForceEffect() {} + virtual ~ForceEffect() { } }; //-----------------------------------------------------------------------------// @@ -183,7 +183,7 @@ namespace OIS { public: Envelope() : - attackLength(0), attackLevel(0), fadeLength(0), fadeLevel(0) {} + attackLength(0), attackLevel(0), fadeLength(0), fadeLevel(0) { } #if defined(OIS_MSVC_COMPILER) #pragma warning(push) #pragma warning(disable : 4800) @@ -219,9 +219,9 @@ namespace OIS { public: ConstantEffect() : - level(5000) {} + level(5000) { } - Envelope envelope; //Optional envolope + Envelope envelope; //Optional envolope signed short level; //-10K to +10k }; @@ -233,11 +233,11 @@ namespace OIS { public: RampEffect() : - startLevel(0), endLevel(0) {} + startLevel(0), endLevel(0) { } Envelope envelope; //Optional envelope signed short startLevel; //-10K to +10k - signed short endLevel; //-10K to +10k + signed short endLevel; //-10K to +10k }; //-----------------------------------------------------------------------------// @@ -248,7 +248,7 @@ namespace OIS { public: PeriodicEffect() : - magnitude(0), offset(0), phase(0), period(0) {} + magnitude(0), offset(0), phase(0), period(0) { } Envelope envelope; //Optional Envelope @@ -267,13 +267,13 @@ namespace OIS public: ConditionalEffect() : rightCoeff(0), leftCoeff(0), rightSaturation(0), leftSaturation(0), - deadband(0), center(0) {} + deadband(0), center(0) { } signed short rightCoeff; //-10k to +10k (Positive Coeff) - signed short leftCoeff; //-10k to +10k (Negative Coeff) + signed short leftCoeff; //-10k to +10k (Negative Coeff) unsigned short rightSaturation; //0 to 10k (Pos Saturation) - unsigned short leftSaturation; //0 to 10k (Neg Saturation) + unsigned short leftSaturation; //0 to 10k (Neg Saturation) //Region around center in which the condition is not active, in the range //from 0 through 10,000 diff --git a/includes/OISEvents.h b/includes/OISEvents.h index f7a2a15..161df1f 100644 --- a/includes/OISEvents.h +++ b/includes/OISEvents.h @@ -36,8 +36,8 @@ namespace OIS { public: explicit EventArg(Object* obj) : - device(obj) {} - virtual ~EventArg() {} + device(obj) { } + virtual ~EventArg() { } //! Pointer to the Input Device const Object* device; diff --git a/includes/OISException.h b/includes/OISException.h index 5834eed..09be6ac 100644 --- a/includes/OISException.h +++ b/includes/OISException.h @@ -60,12 +60,12 @@ namespace OIS public: //! Creates exception object Exception(OIS_ERROR err, const char* str, int line, const char* file) : - eType(err), eLine(line), eFile(file), eText(str) {} + eType(err), eLine(line), eFile(file), eText(str) { } Exception(const Exception& other) : - eType(other.eType), eLine(other.eLine), eFile(other.eFile), eText(other.eText) {} + eType(other.eType), eLine(other.eLine), eFile(other.eFile), eText(other.eText) { } - ~Exception() throw() {} + ~Exception() throw() { } virtual const char* what() const throw(); diff --git a/includes/OISFactoryCreator.h b/includes/OISFactoryCreator.h index 8890bca..f12f8ca 100644 --- a/includes/OISFactoryCreator.h +++ b/includes/OISFactoryCreator.h @@ -40,7 +40,7 @@ namespace OIS /** @remarks Virtual Destructor */ - virtual ~FactoryCreator(){}; + virtual ~FactoryCreator() {}; /** @remarks Return a list of all unused devices the factory maintains diff --git a/includes/OISForceFeedback.h b/includes/OISForceFeedback.h index f47df64..df5afbd 100644 --- a/includes/OISForceFeedback.h +++ b/includes/OISForceFeedback.h @@ -39,7 +39,7 @@ namespace OIS { public: ForceFeedback(); - virtual ~ForceFeedback() {} + virtual ~ForceFeedback() { } /** @remarks diff --git a/includes/OISInputManager.h b/includes/OISInputManager.h index 23b3940..0dfc3c5 100644 --- a/includes/OISInputManager.h +++ b/includes/OISInputManager.h @@ -155,8 +155,8 @@ namespace OIS //! All generic devices OIS supports internally (if they are compiled in) enum AddOnFactories { - AddOn_All = 0, //All Devices - AddOn_LIRC = 1, //PC Linux Infrared Remote Control + AddOn_All = 0, //All Devices + AddOn_LIRC = 1, //PC Linux Infrared Remote Control AddOn_WiiMote = 2 //PC WiiMote Support }; diff --git a/includes/OISInterface.h b/includes/OISInterface.h index cb612e7..b77ed6e 100644 --- a/includes/OISInterface.h +++ b/includes/OISInterface.h @@ -37,7 +37,7 @@ namespace OIS class _OISExport Interface { public: - virtual ~Interface(){}; + virtual ~Interface() {}; //! Type of Interface enum IType { diff --git a/includes/OISJoyStick.h b/includes/OISJoyStick.h index 482dfea..cb575ff 100644 --- a/includes/OISJoyStick.h +++ b/includes/OISJoyStick.h @@ -38,13 +38,13 @@ namespace OIS { public: Pov() : - Component(OIS_POV), direction(0) {} + Component(OIS_POV), direction(0) { } static const int Centered = 0x00000000; - static const int North = 0x00000001; - static const int South = 0x00000010; - static const int East = 0x00000100; - static const int West = 0x00001000; + static const int North = 0x00000001; + static const int South = 0x00000010; + static const int East = 0x00000100; + static const int West = 0x00001000; static const int NorthEast = 0x00000101; static const int SouthEast = 0x00000110; static const int NorthWest = 0x00001001; @@ -58,7 +58,7 @@ namespace OIS { public: Slider() : - Component(OIS_Slider), abX(0), abY(0){}; + Component(OIS_Slider), abX(0), abY(0) {}; //! true if pushed, false otherwise int abX, abY; }; @@ -121,8 +121,8 @@ namespace OIS { public: JoyStickEvent(Object* obj, const JoyStickState& st) : - EventArg(obj), state(st) {} - virtual ~JoyStickEvent() {} + EventArg(obj), state(st) { } + virtual ~JoyStickEvent() { } const JoyStickState& state; @@ -142,7 +142,7 @@ namespace OIS class _OISExport JoyStickListener { public: - virtual ~JoyStickListener() {} + virtual ~JoyStickListener() { } /** @remarks Joystick button down event */ virtual bool buttonPressed(const JoyStickEvent& arg, int button) = 0; @@ -185,7 +185,7 @@ namespace OIS class _OISExport JoyStick : public Object { public: - virtual ~JoyStick() {} + virtual ~JoyStick() { } /** @remarks diff --git a/includes/OISKeyboard.h b/includes/OISKeyboard.h index 8c37cf9..8dd8f83 100644 --- a/includes/OISKeyboard.h +++ b/includes/OISKeyboard.h @@ -32,7 +32,7 @@ namespace OIS { //! Keyboard scan codes enum KeyCode { - KC_UNASSIGNED = 0x00, + KC_UNASSIGNED = 0x00, KC_ESCAPE = 0x01, KC_1 = 0x02, KC_2 = 0x03, @@ -72,7 +72,7 @@ namespace OIS KC_K = 0x25, KC_L = 0x26, KC_SEMICOLON = 0x27, - KC_APOSTROPHE = 0x28, + KC_APOSTROPHE = 0x28, KC_GRAVE = 0x29, // accent KC_LSHIFT = 0x2A, KC_BACKSLASH = 0x2B, @@ -138,17 +138,17 @@ namespace OIS KC_AX = 0x96, // (Japan AX) KC_UNLABELED = 0x97, // (J3100) KC_NEXTTRACK = 0x99, // Next Track - KC_NUMPADENTER = 0x9C, // Enter on numeric keypad + KC_NUMPADENTER = 0x9C, // Enter on numeric keypad KC_RCONTROL = 0x9D, KC_MUTE = 0xA0, // Mute - KC_CALCULATOR = 0xA1, // Calculator + KC_CALCULATOR = 0xA1, // Calculator KC_PLAYPAUSE = 0xA2, // Play / Pause KC_MEDIASTOP = 0xA4, // Media Stop - KC_TWOSUPERIOR = 0xAA, // ² on French AZERTY keyboard (same place as ~ ` on QWERTY) - KC_VOLUMEDOWN = 0xAE, // Volume - + KC_TWOSUPERIOR = 0xAA, // ² on French AZERTY keyboard (same place as ~ ` on QWERTY) + KC_VOLUMEDOWN = 0xAE, // Volume - KC_VOLUMEUP = 0xB0, // Volume + KC_WEBHOME = 0xB2, // Web home - KC_NUMPADCOMMA = 0xB3, // , on numeric keypad (NEC PC98) + KC_NUMPADCOMMA = 0xB3, // , on numeric keypad (NEC PC98) KC_DIVIDE = 0xB5, // / on numeric keypad KC_SYSRQ = 0xB7, KC_RMENU = 0xB8, // right Alt @@ -171,13 +171,13 @@ namespace OIS KC_WAKE = 0xE3, // System Wake KC_WEBSEARCH = 0xE5, // Web Search KC_WEBFAVORITES = 0xE6, // Web Favorites - KC_WEBREFRESH = 0xE7, // Web Refresh + KC_WEBREFRESH = 0xE7, // Web Refresh KC_WEBSTOP = 0xE8, // Web Stop - KC_WEBFORWARD = 0xE9, // Web Forward + KC_WEBFORWARD = 0xE9, // Web Forward KC_WEBBACK = 0xEA, // Web Back - KC_MYCOMPUTER = 0xEB, // My Computer + KC_MYCOMPUTER = 0xEB, // My Computer KC_MAIL = 0xEC, // Mail - KC_MEDIASELECT = 0xED, // Media Select + KC_MEDIASELECT = 0xED, // Media Select }; /** @@ -187,8 +187,8 @@ namespace OIS { public: KeyEvent(Object* obj, KeyCode kc, unsigned int txt) : - EventArg(obj), key(kc), text(txt) {} - virtual ~KeyEvent() {} + EventArg(obj), key(kc), text(txt) { } + virtual ~KeyEvent() { } //! KeyCode of event KeyCode key; @@ -203,7 +203,7 @@ namespace OIS class _OISExport KeyListener { public: - virtual ~KeyListener() {} + virtual ~KeyListener() { } virtual bool keyPressed(const KeyEvent& arg) = 0; virtual bool keyReleased(const KeyEvent& arg) = 0; }; @@ -215,7 +215,7 @@ namespace OIS class _OISExport Keyboard : public Object { public: - virtual ~Keyboard(){}; + virtual ~Keyboard() {}; /** @remarks @@ -284,12 +284,12 @@ namespace OIS Ctrl = 0x0000010, LCtrl = 0x0000020, RCtrl = 0x0000040, - Alt = 0x0000100, + Alt = 0x0000100, LAlt = 0x0000200, RAlt = 0x0000400, CapsLock = 0x0001000, - NumLock = 0x0010000, - Win = 0x0100000, + NumLock = 0x0010000, + Win = 0x0100000, LWin = 0x0200000, RWin = 0x0400000 }; @@ -311,7 +311,7 @@ namespace OIS Check modifier status */ bool isModifierDown(Modifier mod) const; - + /** @remarks Returns the full modifiers status bit field @@ -328,7 +328,7 @@ namespace OIS protected: Keyboard(const std::string& vendor, bool buffered, int devID, InputManager* creator) : Object(vendor, OISKeyboard, buffered, devID, creator), - mModifiers(0), mListener(0), mTextMode(Unicode) {} + mModifiers(0), mListener(0), mTextMode(Unicode) { } //! Bit field that holds status of Alt, Ctrl, Shift, Win, CapsLock, and NumLock as well as Left and Right variants unsigned int mModifiers; diff --git a/includes/OISMouse.h b/includes/OISMouse.h index 8de4cf4..2063dcc 100644 --- a/includes/OISMouse.h +++ b/includes/OISMouse.h @@ -50,7 +50,7 @@ namespace OIS { public: MouseState() : - width(50), height(50), buttons(0){}; + width(50), height(50), buttons(0) {}; /** Represents the height/width of your display area.. used if mouse clipping or mouse grabbed in case of X11 - defaults to 50.. Make sure to set this @@ -90,8 +90,8 @@ namespace OIS { public: MouseEvent(Object* obj, const MouseState& ms) : - EventArg(obj), state(ms) {} - virtual ~MouseEvent() {} + EventArg(obj), state(ms) { } + virtual ~MouseEvent() { } //! The state of the mouse - including buttons and axes const MouseState& state; @@ -109,9 +109,9 @@ namespace OIS class _OISExport MouseListener { public: - virtual ~MouseListener() {} + virtual ~MouseListener() { } virtual bool mouseMoved(const MouseEvent& arg) = 0; - virtual bool mousePressed(const MouseEvent& arg, MouseButtonID id) = 0; + virtual bool mousePressed(const MouseEvent& arg, MouseButtonID id) = 0; virtual bool mouseReleased(const MouseEvent& arg, MouseButtonID id) = 0; }; @@ -122,7 +122,7 @@ namespace OIS class _OISExport Mouse : public Object { public: - virtual ~Mouse() {} + virtual ~Mouse() { } /** @remarks @@ -141,7 +141,7 @@ namespace OIS protected: Mouse(const std::string& vendor, bool buffered, int devID, InputManager* creator) : - Object(vendor, OISMouse, buffered, devID, creator), mListener(0) {} + Object(vendor, OISMouse, buffered, devID, creator), mListener(0) { } //! The state of the mouse MouseState mState; diff --git a/includes/OISMultiTouch.h b/includes/OISMultiTouch.h index 233f168..e2db5d6 100644 --- a/includes/OISMultiTouch.h +++ b/includes/OISMultiTouch.h @@ -53,7 +53,7 @@ namespace OIS { public: MultiTouchState() : - width(50), height(50), touchType(MT_None){}; + width(50), height(50), touchType(MT_None) {}; /** Represents the height/width of your display area.. used if touch clipping or touch grabbed in case of X11 - defaults to 50.. Make sure to set this @@ -91,8 +91,8 @@ namespace OIS { public: MultiTouchEvent(Object* obj, const MultiTouchState& ms) : - EventArg(obj), state(ms) {} - virtual ~MultiTouchEvent() {} + EventArg(obj), state(ms) { } + virtual ~MultiTouchEvent() { } //! The state of the touch - including axes const MultiTouchState& state; @@ -105,10 +105,10 @@ namespace OIS class _OISExport MultiTouchListener { public: - virtual ~MultiTouchListener() {} + virtual ~MultiTouchListener() { } virtual bool touchMoved(const MultiTouchEvent& arg) = 0; - virtual bool touchPressed(const MultiTouchEvent& arg) = 0; - virtual bool touchReleased(const MultiTouchEvent& arg) = 0; + virtual bool touchPressed(const MultiTouchEvent& arg) = 0; + virtual bool touchReleased(const MultiTouchEvent& arg) = 0; virtual bool touchCancelled(const MultiTouchEvent& arg) = 0; }; @@ -119,7 +119,7 @@ namespace OIS class _OISExport MultiTouch : public Object { public: - virtual ~MultiTouch() {} + virtual ~MultiTouch() { } /** @remarks @@ -171,7 +171,7 @@ namespace OIS protected: MultiTouch(const std::string& vendor, bool buffered, int devID, InputManager* creator) : - Object(vendor, OISMultiTouch, buffered, devID, creator), mListener(0) {} + Object(vendor, OISMultiTouch, buffered, devID, creator), mListener(0) { } //! The state of the touch device, implemented in a vector to store the state from each finger touch std::vector mStates; diff --git a/includes/OISObject.h b/includes/OISObject.h index 0d2daf1..d9bcb65 100644 --- a/includes/OISObject.h +++ b/includes/OISObject.h @@ -35,7 +35,7 @@ namespace OIS class _OISExport Object { public: - virtual ~Object() {} + virtual ~Object() { } /** @remarks Get the type of device */ Type type() const { return mType; } @@ -76,7 +76,7 @@ namespace OIS mType(iType), mBuffered(buffered), mDevID(devID), - mCreator(creator) {} + mCreator(creator) { } //! Vendor name if applicable/known std::string mVendor; diff --git a/includes/SDL/SDLKeyboard.h b/includes/SDL/SDLKeyboard.h index b6dd625..6c9922a 100644 --- a/includes/SDL/SDLKeyboard.h +++ b/includes/SDL/SDLKeyboard.h @@ -68,7 +68,7 @@ namespace OIS virtual void setTextTranslation(TextTranslationMode mode); protected: - SDLKeyboard() {} + SDLKeyboard() { } typedef std::map KeyMap; KeyMap mKeyMap; diff --git a/includes/SDL/SDLMouse.h b/includes/SDL/SDLMouse.h index faa77c8..3be0e87 100644 --- a/includes/SDL/SDLMouse.h +++ b/includes/SDL/SDLMouse.h @@ -53,7 +53,7 @@ namespace OIS void _setVisible(bool visible); protected: - SDLMouse() {} + SDLMouse() { } bool mGrabbed; bool mRegainFocus; diff --git a/includes/iphone/iPhoneHelpers.h b/includes/iphone/iPhoneHelpers.h index 8bb1349..1180e7d 100644 --- a/includes/iphone/iPhoneHelpers.h +++ b/includes/iphone/iPhoneHelpers.h @@ -49,7 +49,7 @@ namespace OIS private: iPhoneMultiTouchStackEvent(MultiTouchEvent event, iPhoneEventType type) : - Event(event), Type(type) {} + Event(event), Type(type) { } iPhoneEventType Type; MultiTouchEvent Event; diff --git a/includes/linux/LinuxKeyboard.h b/includes/linux/LinuxKeyboard.h index 0e4d12b..c5dee00 100644 --- a/includes/linux/LinuxKeyboard.h +++ b/includes/linux/LinuxKeyboard.h @@ -97,7 +97,7 @@ namespace OIS const auto result = keyConversionToOIS.find(keySym); if(result != keyConversionToOIS.end()) return result->second; - + ::KeyCode xkc = XKeysymToKeycode(display, keySym); if(xkc > 8) return static_cast(xkc - 8); @@ -109,12 +109,12 @@ namespace OIS { if(kc == KC_UNASSIGNED) return NoSymbol; - + //Check for explicit convert const auto result = keyConversionFromOIS.find(kc); if(result != keyConversionFromOIS.end()) return result->second; - + ::KeyCode xkc = kc + 8; return XkbKeycodeToKeysym(display, xkc, 0, 0); } @@ -122,10 +122,10 @@ namespace OIS //! Explict convertion for non-text symbols typedef std::unordered_map XtoOIS_KeyMap; XtoOIS_KeyMap keyConversionToOIS; - + typedef std::unordered_map> OIStoX_KeyMap; OIStoX_KeyMap keyConversionFromOIS; - + void addKeyConversion(KeySym x_key, KeyCode ois_key); //! Depressed Key List diff --git a/includes/linux/LinuxMouse.h b/includes/linux/LinuxMouse.h index 8e46755..c5466a0 100644 --- a/includes/linux/LinuxMouse.h +++ b/includes/linux/LinuxMouse.h @@ -65,9 +65,9 @@ namespace OIS //Since X11 provides us with absolute values, we need to keep track of relative values long oldXMouseX, oldXMouseY, oldXMouseZ; - Window window; //The X Window + Window window; //The X Window Display* display; //The X display - Cursor cursor; //A blank cursor + Cursor cursor; //A blank cursor bool grabMouse; //Are we grabbing the mouse to the window? bool hideMouse; //Are we hiding OS mouse? diff --git a/includes/linux/LinuxPrereqs.h b/includes/linux/LinuxPrereqs.h index 2ea4713..ccf7203 100644 --- a/includes/linux/LinuxPrereqs.h +++ b/includes/linux/LinuxPrereqs.h @@ -48,9 +48,9 @@ namespace OIS class Range { public: - Range(){}; + Range() {}; Range(int _min, int _max) : - min(_min), max(_max){}; + min(_min), max(_max) {}; int min, max; }; @@ -58,7 +58,7 @@ namespace OIS { public: JoyStickInfo() : - devId(-1), joyFileD(-1), version(0), axes(0), buttons(0), hats(0) {} + devId(-1), joyFileD(-1), version(0), axes(0), buttons(0), hats(0) { } //! Device number (/dev/input/j#) or /dev/input/event# int devId; //! File descriptor diff --git a/includes/mac/CocoaHelpers.h b/includes/mac/CocoaHelpers.h index 6c326eb..14a5dfa 100644 --- a/includes/mac/CocoaHelpers.h +++ b/includes/mac/CocoaHelpers.h @@ -36,7 +36,7 @@ namespace OIS { // used in the eventStack to store the type - enum Mac_EventType { MAC_KEYUP = 0, + enum Mac_EventType { MAC_KEYUP = 0, MAC_KEYDOWN = 1, MAC_KEYREPEAT, MAC_MOUSEDOWN, diff --git a/includes/mac/CocoaJoyStick.h b/includes/mac/CocoaJoyStick.h index d880512..712468b 100644 --- a/includes/mac/CocoaJoyStick.h +++ b/includes/mac/CocoaJoyStick.h @@ -37,7 +37,7 @@ namespace OIS int max; AxisInfo(int min, int max) : - min(min), max(max) {} + min(min), max(max) { } }; typedef struct cookie_struct diff --git a/includes/mac/CocoaKeyboard.h b/includes/mac/CocoaKeyboard.h index b844e00..5220335 100644 --- a/includes/mac/CocoaKeyboard.h +++ b/includes/mac/CocoaKeyboard.h @@ -46,7 +46,7 @@ namespace OIS public: Cocoa_KeyStackEvent(KeyEvent event, MacEventType type) : - Event(event), Type(type) {} + Event(event), Type(type) { } const MacEventType type() { return Type; } const KeyEvent event() { return Event; } diff --git a/includes/mac/MacHelpers.h b/includes/mac/MacHelpers.h index 8923b39..cb5f216 100644 --- a/includes/mac/MacHelpers.h +++ b/includes/mac/MacHelpers.h @@ -51,7 +51,7 @@ namespace OIS { // used in the eventStack to store the type - enum Mac_EventType { MAC_KEYUP = 0, + enum Mac_EventType { MAC_KEYUP = 0, MAC_KEYDOWN = 1, MAC_KEYREPEAT, MAC_MOUSEDOWN, @@ -67,7 +67,7 @@ namespace OIS private: Mac_KeyStackEvent(KeyEvent event, MacEventType type) : - Event(event), Type(type) {} + Event(event), Type(type) { } MacEventType Type; KeyEvent Event; diff --git a/includes/mac/MacJoyStick.h b/includes/mac/MacJoyStick.h index 9a7dd6e..503f8f5 100644 --- a/includes/mac/MacJoyStick.h +++ b/includes/mac/MacJoyStick.h @@ -37,7 +37,7 @@ namespace OIS int max; AxisInfo(int min, int max) : - min(min), max(max) {} + min(min), max(max) { } }; typedef struct cookie_struct diff --git a/includes/win32/Win32ForceFeedback.h b/includes/win32/Win32ForceFeedback.h index 3c7eec3..7c4168a 100644 --- a/includes/win32/Win32ForceFeedback.h +++ b/includes/win32/Win32ForceFeedback.h @@ -34,7 +34,7 @@ namespace OIS { class Win32ForceFeedback : public ForceFeedback { - Win32ForceFeedback() {} + Win32ForceFeedback() { } public: Win32ForceFeedback(IDirectInputDevice8* pDIJoy, const DIDEVCAPS* pDIJoyCaps); diff --git a/src/SDL/SDLKeyboard.cpp b/src/SDL/SDLKeyboard.cpp index 92af690..b051fcf 100644 --- a/src/SDL/SDLKeyboard.cpp +++ b/src/SDL/SDLKeyboard.cpp @@ -35,7 +35,7 @@ using namespace OIS; SDLKeyboard::SDLKeyboard(bool buffered) { mBuffered = buffered; - mType = OISKeyboard; + mType = OISKeyboard; listener = 0; //Clear our keyboard state buffer @@ -168,7 +168,7 @@ void SDLKeyboard::capture() for(int i = 0; i < count; ++i) { - KeyCode kc = mKeyMap[events[i].key.keysym.sym]; + KeyCode kc = mKeyMap[events[i].key.keysym.sym]; KeyBuffer[kc] = events[i].key.state; if(mBuffered && listener) diff --git a/src/SDL/SDLMouse.cpp b/src/SDL/SDLMouse.cpp index 0a8826e..0448129 100644 --- a/src/SDL/SDLMouse.cpp +++ b/src/SDL/SDLMouse.cpp @@ -35,7 +35,7 @@ SDLMouse::SDLMouse(bool buffered) : mGrabbed(false), mRegainFocus(false) { mBuffered = buffered; - mType = OISMouse; + mType = OISMouse; listener = 0; } @@ -79,8 +79,7 @@ void SDLMouse::capture() switch(events[i].type) { case SDL_MOUSEMOTION: mouseXYMoved = true; break; - case SDL_MOUSEBUTTONDOWN: - { + case SDL_MOUSEBUTTONDOWN: { mRegainFocus = true; int sdlButton = events[i].button.button; if(sdlButton <= SDL_BUTTON_RIGHT) @@ -100,8 +99,7 @@ void SDLMouse::capture() } break; } - case SDL_MOUSEBUTTONUP: - { + case SDL_MOUSEBUTTONUP: { int sdlButton = events[i].button.button; if(sdlButton <= SDL_BUTTON_RIGHT) { //Left, Right, or Middle diff --git a/src/extras/LIRC/OISLIRC.h b/src/extras/LIRC/OISLIRC.h index 570536a..dc9facf 100644 --- a/src/extras/LIRC/OISLIRC.h +++ b/src/extras/LIRC/OISLIRC.h @@ -37,11 +37,11 @@ namespace OIS struct RemoteInfo { RemoteInfo() : - buttons(0) {} + buttons(0) { } RemoteInfo(const RemoteInfo& other) { - buttons = other.buttons; + buttons = other.buttons; buttonMap = other.buttonMap; } diff --git a/src/extras/LIRC/OISLIRCFactoryCreator.cpp b/src/extras/LIRC/OISLIRCFactoryCreator.cpp index 68f8f15..6b16dba 100644 --- a/src/extras/LIRC/OISLIRCFactoryCreator.cpp +++ b/src/extras/LIRC/OISLIRCFactoryCreator.cpp @@ -76,7 +76,7 @@ LIRCFactoryCreator::LIRCFactoryCreator() : { mWrapped = new BoostWrapper(); - mIP = (getenv("OIS_LIRC_IP") != 0) ? getenv("OIS_LIRC_IP") : "127.0.0.1"; + mIP = (getenv("OIS_LIRC_IP") != 0) ? getenv("OIS_LIRC_IP") : "127.0.0.1"; mPort = (getenv("OIS_LIRC_PORT") != 0) ? getenv("OIS_LIRC_PORT") : "8765"; try @@ -266,7 +266,7 @@ void LIRCFactoryCreator::threadUpdate() { boost::asio::read_until(mWrapped->mSocket, buffer, '\n'); - stream >> code; //64 bit value, ignorable + stream >> code; //64 bit value, ignorable stream >> repeat; //Repeat rate starting at zero (we ignore, for now) stream >> button; //Button name stream >> remote; //Remote name diff --git a/src/extras/LIRC/OISLIRCRingBuffer.h b/src/extras/LIRC/OISLIRCRingBuffer.h index 8c46c8d..84b639d 100644 --- a/src/extras/LIRC/OISLIRCRingBuffer.h +++ b/src/extras/LIRC/OISLIRCRingBuffer.h @@ -99,11 +99,11 @@ namespace OIS //2 bytes per short bufferSize = (int)numEntries; - buffer = new LIRCEvent[numEntries]; + buffer = new LIRCEvent[numEntries]; Flush(); - bigMask = (int)(numEntries * 2) - 1; + bigMask = (int)(numEntries * 2) - 1; smallMask = (int)(numEntries)-1; } diff --git a/src/linux/EventHelpers.cpp b/src/linux/EventHelpers.cpp index 1a1b627..dc374b6 100644 --- a/src/linux/EventHelpers.cpp +++ b/src/linux/EventHelpers.cpp @@ -196,8 +196,8 @@ bool EventUtils::isJoyStick(int deviceID, JoyStickInfo& js) if(joyButtonFound) { js.joyFileD = deviceID; - js.vendor = getName(deviceID); - js.buttons = buttons; + js.vendor = getName(deviceID); + js.buttons = buttons; js.axes = info.relAxes.size() + info.absAxes.size(); js.hats = info.hats.size(); #ifdef OIS_LINUX_JOY_DEBUG @@ -290,30 +290,30 @@ void EventUtils::enumerateForceFeedback(int deviceID, LinuxForceFeedback** ff) map typeMap; typeMap[FF_CONSTANT] = Effect::Constant; typeMap[FF_RAMP] = Effect::Ramp; - typeMap[FF_SPRING] = Effect::Spring; + typeMap[FF_SPRING] = Effect::Spring; typeMap[FF_FRICTION] = Effect::Friction; - typeMap[FF_SQUARE] = Effect::Square; + typeMap[FF_SQUARE] = Effect::Square; typeMap[FF_TRIANGLE] = Effect::Triangle; typeMap[FF_SINE] = Effect::Sine; - typeMap[FF_SAW_UP] = Effect::SawToothUp; + typeMap[FF_SAW_UP] = Effect::SawToothUp; typeMap[FF_SAW_DOWN] = Effect::SawToothDown; - typeMap[FF_DAMPER] = Effect::Damper; - typeMap[FF_INERTIA] = Effect::Inertia; - typeMap[FF_CUSTOM] = Effect::Custom; + typeMap[FF_DAMPER] = Effect::Damper; + typeMap[FF_INERTIA] = Effect::Inertia; + typeMap[FF_CUSTOM] = Effect::Custom; map forceMap; forceMap[FF_CONSTANT] = Effect::ConstantForce; - forceMap[FF_RAMP] = Effect::RampForce; - forceMap[FF_SPRING] = Effect::ConditionalForce; + forceMap[FF_RAMP] = Effect::RampForce; + forceMap[FF_SPRING] = Effect::ConditionalForce; forceMap[FF_FRICTION] = Effect::ConditionalForce; - forceMap[FF_SQUARE] = Effect::PeriodicForce; + forceMap[FF_SQUARE] = Effect::PeriodicForce; forceMap[FF_TRIANGLE] = Effect::PeriodicForce; - forceMap[FF_SINE] = Effect::PeriodicForce; - forceMap[FF_SAW_UP] = Effect::PeriodicForce; + forceMap[FF_SINE] = Effect::PeriodicForce; + forceMap[FF_SAW_UP] = Effect::PeriodicForce; forceMap[FF_SAW_DOWN] = Effect::PeriodicForce; - forceMap[FF_DAMPER] = Effect::ConditionalForce; + forceMap[FF_DAMPER] = Effect::ConditionalForce; forceMap[FF_INERTIA] = Effect::ConditionalForce; - forceMap[FF_CUSTOM] = Effect::CustomForce; + forceMap[FF_CUSTOM] = Effect::CustomForce; //Remove any previously existing memory and create fresh removeForceFeedback(ff); diff --git a/src/linux/LinuxForceFeedback.cpp b/src/linux/LinuxForceFeedback.cpp index 6a1d730..fb0673b 100644 --- a/src/linux/LinuxForceFeedback.cpp +++ b/src/linux/LinuxForceFeedback.cpp @@ -123,8 +123,8 @@ void LinuxForceFeedback::setAutoCenterMode(bool enabled) struct input_event event; memset(&event, 0, sizeof(event)); - event.type = EV_FF; - event.code = FF_AUTOCENTER; + event.type = EV_FF; + event.code = FF_AUTOCENTER; event.value = (__s32)(enabled * 0xFFFFFFFFUL); #if(OIS_LINUX_JOYFF_DEBUG > 0) @@ -234,8 +234,8 @@ void LinuxForceFeedback::_setCommonProperties(struct ff_effect* event, { ffenvelope->attack_length = LinuxDuration(envelope->attackLength); ffenvelope->attack_level = LinuxPositiveLevel(envelope->attackLevel); - ffenvelope->fade_length = LinuxDuration(envelope->fadeLength); - ffenvelope->fade_level = LinuxPositiveLevel(envelope->fadeLevel); + ffenvelope->fade_length = LinuxDuration(envelope->fadeLength); + ffenvelope->fade_level = LinuxPositiveLevel(envelope->fadeLevel); } #if(OIS_LINUX_JOYFF_DEBUG > 1) @@ -262,7 +262,7 @@ void LinuxForceFeedback::_setCommonProperties(struct ff_effect* event, #endif // TODO trigger_button 0 vs. -1 - event->trigger.button = effect->trigger_button; // < 0 ? 0 : effect->trigger_button; + event->trigger.button = effect->trigger_button; // < 0 ? 0 : effect->trigger_button; event->trigger.interval = LinuxDuration(effect->trigger_interval); #if(OIS_LINUX_JOYFF_DEBUG > 1) @@ -274,7 +274,7 @@ void LinuxForceFeedback::_setCommonProperties(struct ff_effect* event, #endif event->replay.length = LinuxDuration(effect->replay_length); - event->replay.delay = LinuxDuration(effect->replay_delay); + event->replay.delay = LinuxDuration(effect->replay_delay); #if(OIS_LINUX_JOYFF_DEBUG > 1) cout << " Replay :" << endl @@ -320,7 +320,7 @@ void LinuxForceFeedback::_updateRampEffect(const Effect* eff) event.id = -1; event.u.ramp.start_level = LinuxSignedLevel(effect->startLevel); - event.u.ramp.end_level = LinuxSignedLevel(effect->endLevel); + event.u.ramp.end_level = LinuxSignedLevel(effect->endLevel); #if(OIS_LINUX_JOYFF_DEBUG > 1) cout << " StartLevel : " << effect->startLevel @@ -370,13 +370,13 @@ void LinuxForceFeedback::_updatePeriodicEffect(const Effect* eff) break; } - event.u.periodic.period = LinuxDuration(effect->period); + event.u.periodic.period = LinuxDuration(effect->period); event.u.periodic.magnitude = LinuxPositiveLevel(effect->magnitude); - event.u.periodic.offset = LinuxPositiveLevel(effect->offset); - event.u.periodic.phase = (__u16)(effect->phase * event.u.periodic.period / 36000.0); // ????? + event.u.periodic.offset = LinuxPositiveLevel(effect->offset); + event.u.periodic.phase = (__u16)(effect->phase * event.u.periodic.period / 36000.0); // ????? // Note: No support for Custom periodic force effect for the moment - event.u.periodic.custom_len = 0; + event.u.periodic.custom_len = 0; event.u.periodic.custom_data = 0; #if(OIS_LINUX_JOYFF_DEBUG > 1) @@ -428,7 +428,7 @@ void LinuxForceFeedback::_updateConditionalEffect(const Effect* eff) event.u.condition[0].right_coeff = LinuxSignedLevel(effect->rightCoeff); event.u.condition[0].left_coeff = LinuxSignedLevel(effect->leftCoeff); event.u.condition[0].deadband = LinuxPositiveLevel(effect->deadband); // Unit ?? - event.u.condition[0].center = LinuxSignedLevel(effect->center); // Unit ?? TODO ? + event.u.condition[0].center = LinuxSignedLevel(effect->center); // Unit ?? TODO ? // TODO support for second condition event.u.condition[1] = event.u.condition[0]; diff --git a/src/linux/LinuxInputManager.cpp b/src/linux/LinuxInputManager.cpp index 6ce7b7a..896df56 100644 --- a/src/linux/LinuxInputManager.cpp +++ b/src/linux/LinuxInputManager.cpp @@ -40,9 +40,9 @@ LinuxInputManager::LinuxInputManager() : window = 0; //Default settings - grabMouse = true; + grabMouse = true; grabKeyboard = true; - hideMouse = true; + hideMouse = true; mGrabs = true; keyboardUsed = mouseUsed = false; @@ -172,22 +172,19 @@ Object* LinuxInputManager::createObject(InputManager* creator, Type iType, bool switch(iType) { - case OISKeyboard: - { + case OISKeyboard: { if(window && keyboardUsed == false) obj = new LinuxKeyboard(this, bufferMode, grabKeyboard); break; } - case OISMouse: - { + case OISMouse: { if(window && mouseUsed == false) obj = new LinuxMouse(this, bufferMode, grabMouse, hideMouse); break; } - case OISJoyStick: - { + case OISJoyStick: { for(JoyStickInfoList::iterator i = unusedJoyStickList.begin(); i != unusedJoyStickList.end(); ++i) { if(vendor == "" || i->vendor == vendor) diff --git a/src/linux/LinuxJoyStickEvents.cpp b/src/linux/LinuxJoyStickEvents.cpp index 0b5b72c..878cc6b 100644 --- a/src/linux/LinuxJoyStickEvents.cpp +++ b/src/linux/LinuxJoyStickEvents.cpp @@ -60,7 +60,7 @@ LinuxJoyStick::LinuxJoyStick(InputManager* creator, bool buffered, const JoyStic mButtonMap = js.button_map; mAxisMap = js.axis_map; - mRanges = js.axis_range; + mRanges = js.axis_range; ff_effect = 0; } @@ -226,13 +226,13 @@ JoyStickInfo LinuxJoyStick::_getJoyInfo() JoyStickInfo js; js.devId = mDevID; - js.joyFileD = mJoyStick; - js.vendor = mVendor; + js.joyFileD = mJoyStick; + js.vendor = mVendor; js.axes = (int)mState.mAxes.size(); - js.buttons = (int)mState.mButtons.size(); + js.buttons = (int)mState.mButtons.size(); js.hats = mPOVs; js.button_map = mButtonMap; - js.axis_map = mAxisMap; + js.axis_map = mAxisMap; js.axis_range = mRanges; return js; diff --git a/src/linux/LinuxKeyboard.cpp b/src/linux/LinuxKeyboard.cpp index c29f98e..03240c4 100644 --- a/src/linux/LinuxKeyboard.cpp +++ b/src/linux/LinuxKeyboard.cpp @@ -40,14 +40,13 @@ LinuxKeyboard::LinuxKeyboard(InputManager* creator, bool buffered, bool grab) : Keyboard(creator->inputSystemName(), buffered, 0, creator), xim(0), ximStyle(0), xic(0) { display = 0; - window = 0; + window = 0; grabKeyboard = grab; keyFocusLost = false; static_cast(mCreator)->_setKeyboardUsed(true); - addKeyConversion(XK_Up, KC_UP); addKeyConversion(XK_Down, KC_DOWN); addKeyConversion(XK_Left, KC_LEFT); @@ -107,7 +106,7 @@ void LinuxKeyboard::_initialize() if(display) XCloseDisplay(display); display = 0; - window = static_cast(mCreator)->_getWindow(); + window = static_cast(mCreator)->_getWindow(); //Create our local X mListener connection if(!(display = XOpenDisplay(0))) @@ -115,7 +114,7 @@ void LinuxKeyboard::_initialize() // Get modifiers masks capsLockMask = XkbKeysymToModifiers(display, XK_Caps_Lock); - numLockMask = XkbKeysymToModifiers(display, XK_Num_Lock); + numLockMask = XkbKeysymToModifiers(display, XK_Num_Lock); //Configure locale modifiers if(XSetLocaleModifiers("@im=none") == NULL) @@ -310,7 +309,7 @@ void LinuxKeyboard::_handleKeyPress(XEvent& event) Status status; do { - bytes = Xutf8LookupString(xic, &e, &buf[0], buf.size() - 1, &keySym, &status); + bytes = Xutf8LookupString(xic, &e, &buf[0], buf.size() - 1, &keySym, &status); buf[bytes] = '\0'; if(status == XBufferOverflow) @@ -319,7 +318,7 @@ void LinuxKeyboard::_handleKeyPress(XEvent& event) } else { - bytes = XLookupString(&e, &buf[0], buf.size() - 1, &keySym, NULL); + bytes = XLookupString(&e, &buf[0], buf.size() - 1, &keySym, NULL); buf[bytes] = '\0'; } diff --git a/src/linux/LinuxMouse.cpp b/src/linux/LinuxMouse.cpp index 9ef155a..01313f9 100644 --- a/src/linux/LinuxMouse.cpp +++ b/src/linux/LinuxMouse.cpp @@ -35,8 +35,8 @@ LinuxMouse::LinuxMouse(InputManager* creator, bool buffered, bool grab, bool hid Mouse(creator->inputSystemName(), buffered, 0, creator) { display = 0; - window = 0; - cursor = 0; + window = 0; + cursor = 0; grabMouse = grab; hideMouse = hide; @@ -49,7 +49,7 @@ void LinuxMouse::_initialize() { //Clear old state mState.clear(); - mMoved = false; + mMoved = false; mWarped = false; //6 is just some random value... hardly ever would anyone have a window smaller than 6 @@ -58,7 +58,7 @@ void LinuxMouse::_initialize() if(display) XCloseDisplay(display); display = 0; - window = static_cast(mCreator)->_getWindow(); + window = static_cast(mCreator)->_getWindow(); //Create our local X mListener connection if(!(display = XOpenDisplay(0))) @@ -205,7 +205,7 @@ void LinuxMouse::_processXEvents() //Keep mouse in window (fudge factor) if(event.xmotion.x < 100 || event.xmotion.x > mState.width - 100 || event.xmotion.y < 100 || event.xmotion.y > mState.height - 100) { - oldXMouseX = mState.width >> 1; //center x + oldXMouseX = mState.width >> 1; //center x oldXMouseY = mState.height >> 1; //center y XWarpPointer(display, None, window, 0, 0, 0, 0, oldXMouseX, oldXMouseY); mWarped = true; diff --git a/src/mac/MacHIDManager.cpp b/src/mac/MacHIDManager.cpp index 58f56c5..daac15f 100644 --- a/src/mac/MacHIDManager.cpp +++ b/src/mac/MacHIDManager.cpp @@ -125,7 +125,7 @@ void MacHIDManager::initialize() iterateAndOpenDevices(iterator); //Doesn't support multiple usage flags, iterate twice - usage = kHIDUsage_GD_GamePad; + usage = kHIDUsage_GD_GamePad; iterator = lookUpDevices(usage, page); if(iterator) @@ -140,7 +140,7 @@ io_iterator_t MacHIDManager::lookUpDevices(int usage, int page) OIS_EXCEPT(E_General, "Could not setup HID device search parameters"); CFNumberRef usageRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &usage); - CFNumberRef pageRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &page); + CFNumberRef pageRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &page); CFDictionarySetValue(deviceLookupMap, CFSTR(kIOHIDPrimaryUsageKey), usageRef); CFDictionarySetValue(deviceLookupMap, CFSTR(kIOHIDPrimaryUsagePageKey), pageRef); @@ -407,11 +407,10 @@ Object* MacHIDManager::createObject(InputManager* creator, Type iType, bool buff { int totalDevs = totalDevices(iType); int freeDevs = freeDevices(iType); - int devID = totalDevs - freeDevs; + int devID = totalDevs - freeDevs; switch(iType) { - case OISJoyStick: - { + case OISJoyStick: { obj = new MacJoyStick((*it)->combinedKey, bufferMode, *it, creator, devID); (*it)->inUse = true; return obj; diff --git a/src/mac/MacInputManager.cpp b/src/mac/MacInputManager.cpp index 42a5080..82442d1 100644 --- a/src/mac/MacInputManager.cpp +++ b/src/mac/MacInputManager.cpp @@ -180,20 +180,17 @@ Object* MacInputManager::createObject(InputManager* creator, Type iType, bool bu switch(iType) { - case OISKeyboard: - { + case OISKeyboard: { if(keyboardUsed == false) obj = new MacKeyboard(this, bufferMode, mUseRepeat); break; } - case OISMouse: - { + case OISMouse: { if(mouseUsed == false) obj = new MacMouse(this, bufferMode); break; } - default: - { + default: { obj = mHIDManager->createObject(creator, iType, bufferMode, vendor); break; } diff --git a/src/mac/MacJoyStick.cpp b/src/mac/MacJoyStick.cpp index a16b765..e8f0e7c 100644 --- a/src/mac/MacJoyStick.cpp +++ b/src/mac/MacJoyStick.cpp @@ -80,7 +80,7 @@ class FindAxisCookie : public std::unary_function& pair) const { return pair.first == m_Cookie; @@ -103,8 +103,7 @@ void MacJoyStick::capture() { switch(event.type) { - case kIOHIDElementTypeInput_Button: - { + case kIOHIDElementTypeInput_Button: { std::vector::iterator buttonIt = std::find(mCookies.buttonCookies.begin(), mCookies.buttonCookies.end(), event.elementCookie); int button = std::distance(mCookies.buttonCookies.begin(), buttonIt); mState.mButtons[button] = (event.value == 1); @@ -127,7 +126,7 @@ void MacJoyStick::capture() //Copied from LinuxJoyStickEvents.cpp, line 149 const AxisInfo& axisInfo = axisIt->second; float proportion = (float)(event.value - axisInfo.max) / (float)(axisInfo.min - axisInfo.max); - mState.mAxes[axis].abs = -JoyStick::MIN_AXIS - (JoyStick::MAX_AXIS * 2 * proportion); + mState.mAxes[axis].abs = -JoyStick::MIN_AXIS - (JoyStick::MAX_AXIS * 2 * proportion); if(mBuffered && mListener) mListener->axisMoved(JoyStickEvent(this, mState), axis); break; @@ -262,7 +261,7 @@ void MacJoyStick::_enumerateCookies() } mInfo->numButtons = mCookies.buttonCookies.size(); - mInfo->numAxes = mCookies.axisCookies.size(); + mInfo->numAxes = mCookies.axisCookies.size(); } else { diff --git a/src/mac/MacKeyboard.cpp b/src/mac/MacKeyboard.cpp index 107906a..30186fa 100644 --- a/src/mac/MacKeyboard.cpp +++ b/src/mac/MacKeyboard.cpp @@ -37,10 +37,10 @@ following restrictions: #include #include -const EventTypeSpec DownSpec[] = { { kEventClassKeyboard, kEventRawKeyDown }, //non - repeats +const EventTypeSpec DownSpec[] = { { kEventClassKeyboard, kEventRawKeyDown }, //non - repeats { kEventClassKeyboard, kEventRawKeyRepeat } }; //repeats -const EventTypeSpec UpSpec = { kEventClassKeyboard, kEventRawKeyUp }, - ModSpec = { kEventClassKeyboard, kEventRawKeyModifiersChanged }; +const EventTypeSpec UpSpec = { kEventClassKeyboard, kEventRawKeyUp }, + ModSpec = { kEventClassKeyboard, kEventRawKeyModifiersChanged }; const EventTypeSpec AllSpecs[] = { { kEventClassKeyboard, kEventRawKeyDown }, { kEventClassKeyboard, kEventRawKeyRepeat }, @@ -54,8 +54,8 @@ MacKeyboard::MacKeyboard(InputManager* creator, bool buffered, bool repeat) : Keyboard(creator->inputSystemName(), buffered, 0, creator) { keyDownEventRef = NULL; - keyUpEventRef = NULL; - keyModEventRef = NULL; + keyUpEventRef = NULL; + keyModEventRef = NULL; useRepeat = repeat; @@ -99,7 +99,7 @@ void MacKeyboard::_initialize() EventTargetRef event = ((MacInputManager*)mCreator)->_getEventTarget(); memset(&KeyBuffer, 0, 256); - mModifiers = 0; + mModifiers = 0; prevModMask = 0; // just in case this gets called after the first time.. better safe @@ -113,8 +113,8 @@ void MacKeyboard::_initialize() RemoveEventHandler(keyModEventRef); keyDownEventRef = NULL; - keyUpEventRef = NULL; - keyModEventRef = NULL; + keyUpEventRef = NULL; + keyModEventRef = NULL; OSStatus status; // send both elements of downspec array... second index is for repeat events @@ -274,7 +274,7 @@ void MacKeyboard::_modChangeCallback(EventRef theEvent) // find the changed bit UInt32 change = prevModMask ^ mods; MacEventType newstate = ((change & prevModMask) > 0) ? MAC_KEYUP : MAC_KEYDOWN; - unsigned int time = (int)GetEventTime(theEvent); + unsigned int time = (int)GetEventTime(theEvent); //cout << "preMask: " << hex << prevModMask << endl; //cout << "ModMask: " << hex << mods << endl; diff --git a/src/mac/MacMouse.cpp b/src/mac/MacMouse.cpp index c49306b..c00e5de 100644 --- a/src/mac/MacMouse.cpp +++ b/src/mac/MacMouse.cpp @@ -198,8 +198,7 @@ void MacMouse::_mouseCallback(EventRef theEvent) switch(kind) { case kEventMouseDragged: - case kEventMouseMoved: - { + case kEventMouseMoved: { //HIPoint location = {0.0f, 0.0f}; HIPoint delta = { 0.0f, 0.0f }; //Rect clipRect = {0.0f, 0.0f, 0.0f, 0.0f}; @@ -256,8 +255,7 @@ void MacMouse::_mouseCallback(EventRef theEvent) break; } - case kEventMouseDown: - { + case kEventMouseDown: { EventMouseButton button = 0; int mouseButton = 3; UInt32 modifiers = 0; @@ -290,8 +288,7 @@ void MacMouse::_mouseCallback(EventRef theEvent) break; } - case kEventMouseUp: - { + case kEventMouseUp: { EventMouseButton button = 0; int mouseButton = 3; UInt32 modifiers = 0; @@ -351,8 +348,7 @@ void MacMouse::_mouseCallback(EventRef theEvent) break; } - case kEventMouseWheelMoved: - { + case kEventMouseWheelMoved: { SInt32 wheelDelta = 0; EventMouseWheelAxis wheelAxis = 0; diff --git a/src/win32/Win32ForceFeedback.cpp b/src/win32/Win32ForceFeedback.cpp index 30ab5ed..d1e5412 100644 --- a/src/win32/Win32ForceFeedback.cpp +++ b/src/win32/Win32ForceFeedback.cpp @@ -206,7 +206,7 @@ void Win32ForceFeedback::_updateConstantEffect(const Effect* effect) { ConstantEffect* eff = static_cast(effect->getForceEffect()); - DWORD rgdwAxes[2] = { DIJOFS_X, DIJOFS_Y }; + DWORD rgdwAxes[2] = { DIJOFS_X, DIJOFS_Y }; LONG rglDirection[2] = { 0, 0 }; DIENVELOPE diEnvelope; DICONSTANTFORCE cf; @@ -230,7 +230,7 @@ void Win32ForceFeedback::_updateRampEffect(const Effect* effect) { RampEffect* eff = static_cast(effect->getForceEffect()); - DWORD rgdwAxes[2] = { DIJOFS_X, DIJOFS_Y }; + DWORD rgdwAxes[2] = { DIJOFS_X, DIJOFS_Y }; LONG rglDirection[2] = { 0, 0 }; DIENVELOPE diEnvelope; DIRAMPFORCE rf; @@ -238,7 +238,7 @@ void Win32ForceFeedback::_updateRampEffect(const Effect* effect) //Currently only support 1 axis rf.lStart = eff->startLevel; - rf.lEnd = eff->endLevel; + rf.lEnd = eff->endLevel; _setCommonProperties(&diEffect, rgdwAxes, rglDirection, &diEnvelope, sizeof(DIRAMPFORCE), &rf, effect, &eff->envelope); _upload(GUID_RampForce, &diEffect, effect); @@ -249,7 +249,7 @@ void Win32ForceFeedback::_updatePeriodicEffect(const Effect* effect) { PeriodicEffect* eff = static_cast(effect->getForceEffect()); - DWORD rgdwAxes[2] = { DIJOFS_X, DIJOFS_Y }; + DWORD rgdwAxes[2] = { DIJOFS_X, DIJOFS_Y }; LONG rglDirection[2] = { 0, 0 }; DIENVELOPE diEnvelope; DIPERIODIC pf; @@ -257,9 +257,9 @@ void Win32ForceFeedback::_updatePeriodicEffect(const Effect* effect) //Currently only support 1 axis pf.dwMagnitude = eff->magnitude; - pf.lOffset = eff->offset; - pf.dwPhase = eff->phase; - pf.dwPeriod = eff->period; + pf.lOffset = eff->offset; + pf.dwPhase = eff->phase; + pf.dwPeriod = eff->period; _setCommonProperties(&diEffect, rgdwAxes, rglDirection, &diEnvelope, sizeof(DIPERIODIC), &pf, effect, &eff->envelope); @@ -279,7 +279,7 @@ void Win32ForceFeedback::_updateConditionalEffect(const Effect* effect) { ConditionalEffect* eff = static_cast(effect->getForceEffect()); - DWORD rgdwAxes[2] = { DIJOFS_X, DIJOFS_Y }; + DWORD rgdwAxes[2] = { DIJOFS_X, DIJOFS_Y }; LONG rglDirection[2] = { 0, 0 }; DIENVELOPE diEnvelope; DICONDITION cf; @@ -343,7 +343,7 @@ void Win32ForceFeedback::_setCommonProperties( << " => " << diEffect->dwTriggerRepeatInterval << endl; #endif - diEffect->cAxes = 1; // effect->getNumAxes(); + diEffect->cAxes = 1; // effect->getNumAxes(); diEffect->rgdwAxes = rgdwAxes; diEffect->rglDirection = rglDirection; // TODO: conversion from effect->direction @@ -361,8 +361,8 @@ void Win32ForceFeedback::_setCommonProperties( diEnvelope->dwSize = sizeof(DIENVELOPE); diEnvelope->dwAttackLevel = envelope->attackLevel; diEnvelope->dwAttackTime = envelope->attackLength; - diEnvelope->dwFadeLevel = envelope->fadeLevel; - diEnvelope->dwFadeTime = envelope->fadeLength; + diEnvelope->dwFadeLevel = envelope->fadeLevel; + diEnvelope->dwFadeTime = envelope->fadeLength; diEffect->lpEnvelope = diEnvelope; } else @@ -385,7 +385,7 @@ void Win32ForceFeedback::_setCommonProperties( diEffect->dwSamplePeriod = 0; diEffect->dwDuration = effect->replay_length; - diEffect->dwStartDelay = effect->replay_delay; + diEffect->dwStartDelay = effect->replay_delay; #if(OIS_WIN32_JOYFF_DEBUG > 1) cout << " Replay :" << endl @@ -395,7 +395,7 @@ void Win32ForceFeedback::_setCommonProperties( << " => " << diEffect->dwStartDelay << endl; #endif - diEffect->cbTypeSpecificParams = struct_size; + diEffect->cbTypeSpecificParams = struct_size; diEffect->lpvTypeSpecificParams = struct_type; } diff --git a/src/win32/Win32InputManager.cpp b/src/win32/Win32InputManager.cpp index f459064..7b67dfe 100644 --- a/src/win32/Win32InputManager.cpp +++ b/src/win32/Win32InputManager.cpp @@ -38,11 +38,11 @@ Win32InputManager::Win32InputManager() : hWnd = nullptr; mDirectInput = nullptr; - kbSettings = 0; + kbSettings = 0; mouseSettings = 0; - joySettings = 0; + joySettings = 0; - joySticks = 0; + joySticks = 0; keyboardUsed = mouseUsed = false; //Setup our internal factories @@ -97,13 +97,13 @@ void Win32InputManager::_parseConfigSettings(ParamList& paramList) //Here we pick up settings such as a device's cooperation mode std::map temp; temp["DISCL_BACKGROUND"] = DISCL_BACKGROUND; - temp["DISCL_EXCLUSIVE"] = DISCL_EXCLUSIVE; + temp["DISCL_EXCLUSIVE"] = DISCL_EXCLUSIVE; temp["DISCL_FOREGROUND"] = DISCL_FOREGROUND; temp["DISCL_NONEXCLUSIVE"] = DISCL_NONEXCLUSIVE; - temp["DISCL_NOWINKEY"] = DISCL_NOWINKEY; + temp["DISCL_NOWINKEY"] = DISCL_NOWINKEY; //Check for pairs: ie. ("w32_keyboard","DISCL_NOWINKEY")("w32_keyboard","DISCL_FOREGROUND") - ParamList::iterator i = paramList.begin(); + ParamList::iterator i = paramList.begin(); const ParamList::iterator e = paramList.end(); for(; i != e; ++i) { @@ -148,10 +148,10 @@ BOOL CALLBACK Win32InputManager::_DIEnumDevCallback(LPCDIDEVICEINSTANCE lpddi, L if(GET_DIDEVICE_TYPE(lpddi->dwDevType) == DI8DEVTYPE_JOYSTICK || GET_DIDEVICE_TYPE(lpddi->dwDevType) == DI8DEVTYPE_GAMEPAD || GET_DIDEVICE_TYPE(lpddi->dwDevType) == DI8DEVTYPE_1STPERSON || GET_DIDEVICE_TYPE(lpddi->dwDevType) == DI8DEVTYPE_DRIVING || GET_DIDEVICE_TYPE(lpddi->dwDevType) == DI8DEVTYPE_FLIGHT || GET_DIDEVICE_TYPE(lpddi->dwDevType) == DI8DEVTYPE_SUPPLEMENTAL) { JoyStickInfo jsInfo; - jsInfo.isXInput = false; + jsInfo.isXInput = false; jsInfo.productGuid = lpddi->guidProduct; - jsInfo.deviceID = lpddi->guidInstance; - jsInfo.vendor = lpddi->tszInstanceName; + jsInfo.deviceID = lpddi->guidInstance; + jsInfo.vendor = lpddi->tszInstanceName; jsInfo.devId = _this_->joySticks; _this_->joySticks++; @@ -235,20 +235,17 @@ Object* Win32InputManager::createObject(InputManager* creator, Type iType, bool switch(iType) { - case OISKeyboard: - { + case OISKeyboard: { if(!keyboardUsed) obj = new Win32Keyboard(this, mDirectInput, bufferMode, kbSettings); break; } - case OISMouse: - { + case OISMouse: { if(!mouseUsed) obj = new Win32Mouse(this, mDirectInput, bufferMode, mouseSettings); break; } - case OISJoyStick: - { + case OISJoyStick: { for(JoyStickInfoList::iterator i = unusedJoyStickList.begin(); i != unusedJoyStickList.end(); ++i) { if(vendor.empty() || i->vendor == vendor) diff --git a/src/win32/Win32JoyStick.cpp b/src/win32/Win32JoyStick.cpp index 06e5ced..8e2c1b1 100644 --- a/src/win32/Win32JoyStick.cpp +++ b/src/win32/Win32JoyStick.cpp @@ -66,14 +66,14 @@ using namespace OIS; //--------------------------------------------------------------------------------------------------// Win32JoyStick::Win32JoyStick(InputManager* creator, IDirectInput8* pDI, bool buffered, DWORD coopSettings, const JoyStickInfo& info) : - JoyStick(info.vendor, buffered, info.devId, creator), - mDirectInput(pDI), - mJoyStick(nullptr), - mDIJoyCaps(), - coopSetting(coopSettings), - mJoyInfo(info), - mFfDevice(nullptr), - _AxisNumber(0) + JoyStick(info.vendor, buffered, info.devId, creator), + mDirectInput(pDI), + mJoyStick(nullptr), + mDIJoyCaps(), + coopSetting(coopSettings), + mJoyInfo(info), + mFfDevice(nullptr), + _AxisNumber(0) { } @@ -285,7 +285,7 @@ void Win32JoyStick::capture() return; } - bool axisMoved[24] = { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; + bool axisMoved[24] = { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; bool sliderMoved[4] = { false, false, false, false }; //Loop through all the events @@ -360,18 +360,18 @@ void Win32JoyStick::capture() if(axis >= 0 && axis < (int)mState.mAxes.size()) { - if (!axisMoved[axis]) + if(!axisMoved[axis]) mState.mAxes[axis].rel = 0; mState.mAxes[axis].rel += (int)diBuff[i].dwData - mState.mAxes[axis].abs; mState.mAxes[axis].absOnly = false; - mState.mAxes[axis].abs = diBuff[i].dwData; - axisMoved[axis] = true; + mState.mAxes[axis].abs = diBuff[i].dwData; + axisMoved[axis] = true; } } break; } //end case - } //end for + } //end for //Check to see if any of the axes values have changed.. if so send events if(mBuffered && mListener && entries > 0) @@ -574,8 +574,8 @@ void Win32JoyStick::CheckXInputDevices(JoyStickInfoList& joys) { IWbemLocator* pIWbemLocator = nullptr; IEnumWbemClassObject* pEnumDevices = nullptr; - IWbemClassObject* pDevices[20] = { nullptr }; - IWbemServices* pIWbemServices = nullptr; + IWbemClassObject* pDevices[20] = { nullptr }; + IWbemServices* pIWbemServices = nullptr; BSTR bstrNamespace = nullptr; BSTR bstrDeviceID = nullptr; BSTR bstrClassName = nullptr; @@ -658,7 +658,7 @@ void Win32JoyStick::CheckXInputDevices(JoyStickInfoList& joys) { if(!i->isXInput && dwVidPid == i->productGuid.Data1) { - i->isXInput = true; + i->isXInput = true; i->xInputDev = xDevice; ++xDevice; } diff --git a/src/win32/Win32KeyBoard.cpp b/src/win32/Win32KeyBoard.cpp index da8fdf2..ac2ef2e 100644 --- a/src/win32/Win32KeyBoard.cpp +++ b/src/win32/Win32KeyBoard.cpp @@ -35,9 +35,9 @@ using namespace OIS; Win32Keyboard::Win32Keyboard(InputManager* creator, IDirectInput8* pDI, bool buffered, DWORD coopSettings) : Keyboard(creator->inputSystemName(), buffered, 0, creator) { - mKeyboard = nullptr; + mKeyboard = nullptr; mDirectInput = pDI; - coopSetting = coopSettings; + coopSetting = coopSettings; //Clear our keyboard state buffer memset(&KeyBuffer, 0, 256); @@ -49,7 +49,7 @@ Win32Keyboard::Win32Keyboard(InputManager* creator, IDirectInput8* pDI, bool buf void Win32Keyboard::_initialize() { mModifiers = 0; - deadKey = '\0'; + deadKey = '\0'; if(FAILED(mDirectInput->CreateDevice(GUID_SysKeyboard, &mKeyboard, NULL))) OIS_EXCEPT(E_General, "Win32Keyboard::Win32Keyboard >> Could not init device!"); @@ -140,47 +140,51 @@ void Win32Keyboard::_readBuffered() if(diBuff[i].dwData & 0x80) { //Turn on modifier - if(kc == KC_LCONTROL || kc == KC_RCONTROL) { + if(kc == KC_LCONTROL || kc == KC_RCONTROL) + { mModifiers |= Ctrl; - if (kc == KC_LCONTROL) + if(kc == KC_LCONTROL) mModifiers |= LCtrl; - else if (kc == KC_RCONTROL) + else if(kc == KC_RCONTROL) mModifiers |= RCtrl; } - else if(kc == KC_LSHIFT || kc == KC_RSHIFT) { + else if(kc == KC_LSHIFT || kc == KC_RSHIFT) + { mModifiers |= Shift; - if (kc == KC_LSHIFT) + if(kc == KC_LSHIFT) mModifiers |= LShift; - else if (kc == KC_RSHIFT) + else if(kc == KC_RSHIFT) mModifiers |= RShift; } - else if(kc == KC_LMENU || kc == KC_RMENU) { + else if(kc == KC_LMENU || kc == KC_RMENU) + { mModifiers |= Alt; - if (kc == KC_LMENU) + if(kc == KC_LMENU) mModifiers |= LAlt; - else if (kc == KC_RMENU) + else if(kc == KC_RMENU) mModifiers |= RAlt; } - else if(kc == KC_LWIN || kc == KC_RWIN) { + else if(kc == KC_LWIN || kc == KC_RWIN) + { mModifiers |= Win; - if (kc == KC_LWIN) + if(kc == KC_LWIN) mModifiers |= LWin; - else if (kc == KC_RWIN) + else if(kc == KC_RWIN) mModifiers |= RWin; } //These ones are toggled when - else if (kc == KC_NUMLOCK) + else if(kc == KC_NUMLOCK) { - if (mModifiers & NumLock) + if(mModifiers & NumLock) mModifiers &= ~NumLock; else mModifiers |= NumLock; } - else if (kc == KC_CAPITAL) + else if(kc == KC_CAPITAL) { - if (mModifiers & CapsLock) + if(mModifiers & CapsLock) mModifiers &= ~CapsLock; else mModifiers |= CapsLock; @@ -192,40 +196,44 @@ void Win32Keyboard::_readBuffered() else { //Turn off modifier - if(kc == KC_LCONTROL || kc == KC_RCONTROL) { - if (kc == KC_LCONTROL) + if(kc == KC_LCONTROL || kc == KC_RCONTROL) + { + if(kc == KC_LCONTROL) mModifiers &= ~LCtrl; - else if (kc == KC_RCONTROL) + else if(kc == KC_RCONTROL) mModifiers &= ~RCtrl; //Only disable combined modifier if both L/R are disabled - if (!(mModifiers & LCtrl) && !(mModifiers & RCtrl)) + if(!(mModifiers & LCtrl) && !(mModifiers & RCtrl)) mModifiers &= ~Ctrl; } - else if(kc == KC_LSHIFT || kc == KC_RSHIFT) { - if (kc == KC_LSHIFT) + else if(kc == KC_LSHIFT || kc == KC_RSHIFT) + { + if(kc == KC_LSHIFT) mModifiers &= ~LShift; - else if (kc == KC_RSHIFT) + else if(kc == KC_RSHIFT) mModifiers &= ~RShift; //Only disable combined modifier if both L/R are disabled - if (!(mModifiers & LShift) && !(mModifiers & RShift)) + if(!(mModifiers & LShift) && !(mModifiers & RShift)) mModifiers &= ~Shift; } - else if(kc == KC_LMENU || kc == KC_RMENU) { - if (kc == KC_LMENU) + else if(kc == KC_LMENU || kc == KC_RMENU) + { + if(kc == KC_LMENU) mModifiers &= ~LAlt; - else if (kc == KC_RMENU) + else if(kc == KC_RMENU) mModifiers &= ~RAlt; //Only disable combined modifier if both L/R are disabled - if (!(mModifiers & LAlt) && !(mModifiers & RAlt)) + if(!(mModifiers & LAlt) && !(mModifiers & RAlt)) mModifiers &= ~Alt; } - else if(kc == KC_LWIN || kc == KC_RWIN) { - if (kc == KC_LWIN) + else if(kc == KC_LWIN || kc == KC_RWIN) + { + if(kc == KC_LWIN) mModifiers &= ~LWin; - else if (kc == KC_RWIN) + else if(kc == KC_RWIN) mModifiers &= ~RWin; //Only disable combined modifier if both L/R are disabled - if (!(mModifiers & LWin) && !(mModifiers & RWin)) + if(!(mModifiers & LWin) && !(mModifiers & RWin)) mModifiers &= ~Win; } @@ -332,7 +340,7 @@ int Win32Keyboard::_translateText(KeyCode kc) return 0; WCHAR buff[3] = { 0 }; - int ascii = ToUnicodeEx(vk, kc, keyState, buff, 3, 0, layout); + int ascii = ToUnicodeEx(vk, kc, keyState, buff, 3, 0, layout); if(ascii == 1 && deadKey != '\0') { diff --git a/src/win32/Win32Mouse.cpp b/src/win32/Win32Mouse.cpp index d00da63..322e328 100644 --- a/src/win32/Win32Mouse.cpp +++ b/src/win32/Win32Mouse.cpp @@ -36,7 +36,7 @@ Win32Mouse::Win32Mouse(InputManager* creator, IDirectInput8* pDI, bool buffered, { mMouse = nullptr; mDirectInput = pDI; - coopSetting = coopSettings; + coopSetting = coopSettings; mHwnd = nullptr; static_cast(mCreator)->_setMouseUsed(true); diff --git a/src/win32/extras/WiiMote/OISWiiMote.cpp b/src/win32/extras/WiiMote/OISWiiMote.cpp index 2572acf..511b454 100644 --- a/src/win32/extras/WiiMote/OISWiiMote.cpp +++ b/src/win32/extras/WiiMote/OISWiiMote.cpp @@ -126,9 +126,9 @@ void WiiMote::_threadUpdate() _doButtonCheck(bState.m2, 1, newEvent.pushedButtons, newEvent.releasedButtons); //2 _doButtonCheck(bState.mA, 2, newEvent.pushedButtons, newEvent.releasedButtons); //A _doButtonCheck(bState.mB, 3, newEvent.pushedButtons, newEvent.releasedButtons); //B - _doButtonCheck(bState.mPlus, 4, newEvent.pushedButtons, newEvent.releasedButtons); //+ + _doButtonCheck(bState.mPlus, 4, newEvent.pushedButtons, newEvent.releasedButtons); //+ _doButtonCheck(bState.mMinus, 5, newEvent.pushedButtons, newEvent.releasedButtons); //- - _doButtonCheck(bState.mHome, 6, newEvent.pushedButtons, newEvent.releasedButtons); //Home + _doButtonCheck(bState.mHome, 6, newEvent.pushedButtons, newEvent.releasedButtons); //Home //Check POV newEvent.povChanged = _doPOVCheck(bState, newEvent.povDirection); diff --git a/src/win32/extras/WiiMote/OISWiiMoteForceFeedback.h b/src/win32/extras/WiiMote/OISWiiMoteForceFeedback.h index ad94166..d7764f2 100644 --- a/src/win32/extras/WiiMote/OISWiiMoteForceFeedback.h +++ b/src/win32/extras/WiiMote/OISWiiMoteForceFeedback.h @@ -50,10 +50,10 @@ namespace OIS void remove(const Effect* effect); /** @copydoc ForceFeedback::setMasterGain */ - void setMasterGain(float level) {} + void setMasterGain(float level) { } /** @copydoc ForceFeedback::setAutoCenterMode */ - void setAutoCenterMode(bool auto_on) {} + void setAutoCenterMode(bool auto_on) { } /** @copydoc ForceFeedback::getFFAxesNumber */ short getFFAxesNumber() { return 1; } diff --git a/src/win32/extras/WiiMote/OISWiiMoteRingBuffer.h b/src/win32/extras/WiiMote/OISWiiMoteRingBuffer.h index ec55c50..f78f484 100644 --- a/src/win32/extras/WiiMote/OISWiiMoteRingBuffer.h +++ b/src/win32/extras/WiiMote/OISWiiMoteRingBuffer.h @@ -143,11 +143,11 @@ namespace OIS //2 bytes per short bufferSize = (int)numEntries; - buffer = new WiiMoteEvent[numEntries]; + buffer = new WiiMoteEvent[numEntries]; Flush(); - bigMask = (int)(numEntries * 2) - 1; + bigMask = (int)(numEntries * 2) - 1; smallMask = (int)(numEntries)-1; } diff --git a/src/win32/extras/WiiMote/hiddevice.cpp b/src/win32/extras/WiiMote/hiddevice.cpp index 6e04c62..f1715d9 100644 --- a/src/win32/extras/WiiMote/hiddevice.cpp +++ b/src/win32/extras/WiiMote/hiddevice.cpp @@ -79,18 +79,18 @@ bool cHIDDevice::OpenDevice(unsigned short device_id, unsigned short vendor_id, HANDLE hDevInfo; ULONG Required; - Length = 0; + Length = 0; detailData = NULL; - mHandle = NULL; + mHandle = NULL; HidD_GetHidGuid(&HidGuid); hDevInfo = SetupDiGetClassDevs(&HidGuid, NULL, NULL, DIGCF_PRESENT | DIGCF_INTERFACEDEVICE); devInfoData.cbSize = sizeof(devInfoData); - MemberIndex = 0; + MemberIndex = 0; MembersFound = 0; - LastDevice = FALSE; + LastDevice = FALSE; do { @@ -128,9 +128,9 @@ bool cHIDDevice::OpenDevice(unsigned short device_id, unsigned short vendor_id, PrepareForOverlappedTransfer(); mEvent = CreateEvent(NULL, TRUE, TRUE, ""); - mOverlapped.Offset = 0; + mOverlapped.Offset = 0; mOverlapped.OffsetHigh = 0; - mOverlapped.hEvent = mEvent; + mOverlapped.hEvent = mEvent; } else { diff --git a/src/win32/extras/WiiMote/wiimote.cpp b/src/win32/extras/WiiMote/wiimote.cpp index d4bdfb4..c2d7b09 100644 --- a/src/win32/extras/WiiMote/wiimote.cpp +++ b/src/win32/extras/WiiMote/wiimote.cpp @@ -23,17 +23,17 @@ const unsigned char OUTPUT_ENABLE_IR2 = 0x1a; //report request types const unsigned char REQUEST_CONTINUOUS_REPORTS = 0x4; -const unsigned char REQUEST_SINGLE_REPORTS = 0x0; +const unsigned char REQUEST_SINGLE_REPORTS = 0x0; //input channels -const unsigned char INPUT_CHANNEL_BUTTONS_ONLY = 0x30; +const unsigned char INPUT_CHANNEL_BUTTONS_ONLY = 0x30; const unsigned char INPUT_CHANNEL_BUTTONS_MOTION = 0x31; -const unsigned char INPUT_CHANNEL_WRITE_CONFIRM = 0x22; +const unsigned char INPUT_CHANNEL_WRITE_CONFIRM = 0x22; const unsigned char INPUT_CHANNEL_EXPANSION_PORT = 0x20; const unsigned char INPUT_CHANNEL_MOTION_IR = 0x33; const unsigned char INPUT_CHANNEL_MOTION_CHUCK_IR = 0x37; -const unsigned char INPUT_CHANNEL_MOTION_CHUCK = 0x35; +const unsigned char INPUT_CHANNEL_MOTION_CHUCK = 0x35; //the ID values for a wiimote const unsigned short mVendorID = 0x057E; @@ -60,9 +60,9 @@ const unsigned long IR_SENS_ADDR_2 = 0x04b0001a; const unsigned char IR_SENS_MIDRANGE_PART1[] = { 0x02, 0x00, 0x00, 0x71, 0x01, 0x00, 0xaa, 0x00, 0x64 }; const unsigned char IR_SENS_MIDRANGE_PART2[] = { 0x63, 0x03 }; -const unsigned char IR_MODE_OFF = 0; -const unsigned char IR_MODE_STD = 1; -const unsigned char IR_MODE_EXP = 3; +const unsigned char IR_MODE_OFF = 0; +const unsigned char IR_MODE_STD = 1; +const unsigned char IR_MODE_EXP = 3; const unsigned char IR_MODE_FULL = 5; cWiiMote::cWiiMote() @@ -121,7 +121,7 @@ bool cWiiMote::SendReportMode() channel = INPUT_CHANNEL_BUTTONS_MOTION; break; case REPORT_MODE_EVENT_BUTTONS: - channel = INPUT_CHANNEL_BUTTONS_ONLY; + channel = INPUT_CHANNEL_BUTTONS_ONLY; continuous = false; break; default: @@ -206,7 +206,7 @@ bool cWiiMote::UpdateOutput() bool cWiiMote::HeartBeat(int timeout) { - bool retval = true; + bool retval = true; int bytes_read = 0; //most of these reports aren't implemented yet. I don't have a sensor bar or a nunchuck :) @@ -311,12 +311,12 @@ void cWiiMote::ParseButtonReport(const unsigned char* data) mLastButtonStatus.mB = (data[1] & 0x04) != 0; mLastButtonStatus.m1 = (data[1] & 0x02) != 0; mLastButtonStatus.m2 = (data[1] & 0x01) != 0; - mLastButtonStatus.mPlus = (data[0] & 0x10) != 0; + mLastButtonStatus.mPlus = (data[0] & 0x10) != 0; mLastButtonStatus.mMinus = (data[1] & 0x10) != 0; - mLastButtonStatus.mHome = (data[1] & 0x80) != 0; - mLastButtonStatus.mUp = (data[0] & 0x08) != 0; - mLastButtonStatus.mDown = (data[0] & 0x04) != 0; - mLastButtonStatus.mLeft = (data[0] & 0x01) != 0; + mLastButtonStatus.mHome = (data[1] & 0x80) != 0; + mLastButtonStatus.mUp = (data[0] & 0x08) != 0; + mLastButtonStatus.mDown = (data[0] & 0x04) != 0; + mLastButtonStatus.mLeft = (data[0] & 0x01) != 0; mLastButtonStatus.mRight = (data[0] & 0x02) != 0; } @@ -487,9 +487,9 @@ bool cWiiMote::ReadCalibrationData() mAccelCalibrationData.mXZero = buffer[0]; mAccelCalibrationData.mYZero = buffer[1]; mAccelCalibrationData.mZZero = buffer[2]; - mAccelCalibrationData.mXG = buffer[4]; - mAccelCalibrationData.mYG = buffer[5]; - mAccelCalibrationData.mZG = buffer[6]; + mAccelCalibrationData.mXG = buffer[4]; + mAccelCalibrationData.mYG = buffer[5]; + mAccelCalibrationData.mZG = buffer[6]; retval = true; } @@ -595,15 +595,15 @@ bool cWiiMote::InitNunchuck() mNunchuckAccelCalibrationData.mXZero = 0x7E; mNunchuckAccelCalibrationData.mYZero = 0x7A; mNunchuckAccelCalibrationData.mZZero = 0x7D; - mNunchuckAccelCalibrationData.mXG = 0xB0; - mNunchuckAccelCalibrationData.mYG = 0xAF; - mNunchuckAccelCalibrationData.mZG = 0xB1; - mNunchuckStickCalibrationData.mXmax = 0xe5; - mNunchuckStickCalibrationData.mXmin = 0x21; - mNunchuckStickCalibrationData.mXmid = 0x7c; - mNunchuckStickCalibrationData.mYmax = 0xe7; - mNunchuckStickCalibrationData.mYmin = 0x23; - mNunchuckStickCalibrationData.mYmid = 0x7a; + mNunchuckAccelCalibrationData.mXG = 0xB0; + mNunchuckAccelCalibrationData.mYG = 0xAF; + mNunchuckAccelCalibrationData.mZG = 0xB1; + mNunchuckStickCalibrationData.mXmax = 0xe5; + mNunchuckStickCalibrationData.mXmin = 0x21; + mNunchuckStickCalibrationData.mXmid = 0x7c; + mNunchuckStickCalibrationData.mYmax = 0xe7; + mNunchuckStickCalibrationData.mYmin = 0x23; + mNunchuckStickCalibrationData.mYmid = 0x7a; retval = true; } } @@ -699,12 +699,12 @@ bool cWiiMote::DisableIR() void cWiiMote::ParseIRReport(const unsigned char* data) { - mLastIRReport.mP1X = data[0] << 2 | (data[2] & 0x30) >> 4; - mLastIRReport.mP1Y = data[1] << 2 | (data[2] & 0xc0) >> 6; + mLastIRReport.mP1X = data[0] << 2 | (data[2] & 0x30) >> 4; + mLastIRReport.mP1Y = data[1] << 2 | (data[2] & 0xc0) >> 6; mLastIRReport.mP1Size = data[2] & 0xf; - mLastIRReport.mP2X = data[3] << 2 | (data[5] & 0x30) >> 4; - mLastIRReport.mP2Y = data[4] << 2 | (data[5] & 0xc0) >> 6; + mLastIRReport.mP2X = data[3] << 2 | (data[5] & 0x30) >> 4; + mLastIRReport.mP2Y = data[4] << 2 | (data[5] & 0xc0) >> 6; mLastIRReport.mP2Size = data[5] & 0xf; mLastIRReport.mP1Found = !(data[0] == 0xff && data[1] == 0xff && data[2] == 0xff); @@ -716,8 +716,8 @@ bool cWiiMote::GetIRP1(float& x, float& y) const bool retval = false; if(mIRRunning && mLastIRReport.mP1Found) { - x = mLastIRReport.mP1X / 1024.f; - y = mLastIRReport.mP1Y / 1024.f; + x = mLastIRReport.mP1X / 1024.f; + y = mLastIRReport.mP1Y / 1024.f; retval = true; } return retval; @@ -728,8 +728,8 @@ bool cWiiMote::GetIRP2(float& x, float& y) const bool retval = false; if(mIRRunning && mLastIRReport.mP2Found) { - x = mLastIRReport.mP2X / 1024.f; - y = mLastIRReport.mP2Y / 1024.f; + x = mLastIRReport.mP2X / 1024.f; + y = mLastIRReport.mP2Y / 1024.f; retval = true; } return retval;