Philosopher wrote:[...] I would prefer to leave [the] changes [for early Nasal init] to you - you're experienced with the whole FlightGear code base, and unless I gain lots of knowledge, I wouldn't know how to change things.
Philosopher wrote:[...] I would prefer to leave [the] changes [for early Nasal init] to you - you're experienced with the whole FlightGear code base, and unless I gain lots of knowledge, I wouldn't know how to change things.
-DFG_NASAL_BOOTSTRAP=ON
CMake Warning:
Manually-specified variables were not used by the project:
FG_NASAL_BOOTSTRAP
Philosopher wrote in Sun Nov 17, 2013 11:54 pm:instead of concatenation and continuously storing that in memory.) I don't think SQLite is something I could implement, and I don't know if it would improve speed any.
Philosopher wrote:I'll revisit bootstrapping soon, because it's the only sane way to resolve dependencies (intra-module or even subsystem support).
Philosopher wrote in Wed Jul 09, 2014 7:23 pm:Regarding initialization order of subsystems in Nasal: it is doable but maybe a little dangerous, because if it isn't done correctly it can crash FG. That's about the only comment I have, I'm not familiar with the init process....
Philosopher wrote in Wed Jul 09, 2014 7:23 pm:Yeah, that's basically the current state. I was trying to make it more configurable/flexible, which is where I got stuck (reimplementing the same behavior wasn't too hard).
diff --git a/src/Main/options.cxx b/src/Main/options.cxx
index 0389faa..26eac9c 100644
--- a/src/Main/options.cxx
+++ b/src/Main/options.cxx
@@ -1434,8 +1434,9 @@ struct OptionDesc {
int (*func)( const char * );
} fgOptionArray[] = {
+ {"mode", true, OPTION_STRING, "/sim/startup/boot-script", false, "default", 0 },
{"language", true, OPTION_IGNORE, "", false, "", 0 },
- {"console", false, OPTION_IGNORE, "", false, "", 0 },
+ {"console", false, OPTION_IGNORE, "", false, "", 0 },
{"disable-rembrandt", false, OPTION_BOOL, "/sim/rendering/rembrandt/enabled", false, "", 0 },
{"enable-rembrandt", false, OPTION_BOOL, "/sim/rendering/rembrandt/enabled", true, "", 0 },
{"renderer", true, OPTION_STRING, "/sim/rendering/rembrandt/renderer", false, "", 0 },
diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx
index fde6319..b8c2114 100644
--- a/src/Scripting/NasalSys.cxx
+++ b/src/Scripting/NasalSys.cxx
@@ -833,6 +833,7 @@ void FGNasalSys::init()
.member("singleShot", &TimerObj::isSingleShot, &TimerObj::setSingleShot)
.member("isRunning", &TimerObj::isRunning);
+#if 0
// Now load the various source files in the Nasal directory
simgear::Dir nasalDir(SGPath(globals->get_fg_root(), "Nasal"));
loadScriptDirectory(nasalDir);
@@ -845,6 +846,20 @@ void FGNasalSys::init()
simgear::PathList scripts = dir.children(simgear::Dir::TYPE_FILE, ".nas");
addModule(directories[i].file(), scripts);
}
+#endif
+
+ const char* boot_script = fgGetString("/sim/startup/boot-script", "default");
+ SGPath fullpath(globals->get_fg_root(), "Boot");
+ fullpath.append(boot_script);
+ fullpath.concat(".boot");
+
+
+ SG_LOG(SG_NASAL, SG_INFO, "Using boot script:" << fullpath);
+ SGPath file = fullpath.file();
+ if(!loadModule(fullpath, "boot")) {
+ SG_LOG(SG_NASAL, SG_ALERT, "Error could not load boot script:" << fullpath);
+ exit(-1);
+ }
// set signal and remove node to avoid restoring at reinit
const char *s = "nasal-dir-initialized";
Users browsing this forum: No registered users and 1 guest