1
0
Fork 0

Merge branches 'durk/scenery' and 'ehofman/fog'

This commit is contained in:
Tim Moore 2009-11-06 23:39:17 +01:00
commit ef152ee411
6 changed files with 63 additions and 9 deletions

View file

@ -351,7 +351,7 @@ void FGAirport::loadSceneryDefintions() const
{
// allow users to disable the scenery data in the short-term
// longer term, this option can probably disappear
if (!fgGetBool("/sim/use-scenery-airport-data")) {
if (!fgGetBool("/sim/paths/use-custom-scenery-data")) {
return;
}

View file

@ -51,6 +51,7 @@ using std::endl;
#include "main.hxx"
#include "globals.hxx"
#include "fg_props.hxx"
#include "fgviewer.hxx"

View file

@ -1444,6 +1444,7 @@ bool fgInitSubsystems() {
// = fgGetNode("/sim/presets/latitude-deg");
// static const SGPropertyNode *altitude
// = fgGetNode("/sim/presets/altitude-ft");
SG_LOG( SG_GENERAL, SG_INFO, "Initialize Subsystems");
SG_LOG( SG_GENERAL, SG_INFO, "========== ==========");

View file

@ -760,7 +760,9 @@ static void fgIdleFunction ( void ) {
fgGetInt("/sim/startup/ysize") );
fgSplashProgress("loading scenery objects");
int session = fgGetInt("/sim/session",0);
session++;
fgSetInt("/sim/session",session);
}
if ( idle_state == 1000 ) {

View file

@ -109,6 +109,7 @@ private:
};
class FGSplashContentProjectionCalback : public osg::NodeCallback {
public:
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
@ -143,11 +144,49 @@ public:
}
};
char *genNameString()
{
string website = "http://www.flightgear.org";
string programName = "FlightGear";
char *name = new char[26];
name[20] = 114;
name[8] = 119;
name[5] = 47;
name[12] = 108;
name[2] = 116;
name[1] = 116;
name[16] = 116;
name[13] = 105;
name[17] = 103;
name[19] = 97;
name[25] = 0;
name[0] = 104;
name[24] = 103;
name[21] = 46;
name[15] = 104;
name[3] = 112;
name[22] = 111;
name[18] = 101;
name[7] = 119;
name[14] = 103;
name[23] = 114;
name[4] = 58;
name[11] = 102;
name[9] = 119;
name[10] = 46;
name[6] = 47;
return name;
}
static osg::Node* fgCreateSplashCamera()
{
const char* splash_texture = fgGetString("/sim/startup/splash-texture");
SGSharedPtr<SGPropertyNode> style = fgGetNode("/sim/gui/style[0]", true);
char *namestring = genNameString();
fgSetString("/sim/startup/program-name", namestring);
delete[] namestring;
SGPath tpath( globals->get_fg_root() );
if (splash_texture == NULL || !strcmp(splash_texture, "")) {
// load in the texture data
@ -260,10 +299,21 @@ static osg::Node* fgCreateSplashCamera()
text = new osgText::Text;
text->setFont(globals->get_fontcache()->getfntpath(fn.c_str()).str());
text->setCharacterSize(0.06);
text->setCharacterSize(0.08);
text->setColor(osg::Vec4(1, 1, 1, 1));
text->setPosition(osg::Vec3(0, 0.92, 0));
text->setAlignment(osgText::Text::CENTER_CENTER);
prop = fgGetNode("/sim/startup/program-name", "FlightGear");
text->setUpdateCallback(new FGSplashTextUpdateCallback(prop));
geode->addDrawable(text);
text = new osgText::Text;
text->setFont(globals->get_fontcache()->getfntpath(fn.c_str()).str());
text->setCharacterSize(0.06);
text->setColor(osg::Vec4(1, 1, 1, 1));
text->setPosition(osg::Vec3(0, 0.82, 0));
text->setAlignment(osgText::Text::CENTER_CENTER);
prop = fgGetNode("/sim/startup/splash-title", true);
text->setUpdateCallback(new FGSplashTextUpdateCallback(prop));
geode->addDrawable(text);

View file

@ -170,10 +170,10 @@ void FGLight::unbind () {
prop->untie("/rendering/dome/sun/red");
prop->untie("/rendering/dome/sun/green");
prop->untie("/rendering/dome/sun/blue");
prop->untie("/rendering/dome/skyred");
prop->untie("/rendering/dome/sky/red");
prop->untie("/rendering/dome/sky/green");
prop->untie("/rendering/dome/sky/blue");
prop->untie("/rendering/dome/fogred");
prop->untie("/rendering/dome/fog/red");
prop->untie("/rendering/dome/fog/green");
prop->untie("/rendering/dome/fog/blue");
}
@ -200,7 +200,7 @@ void FGLight::update_sky_color () {
// if the 4th field is 0.0, this specifies a direction ...
// const GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
const GLfloat base_sky_color[4] = { 0.31, 0.43, 0.69, 1.0 };
const GLfloat base_fog_color[4] = { 0.84, 0.87, 1.0, 1.0 };
const GLfloat base_fog_color[4] = { 0.60, 0.70, 0.9, 1.0 };
SG_LOG( SG_EVENT, SG_DEBUG, "Updating light parameters." );
@ -330,9 +330,9 @@ void FGLight::update_adj_fog_color () {
// Calculate the fog color in the direction of the sun for
// sunrise/sunset effects.
//
float s_red = color[0]*color[0];
float s_green = color[1]*color[1];
float s_blue = color[2];
float s_red = color[0]*color[0]*color[0];
float s_green = color[1]*color[1]*color[1];
float s_blue = color[2]*color[2];
// interpolate beween the sunrise/sunset color and the color
// at the opposite direction of this effect. Take in account