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()
// 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;
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 ) {
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;
} else { // FLIPFLOP, RAISE, FALL
- int check = (_offset + _property->getFloatValue() * _factor);
+ bool check = (int)(_offset + _property->getFloatValue() * _factor);
if ((bool)check == _active)
return;