# defaults to yes
with_threads=yes
AC_ARG_WITH(threads, [ --with-threads Include tile loading threads [default=yes]])
-if test "x$with_threads" = "xno"; then
+if test "x$with_threads" != "xyes"; then
AC_DEFINE([ENABLE_THREADS], 0, [Define to enable threaded tile paging])
else
AC_DEFINE([ENABLE_THREADS], 1, [Define to enable threaded tile paging])
AC_DEFINE([WIN32], 1, [Define for Win32 platforms])
AC_DEFINE([NOMINMAX], 1, [Define for Win32 platforms])
- LIBS="$LIBS -lglut32 -lglu32 -lopengl32"
- LIBS="$LIBS -luser32 -lgdi32"
+ if test "x$enable_sdl" = "xyes"; then
+ AC_SEARCH_LIBS(SDL_Init, SDL)
+ else
+ LIBS="$LIBS -lglut32"
+ fi
+
+ LIBS="$LIBS -lglu32 -lopengl32 -luser32 -lgdi32"
dnl add -lwsock32 for mingwin
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
dnl CygWin under Windoze.
- LIBS="$LIBS -lopenal32 -lwinmm -ldsound -ldxguid -lole32"
+ LIBS="$LIBS -lalut -lopenal32 -lwinmm -ldsound -ldxguid -lole32"
;;
*-apple-darwin*)
int check = 0; // If mes gets overflowed the while loop can go infinite
while ( strchr(&mes[0], crej) != NULL ) { // ie. loop until no more occurances of crej ('@') found
pos = strchr( &mes[0], crej );
- bcopy(pos, &tag[0], 3);
+ memmove(&tag[0], pos, 3);
tag[3] = '\0';
int i;
len = 0;
int check = 0; // If mes gets overflowed the while loop can go infinite
while ( strchr(&mes[0], crej) != NULL ) { // ie. loop until no more occurances of crej ('@') found
pos = strchr( &mes[0], crej );
- bcopy(pos, &tag[0], 3);
+ memmove(&tag[0], pos, 3);
tag[3] = '\0';
int i;
len = 0;
proxy_port( fgGetNode("/sim/presets/proxy/port", true) ),
proxy_auth( fgGetNode("/sim/presets/proxy/authentication", true) )
{
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
thread = new MetarThread(this);
thread->start();
#endif // ENABLE_THREADS
FGMetarEnvironmentCtrl::~FGMetarEnvironmentCtrl ()
{
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
thread->cancel();
thread->join();
#endif // ENABLE_THREADS
}
}
-#ifndef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
// No loader thread running so manually fetch the data
string id = "";
while ( !request_queue.empty() ) {
}
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
/**
*
*/
#include <simgear/structure/subsystem_mgr.hxx>
#include <simgear/environment/metar.hxx>
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
# include <simgear/threads/SGThread.hxx>
# include <simgear/threads/SGQueue.hxx>
#endif
private:
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
/**
* FIFO queue which holds a pointer to the fetched metar data.
*/
queue < FGMetarResult > result_queue;
#endif
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
/**
* This class represents the thread of execution responsible for
* fetching the metar data.
# endif
#endif
-#ifdef _WIN32
+#ifdef _MSC_VER
#define snprintf _snprintf
#endif
#include <string.h>
#include <iostream>
-
+#include <Main/fg_os.hxx> // To set toolkit for pu.h
#include <plib/pu.h>
#include <simgear/debug/logstream.hxx>
# include <config.h>
#endif
+#include <Main/fg_os.hxx>
#include <plib/pu.h>
#include <simgear/compiler.h> // for SG_USING_STD
# include <config.h>
#endif
+#include <Main/fg_os.hxx> // To set toolkit for pu.h
#include <plib/pu.h>
// The mac puts this in a weird location (GLUT/glut.h), so the
// configure script detects the location and defines it as a macro.
+#define _WCHAR_T_DEFINED 1 // Glut needs this, or else it tries to
+ // redefine it
#ifdef HAVE_CONFIG_H
# include <config.h>
# include FG_GLUT_H
*/
FGTileLoader::FGTileLoader()
{
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
// Create and start the loader threads.
for (int i = 0; i < MAX_THREADS; ++i)
{
*/
FGTileLoader::~FGTileLoader()
{
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
// Wake up its time to die.
// queue_cond.broadcast();
FGTileLoader::update()
{
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
// send a signal to the pager thread that it is allowed to load
// another tile
mutex.lock();
}
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
/**
*
*/
#include <simgear/bucket/newbucket.hxx>
#include <simgear/misc/sg_path.hxx>
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
# include <simgear/threads/SGThread.hxx>
# include <simgear/threads/SGQueue.hxx>
#else
private:
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
/**
* FIFO queue of tiles to load from data files.
*/
*/
string tile_path;
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
/**
* Maximum number of threads to create for loading tiles.
*/
#define TEST_LAST_HIT_CACHE
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
SGLockedQueue<FGTileEntry *> FGTileMgr::attach_queue;
SGLockedQueue<FGDeferredModel *> FGTileMgr::model_queue;
#else
}
while ( ! model_queue.empty() ) {
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
FGDeferredModel* dm = model_queue.pop();
#else
FGDeferredModel* dm = model_queue.front();
if ( !model_queue.empty() ) {
// cout << "loading next model ..." << endl;
// load the next tile in the queue
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
FGDeferredModel* dm = model_queue.pop();
#else
FGDeferredModel* dm = model_queue.front();
}
if ( !attach_queue.empty() ) {
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
FGTileEntry* e = attach_queue.pop();
#else
FGTileEntry* e = attach_queue.front();
#include <plib/ssg.h>
#include <simgear/bucket/newbucket.hxx>
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
# include <simgear/threads/SGQueue.hxx>
#endif // ENABLE_THREADS
* model_queue is the set of models that need to be loaded by the
* primary render thread.
*/
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
static SGLockedQueue<FGTileEntry *> attach_queue;
static SGLockedQueue<FGDeferredModel *> model_queue;
#else