]> git.mxchange.org Git - flightgear.git/commitdiff
Get rid of FGGeneral; expose equivlanet values via properties.
authorJames Turner <zakalawe@mac.com>
Fri, 1 Oct 2010 08:33:31 +0000 (09:33 +0100)
committerJames Turner <zakalawe@mac.com>
Fri, 1 Oct 2010 08:33:31 +0000 (09:33 +0100)
src/Cockpit/cockpit.cxx
src/GUI/gui.cxx
src/Instrumentation/wxradar.cxx
src/Main/fg_init.cxx
src/Main/fg_os_osgviewer.cxx
src/Main/main.cxx
src/Main/renderer.cxx

index a2f542cbcccf359431a14960c1e37dbd9cb57899..c8afc29c61caedb7865d76133f882eb15d96ddcf 100644 (file)
@@ -37,8 +37,6 @@
 #include <simgear/props/props.hxx>
 #include <simgear/timing/sg_time.hxx>
 
-#include <Include/general.hxx>
-
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/viewmgr.hxx>
@@ -198,7 +196,7 @@ float get_sideslip( void )
 
 float get_frame_rate( void )
 {
-    return general.get_frame_rate();
+    return fgGetInt("/sim/frame-rate");
 }
 
 float get_fov( void )
index 2e8305ba419b6b9adf25aba261b78b8224c6a06d..1ae94dbb093a925eea17b7c2490d07a0232424f3 100644 (file)
@@ -39,7 +39,6 @@
 
 #include <plib/pu.h>
 
-#include <Include/general.hxx>
 #include <Main/main.hxx>
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
index 8a27057fed894c78446c06fcce9c3ab7602b9380..f32e12605445cd492fa46777bd58135892de2461 100644 (file)
@@ -58,7 +58,6 @@ using std::setfill;
 #include <Cockpit/panel.hxx>
 #include <Cockpit/hud.hxx>
 
-#include <Include/general.hxx>
 #include "instrument_mgr.hxx"
 #include "od_gauge.hxx"
 #include "wxradar.hxx"
index 7d1b82fd8671098a71aec2ddef772a0634fc8973..38c4d8ee56e618da4b484082f04d2aaa69bf68bb 100644 (file)
@@ -88,7 +88,6 @@
 #include <Cockpit/panel_io.hxx>
 
 #include <GUI/new_gui.hxx>
-#include <Include/general.hxx>
 #include <Input/input.hxx>
 #include <Instrumentation/instrument_mgr.hxx>
 #include <Model/acmodel.hxx>
index 726c868a9ab7e721470ed1045e42676e77ca927e..26ecbd2669a21dbf131d11b1ec66c4d1da3192d5 100644 (file)
@@ -46,7 +46,6 @@
 #include <osgViewer/ViewerEventHandlers>
 #include <osgViewer/Viewer>
 
-#include <Include/general.hxx>
 #include <Scenery/scenery.hxx>
 #include "fg_os.hxx"
 #include "fg_props.hxx"
index 03637612e1b46481f9a499ebd6fedc81ade508c1..2522e69dd859f0d4f7bc87d8436ce320dfe3ac5a 100644 (file)
@@ -50,7 +50,6 @@
 #include <simgear/math/sg_random.h>
 
 #include <Time/light.hxx>
-#include <Include/general.hxx>
 #include <Aircraft/replay.hxx>
 #include <Cockpit/cockpit.hxx>
 #include <Cockpit/hud.hxx>
@@ -87,9 +86,6 @@ using namespace flightgear;
 
 using std::cerr;
 
-// This is a record containing a bit of global housekeeping information
-FGGeneral general;
-
 // Specify our current idle function state.  This is used to run all
 // our initializations out of the idle callback so that we can get a
 // splash screen up and running right away.
@@ -277,21 +273,23 @@ struct GeneralInitOperation : public GraphicsContextOperation
     }
     void run(osg::GraphicsContext* gc)
     {
-        general.set_glVendor( (char *)glGetString ( GL_VENDOR ) );
-        general.set_glRenderer( (char *)glGetString ( GL_RENDERER ) );
-        general.set_glVersion( (char *)glGetString ( GL_VERSION ) );
-        SG_LOG( SG_GENERAL, SG_INFO, general.get_glVendor() );
-        SG_LOG( SG_GENERAL, SG_INFO, general.get_glRenderer() );
-        SG_LOG( SG_GENERAL, SG_INFO, general.get_glVersion() );
+        SGPropertyNode* simRendering = fgGetNode("/sim/rendering");
+        
+        simRendering->setStringValue("gl-vendor", (char*) glGetString(GL_VENDOR));
+        SG_LOG( SG_GENERAL, SG_INFO, glGetString(GL_VENDOR));
+        
+        simRendering->setStringValue("gl-renderer", (char*) glGetString(GL_RENDERER));
+        SG_LOG( SG_GENERAL, SG_INFO, glGetString(GL_RENDERER));
+        
+        simRendering->setStringValue("gl-version", (char*) glGetString(GL_VERSION));
+        SG_LOG( SG_GENERAL, SG_INFO, glGetString(GL_VERSION));
 
         GLint tmp;
         glGetIntegerv( GL_MAX_TEXTURE_SIZE, &tmp );
-        general.set_glMaxTexSize( tmp );
-        SG_LOG ( SG_GENERAL, SG_INFO, "Max texture size = " << tmp );
+        simRendering->setIntValue("max-texture-size", tmp);
 
         glGetIntegerv( GL_DEPTH_BITS, &tmp );
-        general.set_glDepthBits( tmp );
-        SG_LOG ( SG_GENERAL, SG_INFO, "Depth buffer bits = " << tmp );
+        simRendering->setIntValue("depth-buffer-bits", tmp);
     }
 };
 
index a3d6d988651ccae043f96a605bba6274b1350cc4..0cb00c5ab63d8228368f513d0f60cf3d62011812 100644 (file)
@@ -93,7 +93,6 @@
 #include <Instrumentation/HUD/HUD.hxx>
 #include <Environment/precipitation_mgr.hxx>
 
-#include <Include/general.hxx>
 #include "splash.hxx"
 #include "renderer.hxx"
 #include "main.hxx"