diff --git a/src/Objects/obj.cxx b/src/Objects/obj.cxx index 769000d2e..5a78d63ed 100644 --- a/src/Objects/obj.cxx +++ b/src/Objects/obj.cxx @@ -908,10 +908,11 @@ bool fgBinObjLoad( const string& path, const bool is_base, ssgVertexArray *ground_lights ) { SGBinObject obj; - bool result = obj.read_bin( path ); - if ( !result ) { + if ( ! obj.read_bin( path ) ) { return false; + } else { + cout << "succeeded: " << path << endl; } // cout << "fans size = " << obj.get_fans_v().size() diff --git a/src/Scenery/tileentry.cxx b/src/Scenery/tileentry.cxx index a16396091..a1bbf12d5 100644 --- a/src/Scenery/tileentry.cxx +++ b/src/Scenery/tileentry.cxx @@ -1043,11 +1043,13 @@ bool FGTileEntry::obj_load( const std::string& path, // next try the older ascii format, this is some ugly // weirdness because the ascii loader is *old* and hasn't been // updated, but hopefully we can can the ascii format soon. + cout << "attempting ascii load generating ocean tile" << endl; ssgBranch *tmp = fgAsciiObjLoad( path, this, ground_lights, is_base ); if ( tmp ) { return tmp; } else { // default to an ocean tile + cout << "generating ocean tile" << endl; if ( fgGenTile( path, tile_bucket, &c, &br, geometry ) ) { center = c; bounding_radius = br; @@ -1255,6 +1257,21 @@ FGTileEntry::load( const SGPath& base, bool is_base ) in >> ::skipws; } } + } else { + // no .stg file, generate an ocean tile on the fly for this + // area + ssgBranch *geometry = new ssgBranch; + Point3D c; + double br; + if ( fgGenTile( basename.str(), tile_bucket, &c, &br, geometry ) ) { + center = c; + bounding_radius = br; + new_tile -> addKid( geometry ); + } else { + delete geometry; + SG_LOG( SG_TERRAIN, SG_ALERT, + "Warning: failed to generate ocean tile!" ); + } } if ( new_tile != NULL ) { diff --git a/src/Sound/fg_sound.cxx b/src/Sound/fg_sound.cxx index aa22b6fed..9d193cc0c 100644 --- a/src/Sound/fg_sound.cxx +++ b/src/Sound/fg_sound.cxx @@ -272,7 +272,7 @@ FGSound::update (int dt) if ((_type == FGSound::LEVEL) || (_type == FGSound::INVERTED)) { - int check = (_offset + _property->getFloatValue() * _factor); + bool check = (int)(_offset + _property->getFloatValue() * _factor); if (_type == FGSound::INVERTED) check = !check; @@ -297,7 +297,7 @@ FGSound::update (int dt) } else { // FLIPFLOP, RAISE, FALL - int check = (_offset + _property->getFloatValue() * _factor); + bool check = (int)(_offset + _property->getFloatValue() * _factor); if ((bool)check == _active) return;