From f29978fb420f157db7bbb6839055dd042c8bc576 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 6 Jan 2002 16:51:31 +0000 Subject: [PATCH] Added fullscreen to globals, and fixed compile bug for 3DFX cards. --- src/GUI/gui.cxx | 4 ++-- src/Main/fg_init.cxx | 4 ++-- src/Main/fg_props.cxx | 7 ++++--- src/Main/globals.cxx | 3 +++ src/Main/globals.hxx | 10 ++++++++++ src/Main/options.cxx | 5 ----- src/Main/options.hxx | 7 ------- 7 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index e9a87182e..568ae55eb 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -449,8 +449,8 @@ void helpCb (puObject *) #if defined(FX) && !defined(WIN32) # if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW) - if ( global_fullscreen ) { - global_fullscreen = false; + if ( globals->get_fullscreen() ) { + globals->set_fullscreen(false); XMesaSetFXmode( XMESA_FX_WINDOW ); } # endif diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index f804c2070..35568c80c 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -489,14 +489,14 @@ bool fgInitGeneral( void ) { #if defined(FX) && defined(XMESA) // initialize full screen flag - global_fullscreen = false; + globals->set_fullscreen(false); if ( strstr ( general.get_glRenderer(), "Glide" ) ) { // Test for the MESA_GLX_FX env variable if ( (mesa_win_state = getenv( "MESA_GLX_FX" )) != NULL) { // test if we are fullscreen mesa/glide if ( (mesa_win_state[0] == 'f') || (mesa_win_state[0] == 'F') ) { - global_fullscreen = true; + globals->set_fullscreen(true); } } } diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index a51b9750f..87efdbf86 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -42,6 +42,7 @@ #include +#include "globals.hxx" #include "fgfs.hxx" #include "fg_props.hxx" #include "viewmgr.hxx" @@ -1057,7 +1058,7 @@ static bool getFullScreen () { #if defined(FX) && !defined(WIN32) - return global_fullscreen; + return globals->get_fullscreen(); #else return false; #endif @@ -1067,9 +1068,9 @@ static void setFullScreen (bool state) { #if defined(FX) && !defined(WIN32) - global_fullscreen = state; + globals->set_fullscreen(state); # if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW) - XMesaSetFXmode( global_fullscreen ? XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW ); + XMesaSetFXmode( state ? XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW ); # endif #endif } diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index 9de7fdb43..10995370a 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -37,6 +37,9 @@ FGGlobals *globals; // Constructor FGGlobals::FGGlobals() : freeze( false ), +#if defined(FX) && defined(XMESA) + fullscreen( true ), +#endif warp( 0 ), warp_delta( 0 ), props(new SGPropertyNode), diff --git a/src/Main/globals.hxx b/src/Main/globals.hxx index 170fe8235..6167fe804 100644 --- a/src/Main/globals.hxx +++ b/src/Main/globals.hxx @@ -63,6 +63,11 @@ private: // Freeze sim bool freeze; + // Fullscreen mode for old 3DFX cards. +#if defined(FX) && defined(XMESA) + extern bool fullscreen; +#endif + // An offset in seconds from the true time. Allows us to adjust // the effective time of day. long int warp; @@ -121,6 +126,11 @@ public: inline bool get_freeze() const { return freeze; } inline void set_freeze( bool f ) { freeze = f; } +#if defined(FX) && defined(XMESA) + inline bool get_fullscreen() const { return fullscreen; } + inline bool set_fullscreen( bool f ) const { fullscreen = f; } +#endif + inline long int get_warp() const { return warp; } inline void set_warp( long int w ) { warp = w; } inline void inc_warp( long int w ) { warp += w; } diff --git a/src/Main/options.cxx b/src/Main/options.cxx index f7931419e..9d7da0769 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -28,11 +28,6 @@ #include #include -/* normans fix */ -#if defined(FX) && defined(XMESA) -bool global_fullscreen = true; -#endif - #include // rint() #include #include // atof(), atoi() diff --git a/src/Main/options.hxx b/src/Main/options.hxx index b4ecc9f82..b9e0aeb60 100644 --- a/src/Main/options.hxx +++ b/src/Main/options.hxx @@ -36,11 +36,4 @@ extern void fgParseArgs (int argc, char ** argv); extern void fgParseOptions (const string &file_path); extern void fgUsage (); - -/* normans fix */ -#if defined(FX) && defined(XMESA) -extern bool global_fullscreen; -#endif - - #endif /* _OPTIONS_HXX */ -- 2.39.5