#include <osg/GraphicsContext>
#include <osgDB/Registry>
+#if defined(HAVE_CRASHRPT)
+ #include <CrashRpt.h>
+#endif
+
// Class references
#include <simgear/canvas/VGInitOperation.hxx>
#include <simgear/scene/model/modellib.hxx>
#include <simgear/scene/material/matlib.hxx>
+#include <simgear/scene/material/Effect.hxx>
#include <simgear/props/AtomicChangeListener.hxx>
#include <simgear/props/props.hxx>
#include <simgear/timing/sg_time.hxx>
#include "fg_os.hxx"
#include "fg_props.hxx"
#include "positioninit.hxx"
+#include "screensaver_control.hxx"
#include "subsystemFactory.hxx"
#include "options.hxx"
+
using namespace flightgear;
using std::cerr;
static void initTerrasync()
{
+ // add the terrasync root as a data path so data can be retrieved from it
+ // (even if we are in read-only mode)
+ std::string terraSyncDir(fgGetString("/sim/terrasync/scenery-dir"));
+ globals->append_data_path(terraSyncDir);
+
if (fgGetBool("/sim/fghome-readonly", false)) {
return;
}
terra_sync->bind();
terra_sync->init();
-
- // add the terrasync root as a data path so data can be retrieved from it
- std::string terraSyncDir(fgGetString("/sim/terrasync/scenery-dir"));
- globals->append_data_path(terraSyncDir);
}
static void registerMainLoop()
logPath.append("fgfs.log");
}
sglog().logToFile(logPath, SG_ALL, SG_INFO);
+
+#if defined(HAVE_CRASHRPT)
+ crAddFile2(logPath.c_str(), NULL, "FlightGear Log File", CR_AF_MAKE_FILE_COPY);
+#endif
}
// Main top level initialization
fgOutputSettings();
+ //try to disable the screensaver
+ fgOSDisableScreensaver();
+
// pass control off to the master event handler
int result = fgOSMainLoop();
frame_signal.clear();
fgOSCloseWindow();
+ simgear::clearEffectCache();
+
// clean up here; ensure we null globals to avoid
// confusing the atexit() handler
delete globals;