#include <simgear/misc/sg_path.hxx>
#include <simgear/structure/subsystem_mgr.hxx>
#include <simgear/misc/sg_dir.hxx>
+#include <simgear/nasal/cppbind/NasalHash.hxx>
#include <simgear/nasal/nasal.h>
#include <simgear/threads/SGQueue.hxx>
#include <simgear/props/props.hxx>
+// Required only for MSVC
+#ifdef _MSC_VER
+# include <Scripting/NasalModelData.hxx>
+#endif
+
#include <map>
void setCmdArg(SGPropertyNode* aNode);
+ /**
+ * create Nasal props.Node for an SGPropertyNode*
+ * This is the actual ghost, wrapped in a Nasal sugar class.
+ */
+ naRef wrappedPropsNode(SGPropertyNode* aProps);
+
// Callbacks for command and timer bindings
virtual bool handleCommand( const char* moduleName,
const char* fileName,
naContext context() const
{ return _context; }
+
+ nasal::Hash getGlobals() const
+ { return nasal::Hash(_globals, _context); }
// This mechanism is here to allow naRefs to be passed to
// locations "outside" the interpreter. Normally, such a
SGLockedQueue<SGSharedPtr<FGNasalModelData> > _loadList;
SGLockedQueue<SGSharedPtr<FGNasalModelData> > _unloadList;
+ // Delay removing items of the _loadList to ensure the are already attached
+ // to the scene graph (eg. enables to retrieve world position in load
+ // callback).
+ bool _delay_load;
+
//
// FGTimer subclass for handling Nasal timer callbacks.
// See the implementation of the settimer() extension function for
void loadPropertyScripts(SGPropertyNode* n);
void loadScriptDirectory(simgear::Dir nasalDir);
void addModule(std::string moduleName, simgear::PathList scripts);
- void logError(naContext);
+ static void logError(naContext);
naRef parse(const char* filename, const char* buf, int len);
naRef genPropsModule();
SGPropertyNode_ptr _cmdArg;
- int _nextGCKey;
- naRef _gcHash;
- int _callCount;
-
simgear::BufferedLogCallback* _log;
public:
void handleTimer(NasalTimer* t);