From aea664cd1589e8170261f45413f3cd30788fe98b Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 17 May 2001 21:55:22 +0000 Subject: [PATCH] MSVC++ changes contributed by Geoff McLane. --- src/Airports/runways.hxx | 6 ++ src/FDM/UIUCModel/uiuc_menu.cpp | 2 +- src/GUI/gui.cxx | 4 + src/Include/config.h-msvc6 | 148 +++++++++++++++++--------------- src/Main/main.cxx | 8 ++ src/NetworkOLK/Tools/fgd.h | 6 ++ src/NetworkOLK/fgd.h | 6 ++ 7 files changed, 108 insertions(+), 72 deletions(-) diff --git a/src/Airports/runways.hxx b/src/Airports/runways.hxx index 09fa3e632..5512097d8 100644 --- a/src/Airports/runways.hxx +++ b/src/Airports/runways.hxx @@ -49,10 +49,16 @@ #include STL_STRING #include +#ifndef _MSC_VER #define NDEBUG // she don't work without it. +#endif // !_MSC_VER + #include #include + +#ifndef _MSC_VER #undef NDEBUG +#endif // !_MSC_VER SG_USING_STD(string); SG_USING_STD(vector); diff --git a/src/FDM/UIUCModel/uiuc_menu.cpp b/src/FDM/UIUCModel/uiuc_menu.cpp index d94d95326..34ee6626e 100644 --- a/src/FDM/UIUCModel/uiuc_menu.cpp +++ b/src/FDM/UIUCModel/uiuc_menu.cpp @@ -109,7 +109,7 @@ SG_USING_STD(cerr); SG_USING_STD(cout); SG_USING_STD(endl); -# ifndef _MSC_VR +# ifndef _MSC_VER SG_USING_STD(exit); # endif #endif diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index a0916ca59..e9fb301de 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -92,6 +92,10 @@ SG_USING_STD(string); SG_USING_STD(cout); #endif +#ifdef _MSC_VER +#define snprintf _snprintf +#endif /* _MSC_VER */ + // main.cxx hack, should come from an include someplace extern void fgInitVisuals( void ); extern void fgReshape( int width, int height ); diff --git a/src/Include/config.h-msvc6 b/src/Include/config.h-msvc6 index b38c5296c..8da1420cd 100644 --- a/src/Include/config.h-msvc6 +++ b/src/Include/config.h-msvc6 @@ -1,59 +1,49 @@ -/* src/Include/config.h. Generated automatically by configure. */ -/* src/Include/config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define if you have the vprintf function. */ -#define HAVE_VPRINTF 1 - -/* Define as the return type of signal handlers (int or void). */ -#define RETSIGTYPE void - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 +/* Special single config.h for MSVC6 build - Geoff McLane - 10 May, 2001 */ /* Define if the X Window System is missing or not being used. */ #define X_DISPLAY_MISSING 1 -/* Define to enable audio support */ -#define ENABLE_AUDIO_SUPPORT 1 - -/* Define to enable plib joystick support (recommended) */ -#define ENABLE_PLIB_JOYSTICK 1 - -/* Define to eliminate all trace of debugging messages such as for a - release build */ -/* #undef FG_NDEBUG */ - -/* Define to include Oliver's networking support */ -/* #undef FG_NETWORK_OLK */ - -/* Define to avoid Christian's new weather code */ -/* #undef FG_OLD_WEATHER */ - -/* Define if we are building FGFS (should always be defined) */ -#define FGFS 1 +/* Define to empty if the keyword does not work. */ +/* #undef const */ -/* Define to enable 3dfx/glide render in a window hack under unix. - This probably won't work under windows. */ -/* #define XMESA 1 */ -/* #define FX 1 */ +/* Define if you don't have vprintf but do have _doprnt. */ +/* #undef HAVE_DOPRNT */ -/* Define if you external variables daylight. */ -/* #define HAVE_DAYLIGHT 1 */ +/* Define if you have the vprintf function. */ +#define HAVE_VPRINTF 1 -/* Define if you external variables timezone. */ -/* #define HAVE_TIMEZONE 1 */ +/* Define to package name - not used? */ +#define PACKAGE "FlightGear" -/* Define if you have MetaKit installed system wide. */ -#define HAVE_MK4 1 +/* Define to package version - use in main.cxx */ +#define FLIGHTGEAR_VERSION "MSVC6-FGFS32-0.7.7" -/* Define if you have zlib installed system wide. */ -/* #define HAVE_ZLIB 1 */ +/* Define as the return type of signal handlers (int or void). */ +#define RETSIGTYPE void + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if you can safely include both and . */ +/* #undef TIME_WITH_SYS_TIME */ + +/* Define if your declares struct tm. */ +#define TM_IN_SYS_TIME 1 + +/* Define to version number */ +#define VERSION "0.57" +#ifndef FG_VERSION /* allow override */ +#define FG_VERSION 7 +#endif /* FG_VERSION */ /* Define if compiling on a Winbloze (95, NT, etc.) platform */ #define WIN32 1 -/* Define if you have the bcopy function. */ -/* #define HAVE_BCOPY 1 */ +/* Define if you have the GetLocalTime function. */ +#define HAVE_GETLOCALTIME 1 /* Define if you have the ftime function. */ #define HAVE_FTIME 1 @@ -61,18 +51,12 @@ /* Define if you have the getitimer function. */ /* #define HAVE_GETITIMER 1 */ -/* Define if you have the GetLocalTime function. */ -#define HAVE_GETLOCALTIME 1 - /* Define if you have the getrusage function. */ /* #define HAVE_GETRUSAGE 1 */ /* Define if you have the gettimeofday function. */ /* #define HAVE_GETTIMEOFDAY 1 */ -/* Define if you have the memcpy function. */ -#define HAVE_MEMCPY 1 - /* Define if you have the mktime function. */ #define HAVE_MKTIME 1 @@ -80,7 +64,7 @@ #define HAVE_RAND 1 /* Define if you have the random function. */ -/* #define HAVE_RANDOM 1 */ +#define HAVE_RANDOM 1 /* Define if you have the rint function. */ /* #define HAVE_RINT 1 */ @@ -94,36 +78,24 @@ /* Define if you have the strstr function. */ #define HAVE_STRSTR 1 -/* Define if you have the timegm function. */ -/* #define HAVE_TIMEGM 1 */ - /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ -/* #define HAVE_GETOPT_H 1 */ +#define HAVE_GETOPT_H 1 /* Define if you have the header file. */ #define HAVE_MALLOC_H 1 -/* Define if you have the header file. */ -#define HAVE_MEMORY_H 1 - /* Define if you have the header file. */ #define HAVE_STDLIB_H 1 -/* Define if you have the header file. */ -/* #define HAVE_SYS_PARAM_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_SYS_STAT_H 1 +/* Define if you have the header file. */ +/* #define HAVE_SYS_TIME_H 1 */ /* Define if you have the header file. */ #define HAVE_SYS_TIMEB_H 1 -/* Define if you have the header file. */ -/* #define HAVE_SYS_TIME_H 1 */ - /* Define if you have the header file. */ /* #define HAVE_UNISTD_H 1 */ @@ -139,17 +111,51 @@ /* Define if you have the GL library (-lGL). */ #define HAVE_LIBGL 1 +/* Define if you have the GLU library (-lGLU). */ +#define HAVE_LIBGLU 1 + /* Define if you have the GLcore library (-lGLcore). */ /* #undef HAVE_LIBGLCORE */ -/* Define if you have the GLU library (-lGLU). */ -#define HAVE_LIBGLU 1 +/* Define if you have the ICE library (-lICE). */ +/* #define HAVE_LIBICE 1 */ + +/* Define if you have the MesaGL library (-lMesaGL). */ +/* #undef HAVE_LIBMESAGL */ + +/* Define if you have the MesaGLU library (-lMesaGLU). */ +/* #undef HAVE_LIBMESAGLU */ + +/* Define if you have the SM library (-lSM). */ +/* #define HAVE_LIBSM 1 */ + +/* Define if you have the X11 library (-lX11). */ +/* #define HAVE_LIBX11 1 */ + +/* Define if you have the Xext library (-lXext). */ +/* #define HAVE_LIBXEXT 1 */ + +/* Define if you have the Xi library (-lXi). */ +/* #define HAVE_LIBXI 1 */ + +/* Define if you have the Xmu library (-lXmu). */ +/* #define HAVE_LIBXMU 1 */ + +/* Define if you have the Xt library (-lXt). */ +/* #define HAVE_LIBXT 1 */ /* Define if you have the glut library (-lglut). */ #define HAVE_LIBGLUT 1 -/* Define if you have the plibul library (-lplibul). */ -/* #undef HAVE_LIBPLIBUL */ +/* Define if you have the m library (-lm). */ +#define HAVE_LIBM 1 + +/* Define if you have the socket library (-lsocket). */ +/* #undef HAVE_LIBSOCKET */ + +/* Define if you have the header file. */ +#define HAVE_MEMORY_H 1 + +#define HAVE_MEMCPY 1 + -/* Name of package */ -#define PACKAGE "FlightGear" diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 07369723f..27df4f040 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -1591,6 +1591,14 @@ int main( int argc, char **argv ) { ssgTexturePath( (char *)full_model.dir().c_str() ); ssgEntity *acmodel_obj = ssgLoad( (char *)full_model.c_str() ); + if( !acmodel_obj ) { + // fall back to default + acmodel_obj = ssgLoad( (char *)"glider.ac" ); + if( !acmodel_obj ) { + SG_LOG( SG_GENERAL, SG_ALERT, "FAILED to LOAD an AC model! ..." ); + exit(-1); + } + } // find moving parts (if this is an MDL model) flaps_selector = (ssgSelector*)fgFindNode( acmodel_obj, "FLAPS" ); diff --git a/src/NetworkOLK/Tools/fgd.h b/src/NetworkOLK/Tools/fgd.h index ceedb5a74..23510497c 100644 --- a/src/NetworkOLK/Tools/fgd.h +++ b/src/NetworkOLK/Tools/fgd.h @@ -1,3 +1,7 @@ + + +#ifndef _MSC_VER + #include #include #include @@ -17,3 +21,5 @@ int MSG_PEEK = 0x02; /* Peek at incoming messages. */ int MSG_WAITALL = 0x100; /* Wait for a full request. */ #define MSG_WAITALL MSG_WAITALL #endif + +#endif /* !_MSC_VER */ diff --git a/src/NetworkOLK/fgd.h b/src/NetworkOLK/fgd.h index ee9cc19d6..74883cdfc 100644 --- a/src/NetworkOLK/fgd.h +++ b/src/NetworkOLK/fgd.h @@ -1,3 +1,7 @@ + + +#ifndef _MSC_VER + #include #include #include @@ -15,3 +19,5 @@ #ifndef MSG_WAITALL #define MSG_WAITALL 0x100 /* Wait for a full request. */ #endif + +#endif /* !_MSC_VER */