#include <simgear/debug/logstream.hxx>
#include <stdlib.h>
+#include <algorithm>
+
#include <Main/fg_props.hxx>
#include "environment_ctrl.hxx"
FGInterpolateEnvironmentCtrl::~FGInterpolateEnvironmentCtrl ()
{
- int i;
+ unsigned int i;
for (i = 0; i < _boundary_table.size(); i++)
delete _boundary_table[i];
for (i = 0; i < _aloft_table.size(); i++)
void
FGInterpolateEnvironmentCtrl::reinit ()
{
- int i;
+ unsigned int i;
for (i = 0; i < _boundary_table.size(); i++)
delete _boundary_table[i];
for (i = 0; i < _aloft_table.size(); i++)
{
for (int i = 0; i < node->nChildren(); i++) {
const SGPropertyNode * child = node->getChild(i);
- if (!strcmp(child->getName(), "entry") &&
- child->getStringValue("elevation-ft", "")[0] != '\0') {
+ if ( strcmp(child->getName(), "entry") == 0
+ && child->getStringValue("elevation-ft", "")[0] != '\0'
+ && ( child->getDoubleValue("elevation-ft") > 0.1 || i == 0 ) )
+ {
bucket * b = new bucket;
if (i > 0)
b->environment.copy(table[i-1]->environment);
double boundary_transition =
fgGetDouble("/environment/config/boundary-transition-ft", 500);
- double ground_elevation_ft = altitude_ft - altitude_agl_ft;
+ // double ground_elevation_ft = altitude_ft - altitude_agl_ft;
int length = _boundary_table.size();