X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fscripting%2Fscript_interpreter.h;h=c4ecabc31b64b76ebe75fce82d94437eee792efb;hb=0676f7c09ab0d99e5b6a3bf74b9e2b62aaa885d4;hp=df00032836276545d9a86558759bfcf45f999fda;hpb=523d415707de9f777729534f467779d4c5acdf6e;p=supertux.git diff --git a/src/scripting/script_interpreter.h b/src/scripting/script_interpreter.h index df0003283..c4ecabc31 100644 --- a/src/scripting/script_interpreter.h +++ b/src/scripting/script_interpreter.h @@ -13,9 +13,11 @@ class Sector; class ScriptInterpreter : public GameObject { public: - ScriptInterpreter(Sector* sector); + ScriptInterpreter(const std::string& working_dir); ~ScriptInterpreter(); + void register_sector(Sector* sector); + void draw(DrawingContext& ); void update(float ); @@ -32,11 +34,18 @@ public: return _current; } + const std::string& get_working_directory() const + { + return working_directory; + } + private: HSQUIRRELVM v; static ScriptInterpreter* _current; Timer wakeup_timer; + /// this directory is used as base for all filenames used in scripts + std::string working_directory; Scripting::Sound* sound; Scripting::Level* level; };