Merge branch 'next' of ssh://git.code.sf.net/p/flightgear/simgear into next
This commit is contained in:
commit
85c4e03823
@ -93,7 +93,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath,
|
||||
// Read name node purely for logging purposes
|
||||
const SGPropertyNode *nameNode = node->getChild("name");
|
||||
if (nameNode) {
|
||||
SG_LOG( SG_TERRAIN, SG_INFO, "Loading region "
|
||||
SG_LOG( SG_TERRAIN, SG_DEBUG, "Loading region "
|
||||
<< nameNode->getStringValue());
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath,
|
||||
fabs(x2 - x1),
|
||||
fabs(y2 - y1));
|
||||
arealist->push_back(rect);
|
||||
SG_LOG( SG_TERRAIN, SG_INFO, " Area ("
|
||||
SG_LOG( SG_TERRAIN, SG_DEBUG, " Area ("
|
||||
<< rect.x() << ","
|
||||
<< rect.y() << ") width:"
|
||||
<< rect.width() << " height:"
|
||||
|
@ -107,7 +107,11 @@ osg::Vec2d eventToWindowCoords(const osgGA::GUIEventAdapter& ea)
|
||||
if (_buttons.find(button) == _buttons.end()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!anyBindingEnabled(_bindingsDown)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
fireBindingList(_bindingsDown);
|
||||
_repeatTime = -_repeatInterval; // anti-bobble: delay start of repeat
|
||||
return true;
|
||||
@ -136,7 +140,7 @@ osg::Vec2d eventToWindowCoords(const osgGA::GUIEventAdapter& ea)
|
||||
virtual bool hover( const osg::Vec2d& windowPos,
|
||||
const Info& )
|
||||
{
|
||||
if (_hover.empty()) {
|
||||
if (!anyBindingEnabled(_hover)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -165,3 +165,18 @@ void clearBindingList(const SGBindingList& aBindings)
|
||||
}
|
||||
}
|
||||
|
||||
bool anyBindingEnabled(const SGBindingList& aBindings)
|
||||
{
|
||||
if (aBindings.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BOOST_FOREACH(SGBinding_ptr b, aBindings) {
|
||||
if (!b->test()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -171,4 +171,10 @@ SGBindingList readBindingList(const simgear::PropertyList& aNodes, SGPropertyNod
|
||||
*/
|
||||
void clearBindingList(const SGBindingList& aBindings);
|
||||
|
||||
/**
|
||||
* check if at least one binding in the list is enabled. Returns false if bindings
|
||||
* list is empty, or all bindings are conditinally disabled.
|
||||
*/
|
||||
bool anyBindingEnabled(const SGBindingList& bindings);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user