]> git.mxchange.org Git - flightgear.git/blobdiff - src/Model/panelnode.cxx
Initial commit of the new sound system, expect more updates to follow
[flightgear.git] / src / Model / panelnode.cxx
index c32d89830b2c6fe487d04ac72333f170649766fe..6ac60caaaeb7b41b16b3b70d2526ecd4c6a78e4f 100644 (file)
@@ -7,13 +7,11 @@
 
 #include <vector>
 
-#include <plib/sg.h>
-
 #include <Cockpit/panel.hxx>
 #include <Cockpit/panel_io.hxx>
 #include "panelnode.hxx"
 
-SG_USING_STD(vector);
+using std::vector;
 
 
 // Static (!) handling for all 3D panels in the program.
@@ -130,12 +128,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);
 }