Merge branch 'next' of git://gitorious.org/fg/flightgear into next
This commit is contained in:
commit
157bd10218
9 changed files with 14 additions and 109 deletions
|
@ -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 )
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -4,5 +4,4 @@ EXTRA_DIST = \
|
|||
config.h-msvc71 \
|
||||
config.h-msvc8 \
|
||||
cmdargs.h \
|
||||
fg_typedefs.h \
|
||||
general.hxx
|
||||
fg_typedefs.h
|
|
@ -1,85 +0,0 @@
|
|||
// general.hxx -- a general house keeping data structure definition for
|
||||
// various info that might need to be accessible from all
|
||||
// parts of the sim.
|
||||
//
|
||||
// Written by Curtis Olson, started July 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#ifndef _GENERAL_HXX
|
||||
#define _GENERAL_HXX
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
# error This library requires C++
|
||||
#endif
|
||||
|
||||
#include <simgear/structure/OSGVersion.hxx>
|
||||
#define FG_OSG_VERSION SG_OSG_VERSION
|
||||
|
||||
// #define FANCY_FRAME_COUNTER
|
||||
#ifdef FANCY_FRAME_COUNTER
|
||||
#define FG_FRAME_RATE_HISTORY 10
|
||||
#endif
|
||||
|
||||
|
||||
// the general house keeping structure definition
|
||||
class FGGeneral {
|
||||
// Info about OpenGL
|
||||
char *glVendor;
|
||||
char *glRenderer;
|
||||
char *glVersion;
|
||||
int glMaxTexSize;
|
||||
int glDepthBits;
|
||||
|
||||
// Last frame rate measurement
|
||||
int frame_rate;
|
||||
#ifdef FANCY_FRAME_COUNTER
|
||||
double frames[FG_FRAME_RATE_HISTORY];
|
||||
#endif
|
||||
|
||||
public:
|
||||
inline char* get_glVendor() { return glVendor; }
|
||||
inline void set_glVendor( char *str ) { glVendor = str; }
|
||||
inline char* get_glRenderer() const { return glRenderer; }
|
||||
inline void set_glRenderer( char *str ) { glRenderer = str; }
|
||||
inline char* get_glVersion() { return glVersion; }
|
||||
inline void set_glVersion( char *str ) { glVersion = str; }
|
||||
inline void set_glMaxTexSize( int i ) { glMaxTexSize = i; }
|
||||
inline int get_glMaxTexSize() const { return glMaxTexSize; }
|
||||
inline void set_glDepthBits( int d ) { glDepthBits = d; }
|
||||
inline int get_glDepthBits() const { return glDepthBits; }
|
||||
inline double get_frame_rate() const { return frame_rate; }
|
||||
#ifdef FANCY_FRAME_COUNTER
|
||||
inline double get_frame(int idx) const { return frames[idx]; }
|
||||
inline void set_frame( int idx, double value ) { frames[idx] = value; }
|
||||
inline void set_frame_rate( double rate ) { frame_rate = rate; }
|
||||
#else
|
||||
inline void set_frame_rate( int rate ) { frame_rate = rate; }
|
||||
#endif
|
||||
};
|
||||
|
||||
// general contains all the general house keeping parameters.
|
||||
extern FGGeneral general;
|
||||
|
||||
|
||||
#endif // _GENERAL_HXX
|
||||
|
||||
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue