mirror of
https://github.com/godotengine/godot.git
synced 2024-10-22 21:21:53 +00:00
Compare commits
4 Commits
c25835e440
...
1839918b2f
Author | SHA1 | Date | |
---|---|---|---|
|
1839918b2f | ||
|
533c616cb8 | ||
|
d5d509bbd6 | ||
|
0633da10e1 |
|
@ -2089,16 +2089,10 @@ void EditorFileSystem::_update_script_documentation() {
|
|||
for (int i = 0; i < ScriptServer::get_language_count(); i++) {
|
||||
ScriptLanguage *lang = ScriptServer::get_language(i);
|
||||
if (lang->supports_documentation() && efd->files[index]->type == lang->get_type()) {
|
||||
bool should_reload_script = _should_reload_script(path);
|
||||
Ref<Script> scr = ResourceLoader::load(path);
|
||||
if (scr.is_null()) {
|
||||
continue;
|
||||
}
|
||||
if (should_reload_script) {
|
||||
// Reloading the script from disk. Otherwise, the ResourceLoader::load will
|
||||
// return the last loaded version of the script (without the modifications).
|
||||
scr->reload_from_file();
|
||||
}
|
||||
for (const DocData::ClassDoc &cd : scr->get_documentation()) {
|
||||
EditorHelp::get_doc_data()->add_doc(cd);
|
||||
if (!first_scan) {
|
||||
|
@ -2119,25 +2113,6 @@ void EditorFileSystem::_update_script_documentation() {
|
|||
update_script_paths_documentation.clear();
|
||||
}
|
||||
|
||||
bool EditorFileSystem::_should_reload_script(const String &p_path) {
|
||||
if (first_scan) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Ref<Script> scr = ResourceCache::get_ref(p_path);
|
||||
if (scr.is_null()) {
|
||||
// Not a script or not already loaded.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Scripts are reloaded via the script editor if they are currently opened.
|
||||
if (ScriptEditor::get_singleton()->get_open_scripts().has(scr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void EditorFileSystem::_process_update_pending() {
|
||||
_update_script_classes();
|
||||
// Parse documentation second, as it requires the class names to be loaded
|
||||
|
|
|
@ -301,7 +301,6 @@ class EditorFileSystem : public Node {
|
|||
void _update_script_documentation();
|
||||
void _process_update_pending();
|
||||
void _process_removed_files(const HashSet<String> &p_processed_files);
|
||||
bool _should_reload_script(const String &p_path);
|
||||
|
||||
Mutex update_scene_mutex;
|
||||
HashSet<String> update_scene_paths;
|
||||
|
|
|
@ -7260,6 +7260,10 @@ void RenderingDevice::_bind_methods() {
|
|||
BIND_ENUM_CONSTANT(DEBUG_PASS);
|
||||
}
|
||||
|
||||
void RenderingDevice::make_current() {
|
||||
render_thread_id = Thread::get_caller_id();
|
||||
}
|
||||
|
||||
RenderingDevice::~RenderingDevice() {
|
||||
finalize();
|
||||
|
||||
|
|
|
@ -1496,6 +1496,8 @@ public:
|
|||
|
||||
static RenderingDevice *get_singleton();
|
||||
|
||||
void make_current();
|
||||
|
||||
RenderingDevice();
|
||||
~RenderingDevice();
|
||||
|
||||
|
|
|
@ -370,6 +370,8 @@ Size2i RenderingServerDefault::get_maximum_viewport_size() const {
|
|||
void RenderingServerDefault::_assign_mt_ids(WorkerThreadPool::TaskID p_pump_task_id) {
|
||||
server_thread = Thread::get_caller_id();
|
||||
server_task_id = p_pump_task_id;
|
||||
// This is needed because the main RD is created on the main thread.
|
||||
RenderingDevice::get_singleton()->make_current();
|
||||
}
|
||||
|
||||
void RenderingServerDefault::_thread_exit() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user