]> git.mxchange.org Git - flightgear.git/commitdiff
Tweaks.
authorcurt <curt>
Mon, 30 Oct 2000 15:09:17 +0000 (15:09 +0000)
committercurt <curt>
Mon, 30 Oct 2000 15:09:17 +0000 (15:09 +0000)
src/Main/viewmgr.cxx
src/Main/viewmgr.hxx

index e9170f0fac47153bdc5a3a71d0a5c173f50dfba8..531f61334d00f3805393fe6caadaf5835fe56b07 100644 (file)
@@ -25,7 +25,9 @@
 
 
 // Constructor
-FGViewMgr::FGViewMgr( void ) {
+FGViewMgr::FGViewMgr( void ) :
+    current( 0 )
+{
 }
 
 
index 80928abf0debb025583203b98943532526346b80..74027004a3215cacf0567aeec960428183378f69 100644 (file)
@@ -64,8 +64,13 @@ public:
 
     // getters
     inline int size() const { return views.size(); }
-    inline FGViewer *get_view() {
-       return views[current];
+    inline int get_current() const { return current; }
+    inline FGViewer *get_current_view() {
+       if ( current < (int)views.size() ) {
+           return views[current];
+       } else {
+           return NULL;
+       }
     }
     inline FGViewer *get_view( int i ) {
        if ( i < 0 ) { i = 0; }
@@ -89,9 +94,9 @@ public:
 
     // setters
     inline void clear() { views.clear(); }
+    inline void set_view( const int v ) { current = v; }
     inline void add_view( FGViewer * v ) {
        views.push_back(v);
-       current = views.size() - 1;
     }
 };