glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ) ;
+
+ /*
+ glEnable( GL_TEXTURE_2D );
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ */
+
if ( _bcloud_orig ) {
Point3D c = globals->get_scenery()->get_center();
sgClouds3d->Set_Cloud_Orig( &c );
glDisable( GL_FOG );
glDisable( GL_LIGHTING );
// cout << "drawing new clouds" << endl;
+
+ glEnable(GL_DEPTH_TEST);
+ glEnable(GL_BLEND);
+ glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ) ;
+
+ /*
+ glEnable( GL_TEXTURE_2D );
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ */
+
sgClouds3d->Draw((sgVec4 *)current__view->get_VIEW());
glEnable( GL_FOG );
glEnable( GL_LIGHTING );
}
// Initialize the localization
-SGPropertyNode *fgInitLocale() {
+SGPropertyNode *fgInitLocale(const char *language) {
SGPropertyNode *c_node = NULL, *d_node = NULL;
+ SGPropertyNode *intl = fgGetNode("/sim/intl");
- //
- // Detect the current language
- //
- char *language = getenv("LANG");
- if (language == NULL) {
- SG_LOG(SG_GENERAL, SG_ALERT, "Unable to detect the current language" );
- language = "C";
- }
-
- SGPropertyNode *intl = fgGetNode("/sim/intl", "");
+ SG_LOG(SG_GENERAL, SG_INFO, "Selected language: " << language );
+ // localization not defined
if (!intl)
return NULL;
+ //
+ // Select the proper language from the list
+ //
vector<SGPropertyNode_ptr> locale = intl->getChildren("locale");
for (unsigned int i = 0; i < locale.size(); i++) {
}
}
+ // No <locale> tags defined
+ if (!c_node)
+ return NULL;
//
// Load the default strings
}
// Initialize the localization routines
- SGPropertyNode *locale = fgInitLocale();
- if (!locale)
- return false;
+ if (globals->get_locale() == NULL) {
+ char *language = getenv("LANG");
+ if (language == NULL) {
+ SG_LOG(SG_GENERAL, SG_ALERT, "Unable to detect the language" );
+ language = "C";
+ }
+
+ SGPropertyNode *locale = fgInitLocale(language);
+ if (!locale) {
+ cerr
+ << "Not internationalization settings specified in preferences.xml"
+ << endl;
- globals->set_locale( locale );
+ return false;
+ }
+ globals->set_locale( locale );
+ }
// Initialize the Window/Graphics environment.
if( !fgGlutInit(&argc, argv) ) {
#include "options.hxx"
#include "viewmgr.hxx"
+// Hack: from main.cxx
+extern SGPropertyNode *fgInitLocale(const char *);
+
SG_USING_STD(string);
SG_USING_NAMESPACE(std);
} else if ( (arg == "--verbose") || (arg == "-v") ) {
// verbose help/usage request
return(FG_OPTIONS_VERBOSE_HELP);
+ } else if ( arg.find( "--language=") == 0 ) {
+ globals->set_locale( fgInitLocale( arg.substr( 11 ).c_str() ) );
} else if ( arg == "--disable-game-mode") {
fgSetBool("/sim/startup/game-mode", false);
} else if ( arg == "--enable-game-mode" ) {
}
if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
- cout << endl << "Config file parse error: " << path << " '"
+ cerr << endl << "Config file parse error: " << path << " '"
<< line << "'" << endl;
fgUsage();
exit(-1);
dirp = ulOpenDir(path.c_str());
if (dirp == NULL) {
- cout << "Unable to open aircraft directory." << endl;
+ cerr << "Unable to open aircraft directory." << endl;
exit(-1);
}