From 8b649b06c441dc67c7ceb3d21be41f6e5fa5a074 Mon Sep 17 00:00:00 2001 From: jmt Date: Fri, 18 Sep 2009 16:50:08 +0000 Subject: [PATCH 1/3] Header clean-ups in viewer/view-mgr. --- src/Main/fg_props.hxx | 2 -- src/Main/viewer.hxx | 7 +------ src/Main/viewmgr.cxx | 16 +++++++++++----- src/Main/viewmgr.hxx | 21 +++++++-------------- 4 files changed, 19 insertions(+), 27 deletions(-) diff --git a/src/Main/fg_props.hxx b/src/Main/fg_props.hxx index 8516c93c9..7651d65f9 100644 --- a/src/Main/fg_props.hxx +++ b/src/Main/fg_props.hxx @@ -10,8 +10,6 @@ #include #include - -#include
//////////////////////////////////////////////////////////////////////// // Property management. diff --git a/src/Main/viewer.hxx b/src/Main/viewer.hxx index 50d567439..965e8569a 100644 --- a/src/Main/viewer.hxx +++ b/src/Main/viewer.hxx @@ -25,12 +25,7 @@ #ifndef _VIEWER_HXX -#define _VIEWER_HXX - - -#ifndef __cplusplus -# error This library requires C++ -#endif +#define _VIEWER_HXX namespace flightgear { diff --git a/src/Main/viewmgr.cxx b/src/Main/viewmgr.cxx index 950eace83..fd6f25fd9 100644 --- a/src/Main/viewmgr.cxx +++ b/src/Main/viewmgr.cxx @@ -25,14 +25,14 @@ # include "config.h" #endif +#include "viewmgr.hxx" + #include // strcmp #include - #include - -#include "viewmgr.hxx" - +#include
+#include
// Constructor FGViewMgr::FGViewMgr( void ) : @@ -341,7 +341,13 @@ FGViewMgr::copyToCurrent() get_current_view()->getInternal()); } - +void +FGViewMgr::add_view( FGViewer * v ) +{ + views.push_back(v); + v->init(); +} + double FGViewMgr::getViewHeadingOffset_deg () const { diff --git a/src/Main/viewmgr.hxx b/src/Main/viewmgr.hxx index ea4470fbb..c6476a15b 100644 --- a/src/Main/viewmgr.hxx +++ b/src/Main/viewmgr.hxx @@ -28,16 +28,11 @@ #include #include +#include -#ifdef HAVE_CONFIG_H -# include -#endif - -#include "fg_props.hxx" -#include "viewer.hxx" - -using std::vector; - +// forward decls +class FGViewer; +typedef SGSharedPtr FGViewerPtr; // Define a structure containing view information class FGViewMgr : public SGSubsystem @@ -98,10 +93,8 @@ 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); - v->init(); - } + void add_view( FGViewer * v ); + // copies current offset settings to current-view path... void copyToCurrent (); @@ -150,7 +143,7 @@ private: SGPropertyNode_ptr view_number; vector config_list; - typedef vector > viewer_list; + typedef std::vector viewer_list; viewer_list views; SGVec3d abs_viewer_position; From 3c62011f03329cbb307cc4372ac430c05629e20d Mon Sep 17 00:00:00 2001 From: jmt Date: Fri, 18 Sep 2009 17:17:06 +0000 Subject: [PATCH 2/3] Drat, this is really needed. Yuck, yuck, yuck. --- src/Main/fg_props.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Main/fg_props.hxx b/src/Main/fg_props.hxx index 7651d65f9..41772ff35 100644 --- a/src/Main/fg_props.hxx +++ b/src/Main/fg_props.hxx @@ -10,7 +10,9 @@ #include #include - + +#include
+ //////////////////////////////////////////////////////////////////////// // Property management. //////////////////////////////////////////////////////////////////////// From 05626756e7a39f7fc2172fe915f3ef97f0be82b8 Mon Sep 17 00:00:00 2001 From: jmt Date: Fri, 18 Sep 2009 17:27:16 +0000 Subject: [PATCH 3/3] Put back an unfortunate include, until ViewMgr can be fixed to not inline FGViewer destructor calls. --- src/Main/viewmgr.hxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Main/viewmgr.hxx b/src/Main/viewmgr.hxx index c6476a15b..8053a1a9d 100644 --- a/src/Main/viewmgr.hxx +++ b/src/Main/viewmgr.hxx @@ -30,6 +30,8 @@ #include #include +#include
// FIXME - remove inlines here. + // forward decls class FGViewer; typedef SGSharedPtr FGViewerPtr;