]> git.mxchange.org Git - flightgear.git/commitdiff
Modified Files:
authorfrohlich <frohlich>
Sun, 7 Jan 2007 19:00:25 +0000 (19:00 +0000)
committerfrohlich <frohlich>
Sun, 7 Jan 2007 19:00:25 +0000 (19:00 +0000)
src/Model/panelnode.cxx src/Model/panelnode.hxx: Make it compile
also with osg HEAD.

src/Model/panelnode.cxx
src/Model/panelnode.hxx

index c32d89830b2c6fe487d04ac72333f170649766fe..8413da54ca018d677c1934c4badb6fa16dfe9f42 100644 (file)
@@ -130,12 +130,14 @@ FGPanelNode::drawImplementation(osg::State& state) const
   // coordinates to panel coordinates when the user clicks the
   // mouse.
   // OSGFIXME: we don't need that when we can really pick
-  const_cast<osg::Matrix&>(_lastModelview) = state.getModelViewMatrix();
-  const_cast<osg::Matrix&>(_lastProjection) = state.getProjectionMatrix();
-  state.getCurrentViewport()->getViewport(const_cast<int&>(_lastViewport[0]),
-                                          const_cast<int&>(_lastViewport[1]),
-                                          const_cast<int&>(_lastViewport[2]),
-                                          const_cast<int&>(_lastViewport[3]));
+  _lastModelview = state.getModelViewMatrix();
+  _lastProjection = state.getProjectionMatrix();
+
+  const osg::Viewport* vp = state.getCurrentViewport();
+  _lastViewport[0] = vp->x();
+  _lastViewport[1] = vp->y();
+  _lastViewport[2] = vp->width();
+  _lastViewport[3] = vp->height();
   
   _panel->draw(state);
 }
index 85f83a0d3b24fa56e5abdf9a58ac7d4e9b2df632..0745e5d2472d2ed36489ebf1cc5db4c2064307fe 100644 (file)
@@ -53,9 +53,9 @@ private:
     // The matrix transformation state that was active the last time
     // we were rendered.  Used by the mouse code to compute
     // intersections.
-    osg::Matrix _lastModelview;
-    osg::Matrix _lastProjection;
-    int   _lastViewport[4];
+    mutable osg::Matrix _lastModelview;
+    mutable osg::Matrix _lastProjection;
+    mutable double _lastViewport[4];
 };