#endif
#include "FGMouseInput.hxx"
+
+#include <osgGA/GUIEventAdapter>
#include "Main/globals.hxx"
using std::ios_base;
-void ActivePickCallbacks::init( int b, const osgGA::GUIEventAdapter* ea )
+void ActivePickCallbacks::init( int button, const osgGA::GUIEventAdapter* ea )
{
// Get the list of hit callbacks. Take the first callback that
// accepts the mouse button press and ignore the rest of them
// The nearest one is the first one and the deepest
// (the most specialized one in the scenegraph) is the first.
std::vector<SGSceneryPick> pickList;
- if (globals->get_renderer()->pick(pickList, ea)) {
- std::vector<SGSceneryPick>::const_iterator i;
- for (i = pickList.begin(); i != pickList.end(); ++i) {
- if (i->callback->buttonPressed(b, i->info)) {
- (*this)[b].push_back(i->callback);
- return;
- }
+ if (!globals->get_renderer()->pick(pickList, ea)) {
+ return;
+ }
+
+ std::vector<SGSceneryPick>::const_iterator i;
+ for (i = pickList.begin(); i != pickList.end(); ++i) {
+ if (i->callback->buttonPressed(button, ea, i->info)) {
+ (*this)[button].push_back(i->callback);
+ return;
}
}
}
class ActivePickCallbacks : public std::map<int, std::list<SGSharedPtr<SGPickCallback> > > {
public:
void update( double dt );
- void init( int b, const osgGA::GUIEventAdapter* ea );
+ void init( int button, const osgGA::GUIEventAdapter* ea );
};
panel(p)
{}
- virtual bool buttonPressed(int b, const Info& info)
+ virtual bool buttonPressed(int b, const osgGA::GUIEventAdapter*, const Info& info)
{
button = b;
// convert to panel coordinates
class FGGroundPickCallback : public SGPickCallback {
public:
- virtual bool buttonPressed(int button, const Info& info)
+ virtual bool buttonPressed(int button, const osgGA::GUIEventAdapter*, const Info& info)
{
// only on left mouse button
if (button != 0)