1
0
Fork 0

Added fullscreen to globals, and fixed compile bug for 3DFX cards.

This commit is contained in:
david 2002-01-06 16:51:31 +00:00
parent 3cbc6f21c7
commit f29978fb42
7 changed files with 21 additions and 19 deletions

View file

@ -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

View file

@ -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);
}
}
}

View file

@ -42,6 +42,7 @@
#include <GUI/gui.h>
#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
}

View file

@ -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),

View file

@ -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; }

View file

@ -28,11 +28,6 @@
#include <simgear/compiler.h>
#include <simgear/misc/exception.hxx>
/* normans fix */
#if defined(FX) && defined(XMESA)
bool global_fullscreen = true;
#endif
#include <math.h> // rint()
#include <stdio.h>
#include <stdlib.h> // atof(), atoi()

View file

@ -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 */