1
0
Fork 0

Fix out of order initialization crash (not sure how it worked before

unless some recent changes subtlely changed some init order items around.)
This commit is contained in:
curt 2002-12-11 21:07:30 +00:00
parent 43e48070fe
commit 10baa71a65
3 changed files with 54 additions and 27 deletions

View file

@ -190,6 +190,20 @@ dnl Thread related checks
AC_CHECK_LIB(pthread, pthread_exit)
AC_CHECK_LIB(socket, socket)
dnl check for glut location
AC_CHECK_HEADER(GL/glut.h)
if test "x$ac_cv_header_GL_glut_h" = "xyes"; then
AC_DEFINE([GLUT_H], "GL/glut.h", [Define as glut.h include location])
else
AC_CHECK_HEADER(GLUT/glut.h)
if test "x$ac_cv_header_GLUT_glut_h" = "xyes"; then
AC_DEFINE([GLUT_H], "GLUT/glut.h", [Define as glut.h include location])
else
echo "Neither GL/glut.h nor GLUT/glut.h found. Cannot continue"
exit
fi
fi
dnl check for OpenGL related libraries
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
@ -266,20 +280,6 @@ case "${host}" in
esac
dnl check for glut location
AC_CHECK_HEADER(GL/glut.h)
if test "x$ac_cv_header_GL_glut_h" = "xyes"; then
AC_DEFINE([GLUT_H], "GL/glut.h", [Define as glut.h include location])
else
AC_CHECK_HEADER(GLUT/glut.h)
if test "x$ac_cv_header_GLUT_glut_h" = "xyes"; then
AC_DEFINE([GLUT_H], "GLUT/glut.h", [Define as glut.h include location])
else
echo "Neither GL/glut.h nor GLUT/glut.h found. Cannot continue"
exit
fi
fi
opengl_LIBS="$LIBS"
LIBS="$base_LIBS"

View file

@ -233,12 +233,17 @@ getFreeze ()
static void
setFreeze (bool f)
{
frozen = f;
// Stop sound on a pause
if (f)
globals->get_soundmgr()->pause();
else
globals->get_soundmgr()->resume();
frozen = f;
// Stop sound on a pause
FGSoundMgr *s = globals->get_soundmgr();
if ( s != NULL ) {
if ( f ) {
s->pause();
} else {
s->resume();
}
}
}

View file

@ -42,18 +42,40 @@ FGGlobals *globals;
// Constructor
FGGlobals::FGGlobals() :
subsystem_mgr(new FGSubsystemMgr),
sim_time_sec(0.0),
subsystem_mgr( new FGSubsystemMgr ),
sim_time_sec( 0.0 ),
fg_root( "" ),
fg_scenery( "" ),
#if defined(FX) && defined(XMESA)
fullscreen( true ),
#endif
warp( 0 ),
warp_delta( 0 ),
props(new SGPropertyNode),
initial_state(0),
locale(NULL),
commands(new SGCommandMgr),
io(new FGIO)
time_params( NULL ),
ephem( NULL ),
mag( NULL ),
autopilot( NULL ),
route( NULL ),
soundmgr( NULL ),
environment_mgr( NULL ),
ATC_mgr( NULL ),
ATC_display( NULL ),
AI_mgr( NULL ),
controls( NULL ),
steam( NULL ),
viewmgr( NULL ),
props( new SGPropertyNode ),
initial_state( NULL ),
locale( NULL ),
commands( new SGCommandMgr ),
model_loader( NULL ),
texture_loader( NULL ),
acmodel( NULL ),
model_mgr( NULL ),
channel_options_list( NULL ),
scenery( NULL ),
tile_mgr( NULL ),
io( new FGIO )
{
}