X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FScripting%2FNasalSys.hxx;h=b5b3d00d4c65b2827ecb923710d040a55f744931;hb=ce09c320d32728dd9c5eb0d6b4ab9f4683242cbc;hp=fc24f9959b9d57fe3e53d73619b8a1a4a0c3753b;hpb=f2c267f5d736652f602aa236554000aa484fe423;p=flightgear.git diff --git a/src/Scripting/NasalSys.hxx b/src/Scripting/NasalSys.hxx index fc24f9959..b5b3d00d4 100644 --- a/src/Scripting/NasalSys.hxx +++ b/src/Scripting/NasalSys.hxx @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -108,6 +109,9 @@ public: 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 @@ -130,6 +134,11 @@ private: SGLockedQueue > _loadList; SGLockedQueue > _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 @@ -153,7 +162,7 @@ private: 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(); @@ -163,10 +172,6 @@ private: SGPropertyNode_ptr _cmdArg; - int _nextGCKey; - naRef _gcHash; - int _callCount; - simgear::BufferedLogCallback* _log; public: void handleTimer(NasalTimer* t);