Fix a clash with some standard MSVC defines (yeah MS) :-(
This commit is contained in:
parent
94f745e3ea
commit
38f29c3d86
4 changed files with 54 additions and 20 deletions
|
@ -4416,6 +4416,40 @@ SOURCE=.\src\GUI\trackball.h
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
|
# Begin Group "Lib_Input"
|
||||||
|
|
||||||
|
# PROP Default_Filter ""
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\Input\input.cxx
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "FlightGear - Win32 Release"
|
||||||
|
|
||||||
|
# PROP Intermediate_Dir "Release\Lib_Input"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug"
|
||||||
|
|
||||||
|
# PROP Intermediate_Dir "Debug\Lib_Input"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\Input\input.hxx
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "FlightGear - Win32 Release"
|
||||||
|
|
||||||
|
# PROP Intermediate_Dir "Release\Lib_Input"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug"
|
||||||
|
|
||||||
|
# PROP Intermediate_Dir "Debug\Lib_Input"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "Lib_Joystick"
|
# Begin Group "Lib_Joystick"
|
||||||
|
|
|
@ -248,20 +248,20 @@ FGInput::init ()
|
||||||
globals->get_props()->getNode("/input/keyboard", true);
|
globals->get_props()->getNode("/input/keyboard", true);
|
||||||
vector<const SGPropertyNode *> keys = keyboard->getChildren("key");
|
vector<const SGPropertyNode *> keys = keyboard->getChildren("key");
|
||||||
|
|
||||||
for (int i = 0; i < keys.size(); i++) {
|
for (unsigned int i = 0; i < keys.size(); i++) {
|
||||||
int index = keys[i]->getIndex();
|
int index = keys[i]->getIndex();
|
||||||
int modifiers = MOD_NONE;
|
int modifiers = FG_MOD_NONE;
|
||||||
if (keys[i]->getBoolValue("mod-shift"))
|
if (keys[i]->getBoolValue("mod-shift"))
|
||||||
modifiers |= MOD_SHIFT;
|
modifiers |= FG_MOD_SHIFT;
|
||||||
if (keys[i]->getBoolValue("mod-ctrl"))
|
if (keys[i]->getBoolValue("mod-ctrl"))
|
||||||
modifiers |= MOD_CTRL;
|
modifiers |= FG_MOD_CTRL;
|
||||||
if (keys[i]->getBoolValue("mod-alt"))
|
if (keys[i]->getBoolValue("mod-alt"))
|
||||||
modifiers |= MOD_ALT;
|
modifiers |= FG_MOD_ALT;
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Binding key " << index
|
SG_LOG(SG_INPUT, SG_INFO, "Binding key " << index
|
||||||
<< " with modifiers " << modifiers);
|
<< " with modifiers " << modifiers);
|
||||||
|
|
||||||
vector<const SGPropertyNode *> bindings = keys[i]->getChildren("binding");
|
vector<const SGPropertyNode *> bindings = keys[i]->getChildren("binding");
|
||||||
for (int j = 0; j < bindings.size(); j++) {
|
for (unsigned int j = 0; j < bindings.size(); j++) {
|
||||||
SG_LOG(SG_INPUT, SG_INFO, " Adding binding " << j);
|
SG_LOG(SG_INPUT, SG_INFO, " Adding binding " << j);
|
||||||
_key_bindings[modifiers][index].push_back(FGBinding(bindings[j]));
|
_key_bindings[modifiers][index].push_back(FGBinding(bindings[j]));
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ FGInput::doKey (int k, int modifiers, int x, int y)
|
||||||
|
|
||||||
if (_key_bindings[modifiers].find(k) != _key_bindings[modifiers].end()) {
|
if (_key_bindings[modifiers].find(k) != _key_bindings[modifiers].end()) {
|
||||||
const vector<FGBinding> &bindings = _key_bindings[modifiers][k];
|
const vector<FGBinding> &bindings = _key_bindings[modifiers][k];
|
||||||
for (int i = 0; i < bindings.size(); i++) {
|
for (unsigned int i = 0; i < bindings.size(); i++) {
|
||||||
bindings[i].fire();
|
bindings[i].fire();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -312,7 +312,7 @@ FGInput::doKey (int k, int modifiers, int x, int y)
|
||||||
|
|
||||||
// everything after here will be removed sooner or later...
|
// everything after here will be removed sooner or later...
|
||||||
|
|
||||||
if (modifiers & MOD_SHIFT) {
|
if (modifiers & FG_MOD_SHIFT) {
|
||||||
|
|
||||||
switch (k) {
|
switch (k) {
|
||||||
case 7: // Ctrl-G key
|
case 7: // Ctrl-G key
|
||||||
|
|
|
@ -100,11 +100,11 @@ class FGInput : public FGSubsystem
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MOD_NONE = 0,
|
FG_MOD_NONE = 0,
|
||||||
MOD_SHIFT = 1,
|
FG_MOD_SHIFT = 1,
|
||||||
MOD_CTRL = 2,
|
FG_MOD_CTRL = 2,
|
||||||
MOD_ALT = 4,
|
FG_MOD_ALT = 4,
|
||||||
MOD_MAX = 8 // one past all modifiers
|
FG_MOD_MAX = 8 // one past all modifiers
|
||||||
};
|
};
|
||||||
|
|
||||||
FGInput();
|
FGInput();
|
||||||
|
@ -129,9 +129,9 @@ public:
|
||||||
* @param modifiers Modifier keys pressed (bitfield).
|
* @param modifiers Modifier keys pressed (bitfield).
|
||||||
* @param x The mouse x position at the time of keypress.
|
* @param x The mouse x position at the time of keypress.
|
||||||
* @param y The mouse y position at the time of keypress.
|
* @param y The mouse y position at the time of keypress.
|
||||||
* @see #MOD_SHIFT
|
* @see #FG_MOD_SHIFT
|
||||||
* @see #MOD_CTRL
|
* @see #FG_MOD_CTRL
|
||||||
* @see #MOD_ALT
|
* @see #FG_MOD_ALT
|
||||||
*/
|
*/
|
||||||
virtual void doKey (int k, int modifiers, int x, int y);
|
virtual void doKey (int k, int modifiers, int x, int y);
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ public:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
typedef map<int,vector<FGBinding> > keyboard_map;
|
typedef map<int,vector<FGBinding> > keyboard_map;
|
||||||
keyboard_map _key_bindings[MOD_MAX];
|
keyboard_map _key_bindings[FG_MOD_MAX];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -47,11 +47,11 @@ static inline int get_mods ()
|
||||||
int modifiers = 0;
|
int modifiers = 0;
|
||||||
|
|
||||||
if (glut_modifiers & GLUT_ACTIVE_SHIFT)
|
if (glut_modifiers & GLUT_ACTIVE_SHIFT)
|
||||||
modifiers |= FGInput::MOD_SHIFT;
|
modifiers |= FGInput::FG_MOD_SHIFT;
|
||||||
if (glut_modifiers & GLUT_ACTIVE_CTRL)
|
if (glut_modifiers & GLUT_ACTIVE_CTRL)
|
||||||
modifiers |= FGInput::MOD_CTRL;
|
modifiers |= FGInput::FG_MOD_CTRL;
|
||||||
if (glut_modifiers & GLUT_ACTIVE_ALT)
|
if (glut_modifiers & GLUT_ACTIVE_ALT)
|
||||||
modifiers |= FGInput::MOD_ALT;
|
modifiers |= FGInput::FG_MOD_ALT;
|
||||||
|
|
||||||
return modifiers;
|
return modifiers;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue