MacOS changes by Darrell Walisser.
This commit is contained in:
parent
948f6b05d5
commit
be88681d69
10 changed files with 242 additions and 94 deletions
|
@ -93,16 +93,16 @@ bool FGRunways::search( const string& id, FGRunway* r ) {
|
||||||
|
|
||||||
c4_RowRef row = vRunway->GetAt(index);
|
c4_RowRef row = vRunway->GetAt(index);
|
||||||
|
|
||||||
r->id = (string) pID(row);
|
r->id = (const char *) pID(row);
|
||||||
r->rwy_no = (string) pRwy(row);
|
r->rwy_no = (const char *) pRwy(row);
|
||||||
r->lon = (double) pLon(row);
|
r->lon = (double) pLon(row);
|
||||||
r->lat = (double) pLat(row);
|
r->lat = (double) pLat(row);
|
||||||
r->heading = (double) pHdg(row);
|
r->heading = (double) pHdg(row);
|
||||||
r->length = (double) pLen(row);
|
r->length = (double) pLen(row);
|
||||||
r->width = (double) pWid(row);
|
r->width = (double) pWid(row);
|
||||||
r->surface_flags = (string) pSurf(row);
|
r->surface_flags = (const char *) pSurf(row);
|
||||||
r->end1_flags = (string) pEnd1(row);
|
r->end1_flags = (const char *) pEnd1(row);
|
||||||
r->end2_flags = (string) pEnd2(row);
|
r->end2_flags = (const char *) pEnd2(row);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -142,16 +142,16 @@ bool FGRunways::next( FGRunway* r ) {
|
||||||
|
|
||||||
c4_RowRef row = vRunway->GetAt(index);
|
c4_RowRef row = vRunway->GetAt(index);
|
||||||
|
|
||||||
r->id = (string) pID(row);
|
r->id = (const char *) pID(row);
|
||||||
r->rwy_no = (string) pRwy(row);
|
r->rwy_no = (const char *) pRwy(row);
|
||||||
r->lon = (double) pLon(row);
|
r->lon = (double) pLon(row);
|
||||||
r->lat = (double) pLat(row);
|
r->lat = (double) pLat(row);
|
||||||
r->heading = (double) pHdg(row);
|
r->heading = (double) pHdg(row);
|
||||||
r->length = (double) pLen(row);
|
r->length = (double) pLen(row);
|
||||||
r->width = (double) pWid(row);
|
r->width = (double) pWid(row);
|
||||||
r->surface_flags = (string) pSurf(row);
|
r->surface_flags = (const char *) pSurf(row);
|
||||||
r->end1_flags = (string) pEnd1(row);
|
r->end1_flags = (const char *) pEnd1(row);
|
||||||
r->end2_flags = (string) pEnd2(row);
|
r->end2_flags = (const char *) pEnd2(row);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ int FGRunwaysUtil::load( const string& file ) {
|
||||||
|
|
||||||
#ifdef __MWERKS__
|
#ifdef __MWERKS__
|
||||||
|
|
||||||
in >> skipws;
|
in >> ::skipws;
|
||||||
char c = 0;
|
char c = 0;
|
||||||
while ( in.get(c) && c != '\0' ) {
|
while ( in.get(c) && c != '\0' ) {
|
||||||
if ( c == 'A' ) {
|
if ( c == 'A' ) {
|
||||||
|
@ -202,7 +202,7 @@ int FGRunwaysUtil::load( const string& file ) {
|
||||||
} else {
|
} else {
|
||||||
in >> skipeol;
|
in >> skipeol;
|
||||||
}
|
}
|
||||||
in >> skipws;
|
in >> ::skipws;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -200,7 +200,7 @@ FGPanel::doMouseAction (int button, int updown, int x, int y)
|
||||||
x = (int)(((float)x / current_view.get_winWidth()) * _w);
|
x = (int)(((float)x / current_view.get_winWidth()) * _w);
|
||||||
y = (int)(_h - (((float)y / current_view.get_winHeight()) * _h));
|
y = (int)(_h - (((float)y / current_view.get_winHeight()) * _h));
|
||||||
|
|
||||||
for (int i = 0; i < _instruments.size(); i++) {
|
for (int i = 0; i < (int)_instruments.size(); i++) {
|
||||||
FGPanelInstrument *inst = _instruments[i];
|
FGPanelInstrument *inst = _instruments[i];
|
||||||
int ix = inst->getXPos();
|
int ix = inst->getXPos();
|
||||||
int iy = inst->getYPos();
|
int iy = inst->getYPos();
|
||||||
|
@ -248,7 +248,7 @@ FGPanelAction::~FGPanelAction ()
|
||||||
|
|
||||||
FGAdjustAction::FGAdjustAction (int button, int x, int y, int w, int h,
|
FGAdjustAction::FGAdjustAction (int button, int x, int y, int w, int h,
|
||||||
SGValue * value, float increment,
|
SGValue * value, float increment,
|
||||||
float min, float max, bool wrap=false)
|
float min, float max, bool wrap)
|
||||||
: FGPanelAction(button, x, y, w, h),
|
: FGPanelAction(button, x, y, w, h),
|
||||||
_value(value), _increment(increment), _min(min), _max(max), _wrap(wrap)
|
_value(value), _increment(increment), _min(min), _max(max), _wrap(wrap)
|
||||||
{
|
{
|
||||||
|
@ -450,7 +450,7 @@ FGLayeredInstrument::~FGLayeredInstrument ()
|
||||||
void
|
void
|
||||||
FGLayeredInstrument::draw ()
|
FGLayeredInstrument::draw ()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _layers.size(); i++) {
|
for (int i = 0; i < (int)_layers.size(); i++) {
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(0.0, 0.0, (i / 100.0) + 0.1);
|
glTranslatef(0.0, 0.0, (i / 100.0) + 0.1);
|
||||||
_layers[i]->draw();
|
_layers[i]->draw();
|
||||||
|
@ -474,7 +474,7 @@ FGLayeredInstrument::addLayer (FGInstrumentLayer *layer)
|
||||||
|
|
||||||
int
|
int
|
||||||
FGLayeredInstrument::addLayer (CroppedTexture &texture,
|
FGLayeredInstrument::addLayer (CroppedTexture &texture,
|
||||||
int w = -1, int h = -1)
|
int w, int h)
|
||||||
{
|
{
|
||||||
return addLayer(new FGTexturedLayer(texture, w, h));
|
return addLayer(new FGTexturedLayer(texture, w, h));
|
||||||
}
|
}
|
||||||
|
@ -551,7 +551,7 @@ FGInstrumentLayer::addTransformation (FGPanelTransformation * transformation)
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
FGTexturedLayer::FGTexturedLayer (CroppedTexture &texture, int w, int h)
|
FGTexturedLayer::FGTexturedLayer (const CroppedTexture &texture, int w, int h)
|
||||||
: FGInstrumentLayer(w, h)
|
: FGInstrumentLayer(w, h)
|
||||||
{
|
{
|
||||||
setTexture(texture);
|
setTexture(texture);
|
||||||
|
@ -585,6 +585,33 @@ FGTexturedLayer::draw ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
// Implementation of FGWindowLayer.
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
FGWindowLayer::FGWindowLayer (int w, int h)
|
||||||
|
: FGTexturedLayer (w, h)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
FGWindowLayer::FGWindowLayer (const CroppedTexture &texture, int w, int h)
|
||||||
|
: FGTexturedLayer(texture, w, h)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
FGWindowLayer::~FGWindowLayer ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
FGWindowLayer::draw ()
|
||||||
|
{
|
||||||
|
// doesn't do anything yet
|
||||||
|
FGTexturedLayer::draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// Implementation of FGTextLayer.
|
// Implementation of FGTextLayer.
|
||||||
|
@ -592,7 +619,7 @@ FGTexturedLayer::draw ()
|
||||||
|
|
||||||
FGTextLayer::FGTextLayer (int w, int h, Chunk * chunk1, Chunk * chunk2,
|
FGTextLayer::FGTextLayer (int w, int h, Chunk * chunk1, Chunk * chunk2,
|
||||||
Chunk * chunk3)
|
Chunk * chunk3)
|
||||||
: FGInstrumentLayer(w, h)
|
: FGInstrumentLayer(w, h), _pointSize(14.0)
|
||||||
{
|
{
|
||||||
_color[0] = _color[1] = _color[2] = 0.0;
|
_color[0] = _color[1] = _color[2] = 0.0;
|
||||||
_color[3] = 1.0;
|
_color[3] = 1.0;
|
||||||
|
@ -620,7 +647,7 @@ FGTextLayer::draw ()
|
||||||
glColor4fv(_color);
|
glColor4fv(_color);
|
||||||
transform();
|
transform();
|
||||||
_renderer.setFont(guiFntHandle);
|
_renderer.setFont(guiFntHandle);
|
||||||
_renderer.setPointSize(14);
|
_renderer.setPointSize(_pointSize);
|
||||||
_renderer.begin();
|
_renderer.begin();
|
||||||
_renderer.start3f(0, 0, 0);
|
_renderer.start3f(0, 0, 0);
|
||||||
|
|
||||||
|
@ -628,7 +655,7 @@ FGTextLayer::draw ()
|
||||||
chunk_list::const_iterator it = _chunks.begin();
|
chunk_list::const_iterator it = _chunks.begin();
|
||||||
chunk_list::const_iterator last = _chunks.end();
|
chunk_list::const_iterator last = _chunks.end();
|
||||||
for ( ; it != last; it++) {
|
for ( ; it != last; it++) {
|
||||||
_renderer.puts((*it)->getValue());
|
_renderer.puts((char *)((*it)->getValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
_renderer.end();
|
_renderer.end();
|
||||||
|
@ -652,9 +679,9 @@ FGTextLayer::setColor (float r, float g, float b)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FGTextLayer::setPointSize (const float size)
|
FGTextLayer::setPointSize (float size)
|
||||||
{
|
{
|
||||||
_renderer.setPointSize(size);
|
_pointSize = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -669,37 +696,39 @@ FGTextLayer::setFont(fntFont * font)
|
||||||
// Implementation of FGTextLayer::Chunk.
|
// Implementation of FGTextLayer::Chunk.
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
FGTextLayer::Chunk::Chunk (char * text, char * fmt = "%s")
|
FGTextLayer::Chunk::Chunk (const string &text, const string &fmt)
|
||||||
: _type(FGTextLayer::TEXT), _fmt(fmt)
|
: _type(FGTextLayer::TEXT), _fmt(fmt)
|
||||||
{
|
{
|
||||||
_value._text = text;
|
_text = text;
|
||||||
|
if (_fmt == "")
|
||||||
|
_fmt = "%s";
|
||||||
}
|
}
|
||||||
|
|
||||||
FGTextLayer::Chunk::Chunk (ChunkType type, const SGValue * value,
|
FGTextLayer::Chunk::Chunk (ChunkType type, const SGValue * value,
|
||||||
char * fmt = 0, float mult = 1.0)
|
const string &fmt, float mult)
|
||||||
: _type(type), _fmt(fmt), _mult(mult)
|
: _type(type), _fmt(fmt), _mult(mult)
|
||||||
{
|
{
|
||||||
if (_fmt == 0) {
|
if (_fmt == "") {
|
||||||
if (type == TEXT_VALUE)
|
if (type == TEXT_VALUE)
|
||||||
_fmt = "%s";
|
_fmt = "%s";
|
||||||
else
|
else
|
||||||
_fmt = "%.2f";
|
_fmt = "%.2f";
|
||||||
}
|
}
|
||||||
_value._value = value;
|
_value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
FGTextLayer::Chunk::getValue () const
|
FGTextLayer::Chunk::getValue () const
|
||||||
{
|
{
|
||||||
switch (_type) {
|
switch (_type) {
|
||||||
case TEXT:
|
case TEXT:
|
||||||
sprintf(_buf, _fmt, _value._text);
|
sprintf(_buf, _fmt.c_str(), _text.c_str());
|
||||||
return _buf;
|
return _buf;
|
||||||
case TEXT_VALUE:
|
case TEXT_VALUE:
|
||||||
sprintf(_buf, _fmt, _value._value->getStringValue().c_str());
|
sprintf(_buf, _fmt.c_str(), _value->getStringValue().c_str());
|
||||||
break;
|
break;
|
||||||
case DOUBLE_VALUE:
|
case DOUBLE_VALUE:
|
||||||
sprintf(_buf, _fmt, _value._value->getFloatValue() * _mult);
|
sprintf(_buf, _fmt.c_str(), _value->getFloatValue() * _mult);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return _buf;
|
return _buf;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// panel.hxx - default, 2D single-engine prop instrument panel
|
// panel.hxx - generic support classes for a 2D panel.
|
||||||
//
|
//
|
||||||
// Written by David Megginson, started January 2000.
|
// Written by David Megginson, started January 2000.
|
||||||
//
|
//
|
||||||
|
@ -61,7 +61,7 @@ class FGTextureManager
|
||||||
public:
|
public:
|
||||||
static ssgTexture * createTexture(const string &relativePath);
|
static ssgTexture * createTexture(const string &relativePath);
|
||||||
private:
|
private:
|
||||||
static map<string,ssgTexture *>_textureMap;
|
static map<string,ssgTexture *> _textureMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ private:
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// Cropped texture (should migrate out into FGFS).
|
// Cropped texture (should migrate out into FGFS).
|
||||||
//
|
//
|
||||||
// This class defines a rectangular cropped area of a texture.
|
// This structure wraps an SSG texture with cropping information.
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
struct CroppedTexture
|
struct CroppedTexture
|
||||||
|
@ -150,18 +150,21 @@ public:
|
||||||
FGPanelAction (int button, int x, int y, int w, int h);
|
FGPanelAction (int button, int x, int y, int w, int h);
|
||||||
virtual ~FGPanelAction ();
|
virtual ~FGPanelAction ();
|
||||||
|
|
||||||
|
// Getters.
|
||||||
virtual int getButton () const { return _button; }
|
virtual int getButton () const { return _button; }
|
||||||
virtual int getX () const { return _x; }
|
virtual int getX () const { return _x; }
|
||||||
virtual int getY () const { return _y; }
|
virtual int getY () const { return _y; }
|
||||||
virtual int getWidth () const { return _w; }
|
virtual int getWidth () const { return _w; }
|
||||||
virtual int getHeight () const { return _h; }
|
virtual int getHeight () const { return _h; }
|
||||||
|
|
||||||
|
// Setters.
|
||||||
virtual void setButton (int button) { _button = button; }
|
virtual void setButton (int button) { _button = button; }
|
||||||
virtual void setX (int x) { _x = x; }
|
virtual void setX (int x) { _x = x; }
|
||||||
virtual void setY (int y) { _y = y; }
|
virtual void setY (int y) { _y = y; }
|
||||||
virtual void setWidth (int w) { _w = w; }
|
virtual void setWidth (int w) { _w = w; }
|
||||||
virtual void setHeight (int h) { _h = h; }
|
virtual void setHeight (int h) { _h = h; }
|
||||||
|
|
||||||
|
// Check whether we're in the area.
|
||||||
virtual bool inArea (int button, int x, int y)
|
virtual bool inArea (int button, int x, int y)
|
||||||
{
|
{
|
||||||
return (button == _button &&
|
return (button == _button &&
|
||||||
|
@ -171,6 +174,7 @@ public:
|
||||||
y < _y + _h);
|
y < _y + _h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Perform the action.
|
||||||
virtual void doAction () = 0;
|
virtual void doAction () = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -419,19 +423,50 @@ class FGTexturedLayer : public FGInstrumentLayer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FGTexturedLayer (int w = -1, int h = -1) : FGInstrumentLayer(w, h) {}
|
FGTexturedLayer (int w = -1, int h = -1) : FGInstrumentLayer(w, h) {}
|
||||||
FGTexturedLayer (CroppedTexture &texture, int w = -1, int h = -1);
|
FGTexturedLayer (const CroppedTexture &texture, int w = -1, int h = -1);
|
||||||
virtual ~FGTexturedLayer ();
|
virtual ~FGTexturedLayer ();
|
||||||
|
|
||||||
virtual void draw ();
|
virtual void draw ();
|
||||||
|
|
||||||
virtual void setTexture (CroppedTexture &texture) { _texture = texture; }
|
virtual void setTexture (const CroppedTexture &texture) {
|
||||||
|
_texture = texture;
|
||||||
|
}
|
||||||
virtual CroppedTexture &getTexture () { return _texture; }
|
virtual CroppedTexture &getTexture () { return _texture; }
|
||||||
|
virtual const CroppedTexture &getTexture () const { return _texture; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable CroppedTexture _texture;
|
mutable CroppedTexture _texture;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
// A moving window on a texture.
|
||||||
|
//
|
||||||
|
// This layer automatically recrops a cropped texture based on
|
||||||
|
// property values, creating a moving window over the texture.
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class FGWindowLayer : public FGTexturedLayer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FGWindowLayer (int w = -1, int h = -1);
|
||||||
|
FGWindowLayer (const CroppedTexture &texture, int w = -1, int h = -1);
|
||||||
|
virtual ~FGWindowLayer ();
|
||||||
|
|
||||||
|
virtual void draw ();
|
||||||
|
|
||||||
|
virtual const SGValue * getXValue () const { return _xValue; }
|
||||||
|
virtual void setXValue (const SGValue * value) { _xValue = value; }
|
||||||
|
virtual const SGValue * getYValue () const { return _yValue; }
|
||||||
|
virtual void setYValue (const SGValue * value) { _yValue = value; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
const SGValue * _xValue;
|
||||||
|
const SGValue * _yValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// A text layer of an instrument.
|
// A text layer of an instrument.
|
||||||
|
@ -452,18 +487,16 @@ public:
|
||||||
|
|
||||||
class Chunk {
|
class Chunk {
|
||||||
public:
|
public:
|
||||||
Chunk (char * text, char * fmt = "%s");
|
Chunk (const string &text, const string &fmt = "%s");
|
||||||
Chunk (ChunkType type, const SGValue * value,
|
Chunk (ChunkType type, const SGValue * value,
|
||||||
char * fmt = 0, float mult = 1.0);
|
const string &fmt = "", float mult = 1.0);
|
||||||
|
|
||||||
char * getValue () const;
|
const char * getValue () const;
|
||||||
private:
|
private:
|
||||||
ChunkType _type;
|
ChunkType _type;
|
||||||
union {
|
string _text;
|
||||||
char * _text;
|
const SGValue * _value;
|
||||||
const SGValue * _value;
|
string _fmt;
|
||||||
} _value;
|
|
||||||
char * _fmt;
|
|
||||||
float _mult;
|
float _mult;
|
||||||
mutable char _buf[1024];
|
mutable char _buf[1024];
|
||||||
};
|
};
|
||||||
|
@ -484,6 +517,8 @@ private:
|
||||||
typedef vector<Chunk *> chunk_list;
|
typedef vector<Chunk *> chunk_list;
|
||||||
chunk_list _chunks;
|
chunk_list _chunks;
|
||||||
float _color[4];
|
float _color[4];
|
||||||
|
|
||||||
|
float _pointSize;
|
||||||
// FIXME: need only one globally
|
// FIXME: need only one globally
|
||||||
mutable fntRenderer _renderer;
|
mutable fntRenderer _renderer;
|
||||||
};
|
};
|
||||||
|
|
|
@ -123,6 +123,8 @@ void FGSteam::update ( int timesteps )
|
||||||
current_properties.tieDouble("/steam/gyro-compass-error",
|
current_properties.tieDouble("/steam/gyro-compass-error",
|
||||||
FGSteam::get_DG_err,
|
FGSteam::get_DG_err,
|
||||||
FGSteam::set_DG_err);
|
FGSteam::set_DG_err);
|
||||||
|
current_properties.tieDouble("/steam/mag-compass",
|
||||||
|
FGSteam::get_MH_deg);
|
||||||
}
|
}
|
||||||
_UpdatesPending += timesteps;
|
_UpdatesPending += timesteps;
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,6 +109,69 @@
|
||||||
extern COCKPIT cockpit_;
|
extern COCKPIT cockpit_;
|
||||||
|
|
||||||
|
|
||||||
|
SCALAR CLadot;
|
||||||
|
SCALAR CLq;
|
||||||
|
SCALAR CLde;
|
||||||
|
SCALAR CLob;
|
||||||
|
|
||||||
|
|
||||||
|
SCALAR Cdob;
|
||||||
|
SCALAR Cda; /*Not used*/
|
||||||
|
SCALAR Cdde;
|
||||||
|
|
||||||
|
SCALAR Cma;
|
||||||
|
SCALAR Cmadot;
|
||||||
|
SCALAR Cmq;
|
||||||
|
SCALAR Cmob;
|
||||||
|
SCALAR Cmde;
|
||||||
|
|
||||||
|
SCALAR Clbeta;
|
||||||
|
SCALAR Clp;
|
||||||
|
SCALAR Clr;
|
||||||
|
SCALAR Clda;
|
||||||
|
SCALAR Cldr;
|
||||||
|
|
||||||
|
SCALAR Cnbeta;
|
||||||
|
SCALAR Cnp;
|
||||||
|
SCALAR Cnr;
|
||||||
|
SCALAR Cnda;
|
||||||
|
SCALAR Cndr;
|
||||||
|
|
||||||
|
SCALAR Cybeta;
|
||||||
|
SCALAR Cyp;
|
||||||
|
SCALAR Cyr;
|
||||||
|
SCALAR Cyda;
|
||||||
|
SCALAR Cydr;
|
||||||
|
|
||||||
|
/*nondimensionalization quantities*/
|
||||||
|
/*units here are ft and lbs */
|
||||||
|
SCALAR cbar; /*mean aero chord ft*/
|
||||||
|
SCALAR b; /*wing span ft */
|
||||||
|
SCALAR Sw; /*wing planform surface area ft^2*/
|
||||||
|
SCALAR rPiARe; /*reciprocal of Pi*AR*e*/
|
||||||
|
SCALAR lbare; /*elevator moment arm MAC*/
|
||||||
|
|
||||||
|
SCALAR Weight; /*lbs*/
|
||||||
|
SCALAR MaxTakeoffWeight,EmptyWeight;
|
||||||
|
SCALAR Cg; /*%MAC*/
|
||||||
|
SCALAR Zcg; /*%MAC*/
|
||||||
|
|
||||||
|
|
||||||
|
SCALAR CLwbh,CL,cm,cd,cn,cy,croll,cbar_2V,b_2V,qS,qScbar,qSb;
|
||||||
|
SCALAR CLo,Cdo,Cmo;
|
||||||
|
|
||||||
|
SCALAR F_X_wind,F_Y_wind,F_Z_wind;
|
||||||
|
|
||||||
|
SCALAR long_trim;
|
||||||
|
|
||||||
|
|
||||||
|
SCALAR elevator, aileron, rudder;
|
||||||
|
|
||||||
|
|
||||||
|
SCALAR Flap_Position;
|
||||||
|
|
||||||
|
int Flaps_In_Transit;
|
||||||
|
|
||||||
static SCALAR interp(SCALAR *y_table, SCALAR *x_table, int Ntable, SCALAR x)
|
static SCALAR interp(SCALAR *y_table, SCALAR *x_table, int Ntable, SCALAR x)
|
||||||
{
|
{
|
||||||
SCALAR slope;
|
SCALAR slope;
|
||||||
|
|
|
@ -9,68 +9,68 @@
|
||||||
|
|
||||||
/*global declarations of aero model parameters*/
|
/*global declarations of aero model parameters*/
|
||||||
|
|
||||||
SCALAR CLadot;
|
extern SCALAR CLadot;
|
||||||
SCALAR CLq;
|
extern SCALAR CLq;
|
||||||
SCALAR CLde;
|
extern SCALAR CLde;
|
||||||
SCALAR CLob;
|
extern SCALAR CLob;
|
||||||
|
|
||||||
|
|
||||||
SCALAR Cdob;
|
extern SCALAR Cdob;
|
||||||
SCALAR Cda; /*Not used*/
|
extern SCALAR Cda; /*Not used*/
|
||||||
SCALAR Cdde;
|
extern SCALAR Cdde;
|
||||||
|
|
||||||
SCALAR Cma;
|
extern SCALAR Cma;
|
||||||
SCALAR Cmadot;
|
extern SCALAR Cmadot;
|
||||||
SCALAR Cmq;
|
extern SCALAR Cmq;
|
||||||
SCALAR Cmob;
|
extern SCALAR Cmob;
|
||||||
SCALAR Cmde;
|
extern SCALAR Cmde;
|
||||||
|
|
||||||
SCALAR Clbeta;
|
extern SCALAR Clbeta;
|
||||||
SCALAR Clp;
|
extern SCALAR Clp;
|
||||||
SCALAR Clr;
|
extern SCALAR Clr;
|
||||||
SCALAR Clda;
|
extern SCALAR Clda;
|
||||||
SCALAR Cldr;
|
extern SCALAR Cldr;
|
||||||
|
|
||||||
SCALAR Cnbeta;
|
extern SCALAR Cnbeta;
|
||||||
SCALAR Cnp;
|
extern SCALAR Cnp;
|
||||||
SCALAR Cnr;
|
extern SCALAR Cnr;
|
||||||
SCALAR Cnda;
|
extern SCALAR Cnda;
|
||||||
SCALAR Cndr;
|
extern SCALAR Cndr;
|
||||||
|
|
||||||
SCALAR Cybeta;
|
extern SCALAR Cybeta;
|
||||||
SCALAR Cyp;
|
extern SCALAR Cyp;
|
||||||
SCALAR Cyr;
|
extern SCALAR Cyr;
|
||||||
SCALAR Cyda;
|
extern SCALAR Cyda;
|
||||||
SCALAR Cydr;
|
extern SCALAR Cydr;
|
||||||
|
|
||||||
/*nondimensionalization quantities*/
|
/*nondimensionalization quantities*/
|
||||||
/*units here are ft and lbs */
|
/*units here are ft and lbs */
|
||||||
SCALAR cbar; /*mean aero chord ft*/
|
extern SCALAR cbar; /*mean aero chord ft*/
|
||||||
SCALAR b; /*wing span ft */
|
extern SCALAR b; /*wing span ft */
|
||||||
SCALAR Sw; /*wing planform surface area ft^2*/
|
extern SCALAR Sw; /*wing planform surface area ft^2*/
|
||||||
SCALAR rPiARe; /*reciprocal of Pi*AR*e*/
|
extern SCALAR rPiARe; /*reciprocal of Pi*AR*e*/
|
||||||
SCALAR lbare; /*elevator moment arm MAC*/
|
extern SCALAR lbare; /*elevator moment arm MAC*/
|
||||||
|
|
||||||
SCALAR Weight; /*lbs*/
|
extern SCALAR Weight; /*lbs*/
|
||||||
SCALAR MaxTakeoffWeight,EmptyWeight;
|
extern SCALAR MaxTakeoffWeight,EmptyWeight;
|
||||||
SCALAR Cg; /*%MAC*/
|
extern SCALAR Cg; /*%MAC*/
|
||||||
SCALAR Zcg; /*%MAC*/
|
extern SCALAR Zcg; /*%MAC*/
|
||||||
|
|
||||||
|
|
||||||
SCALAR CLwbh,CL,cm,cd,cn,cy,croll,cbar_2V,b_2V,qS,qScbar,qSb;
|
extern SCALAR CLwbh,CL,cm,cd,cn,cy,croll,cbar_2V,b_2V,qS,qScbar,qSb;
|
||||||
SCALAR CLo,Cdo,Cmo;
|
extern SCALAR CLo,Cdo,Cmo;
|
||||||
|
|
||||||
SCALAR F_X_wind,F_Y_wind,F_Z_wind;
|
extern SCALAR F_X_wind,F_Y_wind,F_Z_wind;
|
||||||
|
|
||||||
SCALAR long_trim;
|
extern SCALAR long_trim;
|
||||||
|
|
||||||
|
|
||||||
SCALAR elevator, aileron, rudder;
|
extern SCALAR elevator, aileron, rudder;
|
||||||
|
|
||||||
|
|
||||||
SCALAR Flap_Position;
|
extern SCALAR Flap_Position;
|
||||||
|
|
||||||
int Flaps_In_Transit;
|
extern int Flaps_In_Transit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,9 @@
|
||||||
|
|
||||||
$Header$
|
$Header$
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.16 2000/09/13 19:51:09 curt
|
||||||
|
MacOS changes by Darrell Walisser.
|
||||||
|
|
||||||
Revision 1.15 2000/06/12 18:52:37 curt
|
Revision 1.15 2000/06/12 18:52:37 curt
|
||||||
Added differential braking (Alex and David).
|
Added differential braking (Alex and David).
|
||||||
|
|
||||||
|
@ -226,7 +229,7 @@ char gear_strings[NUM_WHEELS][12]={"nose","right main", "left main", "tail skid"
|
||||||
percent_brake[1] = Brake_pct[0];
|
percent_brake[1] = Brake_pct[0];
|
||||||
percent_brake[2] = Brake_pct[1];
|
percent_brake[2] = Brake_pct[1];
|
||||||
|
|
||||||
caster_angle_rad[0] = 0.52*Rudder_pedal;
|
caster_angle_rad[0] = 0.03*Rudder_pedal;
|
||||||
|
|
||||||
|
|
||||||
for (i=0;i<num_wheels;i++) /* Loop for each wheel */
|
for (i=0;i<num_wheels;i++) /* Loop for each wheel */
|
||||||
|
|
|
@ -253,9 +253,9 @@ fgJoystickInit()
|
||||||
seen_joystick = true;
|
seen_joystick = true;
|
||||||
|
|
||||||
// Set up range arrays
|
// Set up range arrays
|
||||||
float minRange[naxes];
|
float *minRange = new float[naxes];
|
||||||
float maxRange[naxes];
|
float *maxRange = new float[naxes];
|
||||||
float center[naxes];
|
float *center = new float[naxes];
|
||||||
|
|
||||||
// Initialize with default values
|
// Initialize with default values
|
||||||
js->getMinRange(minRange);
|
js->getMinRange(minRange);
|
||||||
|
@ -430,6 +430,11 @@ fgJoystickInit()
|
||||||
js->setMinRange(minRange);
|
js->setMinRange(minRange);
|
||||||
js->setMaxRange(maxRange);
|
js->setMaxRange(maxRange);
|
||||||
js->setCenter(center);
|
js->setCenter(center);
|
||||||
|
|
||||||
|
//-dw- clean up
|
||||||
|
delete minRange;
|
||||||
|
delete maxRange;
|
||||||
|
delete center;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (seen_joystick)
|
if (seen_joystick)
|
||||||
|
@ -451,7 +456,7 @@ fgJoystickRead()
|
||||||
|
|
||||||
for (int i = 0; i < MAX_JOYSTICKS; i++) {
|
for (int i = 0; i < MAX_JOYSTICKS; i++) {
|
||||||
jsJoystick * js = joysticks[i].js;
|
jsJoystick * js = joysticks[i].js;
|
||||||
float axis_values[joysticks[i].naxes];
|
float *axis_values = new float[joysticks[i].naxes];
|
||||||
if (js->notWorking()) {
|
if (js->notWorking()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -550,6 +555,10 @@ fgJoystickRead()
|
||||||
FG_LOG(FG_INPUT, FG_ALERT, "Failed to set value for "
|
FG_LOG(FG_INPUT, FG_ALERT, "Failed to set value for "
|
||||||
<< jsNames[i] << ' ' << buttonNames[j]);
|
<< jsNames[i] << ' ' << buttonNames[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -dw- cleanup
|
||||||
|
delete axis_values;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
#include <Cockpit/hud.hxx>
|
#include <Cockpit/hud.hxx>
|
||||||
#include <Cockpit/panel.hxx>
|
#include <Cockpit/panel.hxx>
|
||||||
#include <Cockpit/panel_io.hxx>
|
#include <Cockpit/panel_io.hxx>
|
||||||
|
#include <Cockpit/sp_panel.hxx>
|
||||||
#include <GUI/gui.h>
|
#include <GUI/gui.h>
|
||||||
#include <Scenery/tilemgr.hxx>
|
#include <Scenery/tilemgr.hxx>
|
||||||
#include <Objects/matlib.hxx>
|
#include <Objects/matlib.hxx>
|
||||||
|
@ -461,6 +462,12 @@ void GLUTspecialkey(int k, int x, int y) {
|
||||||
current_panel = new_panel;
|
current_panel = new_panel;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
case GLUT_KEY_F4: {
|
||||||
|
delete current_panel;
|
||||||
|
current_panel = fgCreateSmallSinglePropPanel(0, 0, 1024, 768);
|
||||||
|
FG_LOG(FG_INPUT, FG_INFO, "Reverted to built-in panel");
|
||||||
|
return;
|
||||||
|
}
|
||||||
case GLUT_KEY_END: // numeric keypad 1
|
case GLUT_KEY_END: // numeric keypad 1
|
||||||
v->set_goal_view_offset( FG_PI * 0.75 );
|
v->set_goal_view_offset( FG_PI * 0.75 );
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -61,10 +61,10 @@ bool FGILSList::init( FGPath path ) {
|
||||||
#ifdef __MWERKS__
|
#ifdef __MWERKS__
|
||||||
|
|
||||||
char c = 0;
|
char c = 0;
|
||||||
while ( in.get(c) && c != '\0' && n.get_ilstype() != '[' ) {
|
while ( in.get(c) && c != '\0' && ils.get_ilstype() != '[' ) {
|
||||||
in.putback(c);
|
in.putback(c);
|
||||||
in >> ils;
|
in >> ils;
|
||||||
if ( ils.get_type() != '[' ) {
|
if ( ils.get_ilstype() != '[' ) {
|
||||||
ilslist[ils.get_locfreq()].push_back(ils);
|
ilslist[ils.get_locfreq()].push_back(ils);
|
||||||
}
|
}
|
||||||
in >> skipcomment;
|
in >> skipcomment;
|
||||||
|
|
Loading…
Add table
Reference in a new issue