Commit 24236447 authored by TheOnlyJoey's avatar TheOnlyJoey
Browse files

Merge pull request #5 from hymerman/tidying

General tidy-up
parents c546989f ed6e1ba6
......@@ -46,10 +46,6 @@ namespace OIS
*/
class _OISExport Effect
{
/**
hidden so this class cannot be instanced with default constructor
*/
Effect();
public:
//! Type of force
enum EForce
......@@ -158,6 +154,10 @@ namespace OIS
*/
mutable int _handle;
protected:
// Prevent copying.
Effect(const Effect&);
Effect& operator=(Effect);
ForceEffect* effect; //Properties depend on EForce
short axes; //Number of axes to use in effect
};
......@@ -215,7 +215,7 @@ namespace OIS
public:
ConstantEffect() : level(5000) {}
class Envelope envelope; //Optional envolope
Envelope envelope; //Optional envolope
signed short level; //-10K to +10k
};
......@@ -228,7 +228,7 @@ namespace OIS
public:
RampEffect() : startLevel(0), endLevel(0) {}
class Envelope envelope; //Optional envelope
Envelope envelope; //Optional envelope
signed short startLevel; //-10K to +10k
signed short endLevel; //-10K to +10k
};
......@@ -242,7 +242,7 @@ namespace OIS
public:
PeriodicEffect() : magnitude(0), offset(0), phase(0), period(0) {}
class Envelope envelope; //Optional Envelope
Envelope envelope; //Optional Envelope
unsigned short magnitude; //0 to 10,0000
signed short offset;
......
......@@ -32,7 +32,7 @@ namespace OIS
class _OISExport EventArg
{
public:
EventArg( Object* obj ) : device(obj) {}
explicit EventArg( Object* obj ) : device(obj) {}
virtual ~EventArg() {}
//! Pointer to the Input Device
......
......@@ -50,13 +50,14 @@ namespace OIS
*/
class _OISExport Exception : public std::exception
{
//! Hidden default
Exception() : eType(E_General), eLine(0), eFile(0) {}
public:
//! Creates exception object
Exception( OIS_ERROR err, const char* str, int line, const char *file )
: eType(err), eLine(line), eFile(file), eText(str) {}
Exception(const Exception& other)
: eType(other.eType), eLine(other.eLine), eFile(other.eFile), eText(other.eText) {}
~Exception() throw() {}
virtual const char* what() const throw();
......@@ -69,6 +70,10 @@ namespace OIS
const char* eFile;
//! A message passed along when the exception was raised
const char* eText;
private:
// Unimplemented and unaccessible due to const members.
Exception& operator=(Exception);
};
}
......
......@@ -177,7 +177,7 @@ namespace OIS
@remarks
Derived classes must provide input system name
*/
InputManager(const std::string& name);
explicit InputManager(const std::string& name);
/**
@remarks
......@@ -200,6 +200,11 @@ namespace OIS
//! Extra factory (not enabled by default)
LIRCFactoryCreator *m_lircSupport;
WiiMoteFactoryCreator *m_wiiMoteSupport;
private:
// Prevent copying.
InputManager(const InputManager&);
InputManager& operator=(InputManager);
};
}
#endif
......@@ -119,6 +119,11 @@ namespace OIS
virtual ~JoyStickEvent() {}
const JoyStickState &state;
private:
// Prevent copying.
JoyStickEvent(const JoyStickEvent&);
JoyStickEvent& operator=(JoyStickEvent);
};
/**
......@@ -143,13 +148,13 @@ namespace OIS
//-- Not so common control events, so are not required --//
//! Joystick Event, and sliderID
virtual bool sliderMoved( const JoyStickEvent &, int index) {return true;}
virtual bool sliderMoved( const JoyStickEvent &arg, int index) { OIS_UNUSED(arg); OIS_UNUSED(index); return true; }
//! Joystick Event, and povID
virtual bool povMoved( const JoyStickEvent &arg, int index) {return true;}
virtual bool povMoved( const JoyStickEvent &arg, int index) { OIS_UNUSED(arg); OIS_UNUSED(index); return true; }
//! Joystick Event, and Vector3ID
virtual bool vector3Moved( const JoyStickEvent &arg, int index) {return true;}
virtual bool vector3Moved( const JoyStickEvent &arg, int index) { OIS_UNUSED(arg); OIS_UNUSED(index); return true; }
};
/**
......
......@@ -187,7 +187,7 @@ namespace OIS
virtual ~KeyEvent() {}
//! KeyCode of event
const KeyCode key;
KeyCode key;
//! Text character, depends on current TextTranslationMode
unsigned int text;
};
......
......@@ -85,6 +85,11 @@ namespace OIS
//! The state of the mouse - including buttons and axes
const MouseState &state;
private:
// Prevent copying.
MouseEvent(const MouseEvent&);
MouseEvent& operator=(MouseEvent);
};
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment