Browse Source

Fixed << operator to be usable in .I file

fireclawthefox 9 years ago
parent
commit
f1444fcff9
2 changed files with 6 additions and 5 deletions
  1. 2 2
      panda/src/device/inputDevice.I
  2. 4 3
      panda/src/device/inputDevice.h

+ 2 - 2
panda/src/device/inputDevice.I

@@ -290,7 +290,7 @@ get_num_controls() const {
  * the various controls by index number.
  */
 INLINE void InputDevice::
-set_control_map(int index, ControlAxis axis) {
+set_control_map(int index, InputDevice::ControlAxis axis) {
   LightMutexHolder holder(_lock);
   nassertv(index >= 0);
   if (index >= (int)_controls.size()) {
@@ -348,7 +348,7 @@ get_control(size_t index) const {
  * if the axis was not found in the list.
  */
 INLINE InputDevice::AnalogState InputDevice::
-find_control(ControlAxis axis) const {
+find_control(InputDevice::ControlAxis axis) const {
   for (int i; i < (int)_controls.size(); i++) {
     if (_controls[i].axis == axis) {
       return _controls[i];

+ 4 - 3
panda/src/device/inputDevice.h

@@ -287,7 +287,8 @@ PUBLISHED:
   INLINE AnalogState get_control(size_t index) const;
   INLINE AnalogState find_control(ControlAxis axis) const;
 
-  // Make device controls iterable
+  // Make device buttons and controls iterable
+  MAKE_SEQ_PROPERTY(buttons, get_num_buttons, get_button);
   MAKE_SEQ_PROPERTY(controls, get_num_controls, get_control);
 
 public:
@@ -313,8 +314,8 @@ INLINE ostream &operator << (ostream &out, const InputDevice &device) {
   return out;
 }
 
-ostream &operator << (ostream &out, InputDevice::DeviceClass dc);
-ostream &operator << (ostream &out, InputDevice::ControlAxis axis);
+EXPCL_PANDA_DEVICE ostream &operator << (ostream &out, InputDevice::DeviceClass dc);
+EXPCL_PANDA_DEVICE ostream &operator << (ostream &out, InputDevice::ControlAxis axis);
 
 #include "inputDevice.I"