diff -ur CVS\FlightGear\source\src\Instrumentation\mk_viii.cxx FlightGear\src\Instrumentation\mk_viii.cxx --- CVS\FlightGear\source\src\Instrumentation\mk_viii.cxx Thu Oct 23 18:43:35 2008 +++ FlightGear\src\Instrumentation\mk_viii.cxx Mon Nov 03 19:26:22 2008 @@ -2290,7 +2290,8 @@ catch (const sg_exception &e) { SG_LOG(SG_INSTR, SG_ALERT, "Error loading MK VIII sound sample \"" + filename + "\": " + e.getFormattedMessage()); - exit(1); + // WHY exit(1); + return NULL; // should be OK to return NULL } soundmgr->add(sample, refname.str()); diff -ur CVS\FlightGear\source\src\Main\util.cxx FlightGear\src\Main\util.cxx --- CVS\FlightGear\source\src\Main\util.cxx Sun Jul 27 18:25:15 2008 +++ FlightGear\src\Main\util.cxx Mon Nov 03 15:01:32 2008 @@ -17,7 +17,11 @@ // // $Id: util.cxx,v 1.21 2008/07/27 16:25:15 ehofman Exp $ - +#ifdef _MSC_VER +// these MUST be included in this ORDER +#include +#include +#endif #include #include @@ -216,6 +220,16 @@ SGPropertyNode *prop = write ? w : r; prop->setStringValue(str); const char *result = prop->getStringValue(); +#ifdef _MSC_VER + if (result[0]) + return result; + if( str && str[0] ) + { + struct _stat buf; + if( _stat( str, &buf ) == 0 ) + result = str; + } +#endif // _MSC_VER return result[0] ? result : 0; } diff -ur CVS\FlightGear\source\src\Navaids\navrecord.cxx FlightGear\src\Navaids\navrecord.cxx --- CVS\FlightGear\source\src\Navaids\navrecord.cxx Fri Sep 12 10:46:17 2008 +++ FlightGear\src\Navaids\navrecord.cxx Thu Nov 27 15:00:07 2008 @@ -54,7 +54,10 @@ // assign our own defaults, unless the range is not set for some // reason. if (range < 0.1) { - SG_LOG(SG_GENERAL, SG_WARN, "navaid " << ident() << " has no range set, using defaults"); + static int dn_warn1 = 0; + if( !dn_warn1 ) + SG_LOG(SG_GENERAL, SG_WARN, "at least 1 navaid " << ident() << " has no range set, using defaults"); + dn_warn1 = 1; switch (type()) { case NDB: case VOR: diff -ur CVS\FlightGear\source\src\Navaids\positioned.cxx FlightGear\src\Navaids\positioned.cxx --- CVS\FlightGear\source\src\Navaids\positioned.cxx Mon Sep 08 21:25:45 2008 +++ FlightGear\src\Navaids\positioned.cxx Sat Nov 01 19:02:22 2008 @@ -147,6 +147,10 @@ { return a < b->type(); } + bool operator()(const FGPositioned* a, const FGPositioned* b) const + { + return a->type() < b->type(); + } }; static void diff -ur CVS\freeglut\include\GL\freeglut_std.h freeglut\include\GL\freeglut_std.h --- CVS\freeglut\include\GL\freeglut_std.h Sat Apr 19 11:55:12 2008 +++ freeglut\include\GL\freeglut_std.h Fri Oct 31 16:33:48 2008 @@ -55,7 +55,9 @@ # endif # define WIN32_LEAN_AND_MEAN +#ifndef NOMINMAX # define NOMINMAX +#endif // #ifndef NOMINMAX # include /* Windows static library */ diff -ur CVS\PLIB\src\js\jsWindows.cxx PLIB\src\js\jsWindows.cxx --- CVS\PLIB\src\js\jsWindows.cxx Fri Apr 18 11:03:44 2008 +++ PLIB\src\js\jsWindows.cxx Wed Nov 05 14:32:12 2008 @@ -25,6 +25,8 @@ #if defined (UL_WIN32) +extern int getJSName( char * name, int len ); + #define _JS_MAX_AXES_WIN 8 /* X,Y,Z,R,U,V,POV_X,POV_Y */ struct os_specific_s { @@ -117,10 +119,13 @@ // at least for USB. Try to get the real name from the registry. if ( ! os->getOEMProductName ( this, name, sizeof(name) ) ) { - ulSetError ( UL_WARNING, + if ( ! getJSName( name, sizeof(name) ) ) + { + ulSetError ( UL_WARNING, "JS: Failed to read joystick name from registry" ) ; - strncpy ( name, os->jsCaps.szPname, sizeof(name) ) ; + strncpy ( name, os->jsCaps.szPname, sizeof(name) ) ; + } } // Windows joystick drivers may provide any combination of diff -ur CVS\SimGear\source\simgear\magvar\coremag.cxx Simgear\simgear\magvar\coremag.cxx --- CVS\SimGear\source\simgear\magvar\coremag.cxx Wed Sep 10 11:28:57 2008 +++ Simgear\simgear\magvar\coremag.cxx Wed Nov 05 17:59:40 2008 @@ -74,12 +74,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -<<<<<<< coremag.cxx -// $Id: coremag.cxx,v 1.5 2006-10-28 22:12:48 curt Exp $ -======= // $Id: coremag.cxx,v 1.6 2008/07/25 18:35:42 ehofman Exp $ ->>>>>>> 1.6 - #include #include diff -ur CVS\SimGear\source\simgear\nasal\gc.c Simgear\simgear\nasal\gc.c --- CVS\SimGear\source\simgear\nasal\gc.c Sun Oct 05 13:00:46 2008 +++ Simgear\simgear\nasal\gc.c Mon Nov 03 14:28:00 2008 @@ -16,9 +16,11 @@ // Must be called with the giant exclusive lock! static void freeDead() { +#ifdef NDEBUG // problem with this in DEBUG configuration, so chop it! int i; for(i=0; indead; i++) naFree(globals->deadBlocks[i]); +#endif // NDEBUG globals->ndead = 0; } diff -ur CVS\SimGear\source\simgear\nasal\hash.c Simgear\simgear\nasal\hash.c --- CVS\SimGear\source\simgear\nasal\hash.c Sun Oct 05 13:00:46 2008 +++ Simgear\simgear\nasal\hash.c Mon Nov 03 14:32:10 2008 @@ -219,7 +219,9 @@ void naiGCHashClean(struct naHash* h) { +#ifdef NDEBUG // problem with this in Debug, so chop it! naFree(h->rec); +#endif // only in Release h->rec = 0; } diff -ur CVS\SimGear\source\simgear\scene\model\ModelRegistry.cxx Simgear\simgear\scene\model\ModelRegistry.cxx --- CVS\SimGear\source\simgear\scene\model\ModelRegistry.cxx Wed Sep 10 11:29:00 2008 +++ Simgear\simgear\scene\model\ModelRegistry.cxx Sat Nov 01 19:45:50 2008 @@ -345,7 +345,12 @@ Registry* registry = Registry::instance(); ReaderWriter::ReadResult res; res = registry->readImageImplementation(absFileName, opt); - if (res.loadedFromCache()) + if (res.error()) + { + SG_LOG(SG_IO, SG_ALERT, "readImageImplementation FAILED on image file \"" + << fileName << "\" error=" << res.message() ); + return ReaderWriter::ReadResult::FILE_NOT_FOUND; + } else if (res.loadedFromCache()) SG_LOG(SG_IO, SG_INFO, "Returning cached image \"" << res.getImage()->getFileName() << "\""); else diff -ur CVS\SimGear\source\simgear\sound\sample_openal.cxx Simgear\simgear\sound\sample_openal.cxx --- CVS\SimGear\source\simgear\sound\sample_openal.cxx Fri Oct 31 15:14:15 2008 +++ Simgear\simgear\sound\sample_openal.cxx Wed Dec 03 13:35:03 2008 @@ -30,7 +30,11 @@ # include # include #else +#ifdef USE_OPENAL_SDK +# include +#else # include +#endif # include #endif @@ -136,19 +140,8 @@ } #else - // - // pre 1.0 alut version - // - ALvoid* data = load_file(path, file); - - // Copy data to the internal OpenAL buffer - alBufferData( buffer, format, data, size, freq ); - - if ( print_openal_error("constructor (alBufferData)") ) { - throw sg_exception("Failed to buffer data."); - } - - alutUnloadWAV( format, data, size, freq ); +#pragma message("ERROR: ALUT_API_MAJOR_VERSION not defined, or less than 1! Has alut.h been included?") +#error Earlier versions of alut no longer supported by FlightGear #endif print_openal_error("constructor return"); diff -ur CVS\SimGear\source\simgear\sound\sample_openal.hxx Simgear\simgear\sound\sample_openal.hxx --- CVS\SimGear\source\simgear\sound\sample_openal.hxx Fri Oct 31 15:14:15 2008 +++ Simgear\simgear\sound\sample_openal.hxx Sun Nov 02 16:06:38 2008 @@ -48,8 +48,12 @@ # include # include #else +#ifdef USE_OPENAL_SDK +# include +#else # include # include +#endif #endif #ifndef HAVE_WINDOWS_H diff -ur CVS\SimGear\source\simgear\sound\soundmgr_openal.cxx Simgear\simgear\sound\soundmgr_openal.cxx --- CVS\SimGear\source\simgear\sound\soundmgr_openal.cxx Wed Sep 10 11:29:08 2008 +++ Simgear\simgear\sound\soundmgr_openal.cxx Wed Dec 03 13:53:28 2008 @@ -33,9 +33,14 @@ # include # include #else +#ifdef USE_OPENAL_SDK +# include +# include +#else # include # include #endif +#endif #if defined (__APPLE__) # ifdef __GNUC__ @@ -104,15 +109,8 @@ context = alcGetCurrentContext(); } #else - if ( (dev = alcOpenDevice( NULL )) != NULL - && ( context = alcCreateContext( dev, NULL )) != NULL ) { - working = true; - alcMakeContextCurrent( context ); - } else { - working = false; - context = 0; - SG_LOG( SG_GENERAL, SG_ALERT, "Audio initialization failed!" ); - } +#pragma message("WARNING: ALUT_API_MAJOR_VERSION not set or less that 1! Has alut.h been included?") +#error Earlier versions of alut no longer supported by FlightGear #endif listener_pos[0] = 0.0; diff -ur CVS\SimGear\source\simgear\sound\soundmgr_openal.hxx Simgear\simgear\sound\soundmgr_openal.hxx --- CVS\SimGear\source\simgear\sound\soundmgr_openal.hxx Fri Oct 31 15:14:15 2008 +++ Simgear\simgear\sound\soundmgr_openal.hxx Sun Nov 02 16:06:38 2008 @@ -46,8 +46,13 @@ # include # include #else +#ifdef USE_OPENAL_SDK +# include +# include +#else # include # include +#endif #endif #include "sample_openal.hxx" diff -ur -N CVS\PLIB\src\js\jsName.cxx PLIB\src\js\jsName.cxx --- CVS\PLIB\src\js\jsName.cxx Thu Jan 01 01:00:00 1970 +++ PLIB\src\js\jsName.cxx Wed Nov 05 14:54:10 2008 @@ -0,0 +1,107 @@ + +// jsName.cxx +// get and return the _FIRST_ active joystick name +// 05NOV2008 - geoff mclane - http://geoffair.net/fg/ +// + +// ensure NOT using UNICODE +#ifdef UNICODE +#undef UNICODE +#endif +#ifdef _UNICODE +#undef _UNICODE +#endif + +#define STRICT // why not ... +#define DIRECTINPUT_VERSION 0x0800 // set DirectX version +#ifndef _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE // disable depreciation warnings +#endif +#pragma warning( disable : 4996 ) // make sure to disable ALL deprecated warning + +#include +#include +#include "js.h" + +#if defined (UL_WIN32) + +#pragma comment (lib, "dxguid.lib") /* link DirectX IID_IDirectInput interface lib */ +#pragma comment (lib, "dinput8.lib") /* link DirectX DirectInput interface lib */ + +#define JS_SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } } + +// structure for collecting the information +typedef struct tagJSNAME { + LPDIRECTINPUT8 pDI; + LPDIRECTINPUTDEVICE8 pJoystick; + char * pName; + UINT uiLen; +}JSNAME, * PJSNAME; + +//----------------------------------------------------------------------------- +// Name: EnumJSCallback() +// Desc: Called once for each enumerated joystick. If one found, create a +// device interface on it so we can get its name. +//----------------------------------------------------------------------------- +BOOL CALLBACK EnumJSCallback( const DIDEVICEINSTANCE* pdidInstance, + VOID* pContext ) +{ + HRESULT hr; + PJSNAME pjsn = (PJSNAME)pContext; + // UNREFERENCED_PARAMETER( pContext ); + if( pjsn && pjsn->pDI && pjsn->pName && pjsn->uiLen ) + { + // Obtain an interface to the enumerated joystick. + hr = pjsn->pDI->CreateDevice( pdidInstance->guidInstance, &pjsn->pJoystick, NULL ); + if( FAILED(hr) ) + return DIENUM_CONTINUE; // try for next + + //StringCchCopy( pjsn->pName, pjsn->uiLen, pdidInstance->tszProductName ); + if( strlen(pdidInstance->tszProductName) < pjsn->uiLen ) + strcpy(pjsn->pName,pdidInstance->tszProductName); + else + strncpy(pjsn->pName, pdidInstance->tszProductName, pjsn->uiLen); + + } + return DIENUM_STOP; // stop on first +} + +int getJSName( char * name, int len ) +{ + if( !name || !len ) + return 0; + + JSNAME jsn; + jsn.pName = name; + jsn.uiLen = len; + jsn.pDI = NULL; + jsn.pJoystick = NULL; + + // Register with the DirectInput subsystem and get a pointer + // to a IDirectInput interface we can use. + // Create a DInput object + HRESULT hr; + if( FAILED( hr = DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION, + IID_IDirectInput8, (VOID**)&jsn.pDI, NULL ) ) ) + return 0; + + // Look for a simple joystick we can use for this sample program. + if( FAILED( hr = jsn.pDI->EnumDevices( DI8DEVCLASS_GAMECTRL, + EnumJSCallback, &jsn, DIEDFL_ATTACHEDONLY ) ) ) + { + JS_SAFE_RELEASE( jsn.pDI ); + return 0; + } + + if( jsn.pJoystick ) + jsn.pJoystick->Unacquire(); + + // Release any DirectInput objects. + JS_SAFE_RELEASE( jsn.pJoystick ); + JS_SAFE_RELEASE( jsn.pDI ); + + return 1; // return SUCCESS +} + +#endif // if defined (UL_WIN32) +// jsName.cxx