diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/main/main.cpp b/main/main.cpp index 66391ffa7e..9f3b6a2f37 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -56,7 +56,7 @@ #ifdef TOOLS_ENABLED #include "tools/editor/editor_node.h" #include "tools/editor/project_manager.h" -#include "tools/editor/console.h" + #include "tools/pck/pck_packer.h" #endif @@ -714,8 +714,12 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas } - if (rtm>=0 && rtm<3) + if (rtm>=0 && rtm<3) { + if (editor) { + rtm=OS::RENDER_THREAD_SAFE; + } OS::get_singleton()->_render_thread_mode=OS::RenderThreadMode(rtm); + } @@ -1330,6 +1334,12 @@ bool Main::start() { continue; String name = s.get_slicec('/',1); String path = Globals::get_singleton()->get(s); + bool global_var=false; + if (path.begins_with("*")) { + global_var=true; + path=path.substr(1,path.length()-1); + } + RES res = ResourceLoader::load(path); ERR_EXPLAIN("Can't autoload: "+path); ERR_CONTINUE(res.is_null()); @@ -1355,7 +1365,16 @@ bool Main::start() { ERR_EXPLAIN("Path in autoload not a node or script: "+path); ERR_CONTINUE(!n); n->set_name(name); + sml->get_root()->add_child(n); + + if (global_var) { + for(int i=0;i<ScriptServer::get_language_count();i++) { + ScriptServer::get_language(i)->add_global_constant(name,n); + } + } + + } } |