summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp2
-rw-r--r--drivers/gles3/shaders/scene.glsl2
-rw-r--r--misc/dist/html/default.html2
-rw-r--r--modules/gdnative/nativescript/nativescript.cpp9
-rw-r--r--modules/gdnative/nativescript/nativescript.h2
-rw-r--r--platform/javascript/javascript_main.cpp2
-rw-r--r--platform/javascript/os_javascript.cpp11
-rw-r--r--servers/visual/visual_server_scene.cpp2
8 files changed, 22 insertions, 10 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 0a003ecce2..b63ebcba54 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -6906,6 +6906,7 @@ bool RasterizerStorageGLES3::free(RID p_rid) {
// delete the texture
GIProbe *gi_probe = gi_probe_owner.get(p_rid);
+ gi_probe->instance_remove_deps();
gi_probe_owner.free(p_rid);
memdelete(gi_probe);
@@ -6921,6 +6922,7 @@ bool RasterizerStorageGLES3::free(RID p_rid) {
// delete the texture
LightmapCapture *lightmap_capture = lightmap_capture_data_owner.get(p_rid);
+ lightmap_capture->instance_remove_deps();
gi_probe_owner.free(p_rid);
memdelete(lightmap_capture);
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index afe70edd17..1aa28d0fd5 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -2003,7 +2003,7 @@ FRAGMENT_SHADER_CODE
}
#ifndef USE_LIGHTMAP
if (ambient_accum.a>0.0) {
- ambient_light+=ambient_accum.rgb/ambient_accum.a;
+ ambient_light=ambient_accum.rgb/ambient_accum.a;
}
#endif
diff --git a/misc/dist/html/default.html b/misc/dist/html/default.html
index 0f78fc640e..a1a4e89d02 100644
--- a/misc/dist/html/default.html
+++ b/misc/dist/html/default.html
@@ -350,7 +350,7 @@ $GODOT_HEAD_INCLUDE
};
function printError(text) {
- if (!text.startsWith('**ERROR**: ')) {
+ if (!String.prototype.trim.call(text).startsWith('**ERROR**: ')) {
text = '**ERROR**: ' + text;
}
print(text);
diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp
index 2d94599ea0..e9e3180835 100644
--- a/modules/gdnative/nativescript/nativescript.cpp
+++ b/modules/gdnative/nativescript/nativescript.cpp
@@ -790,8 +790,13 @@ NativeScriptInstance::~NativeScriptInstance() {
NativeScriptLanguage *NativeScriptLanguage::singleton;
-void NativeScriptLanguage::_unload_stuff() {
+void NativeScriptLanguage::_unload_stuff(bool p_reload) {
for (Map<String, Map<StringName, NativeScriptDesc> >::Element *L = library_classes.front(); L; L = L->next()) {
+
+ if (p_reload && !library_gdnatives[L->key()]->get_library()->is_reloadable()) {
+ continue;
+ }
+
for (Map<StringName, NativeScriptDesc>::Element *C = L->get().front(); C; C = C->next()) {
// free property stuff first
@@ -1108,7 +1113,7 @@ void NativeReloadNode::_notification(int p_what) {
#ifndef NO_THREADS
MutexLock lock(NSL->mutex);
#endif
- NSL->_unload_stuff();
+ NSL->_unload_stuff(true);
for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) {
Ref<GDNative> gdn = L->get();
diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h
index 38f77aea55..ac94c84bc4 100644
--- a/modules/gdnative/nativescript/nativescript.h
+++ b/modules/gdnative/nativescript/nativescript.h
@@ -205,7 +205,7 @@ class NativeScriptLanguage : public ScriptLanguage {
private:
static NativeScriptLanguage *singleton;
- void _unload_stuff();
+ void _unload_stuff(bool p_reload = false);
#ifndef NO_THREADS
Mutex *mutex;
diff --git a/platform/javascript/javascript_main.cpp b/platform/javascript/javascript_main.cpp
index b738f37d1b..e85fe0800f 100644
--- a/platform/javascript/javascript_main.cpp
+++ b/platform/javascript/javascript_main.cpp
@@ -65,7 +65,7 @@ int main(int argc, char *argv[]) {
FS.mkdir('/userfs');
FS.mount(IDBFS, {}, '/userfs');
FS.syncfs(true, function(err) {
- Module['ccall']('main_after_fs_sync', null, ['string'], [err ? err.message : ""])
+ ccall('main_after_fs_sync', null, ['string'], [err ? err.message : ""])
});
);
/* clang-format on */
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index a86393c950..b10ef821dd 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -566,7 +566,7 @@ void OS_JavaScript::set_css_cursor(const char *p_cursor) {
/* clang-format off */
EM_ASM_({
- Module.canvas.style.cursor = Module.UTF8ToString($0);
+ Module.canvas.style.cursor = UTF8ToString($0);
}, p_cursor);
/* clang-format on */
}
@@ -576,7 +576,7 @@ const char *OS_JavaScript::get_css_cursor() const {
char cursor[16];
/* clang-format off */
EM_ASM_INT({
- Module.stringToUTF8(Module.canvas.style.cursor ? Module.canvas.style.cursor : 'auto', $0, 16);
+ stringToUTF8(Module.canvas.style.cursor ? Module.canvas.style.cursor : 'auto', $0, 16);
}, cursor);
/* clang-format on */
return cursor;
@@ -792,7 +792,7 @@ void OS_JavaScript::main_loop_begin() {
/* clang-format off */
EM_ASM_ARGS({
- const send_notification = Module.cwrap('send_notification', null, ['number']);
+ const send_notification = cwrap('send_notification', null, ['number']);
const notifs = arguments;
(['mouseover', 'mouseleave', 'focus', 'blur']).forEach(function(event, i) {
Module.canvas.addEventListener(event, send_notification.bind(null, notifs[i]));
@@ -989,6 +989,7 @@ bool OS_JavaScript::is_userfs_persistent() const {
}
OS_JavaScript::OS_JavaScript(const char *p_execpath, GetUserDataDirFunc p_get_user_data_dir_func) {
+
set_cmdline(p_execpath, get_cmdline_args());
main_loop = NULL;
gl_extensions = NULL;
@@ -1001,6 +1002,10 @@ OS_JavaScript::OS_JavaScript(const char *p_execpath, GetUserDataDirFunc p_get_us
idbfs_available = false;
time_to_save_sync = -1;
+
+ Vector<Logger *> loggers;
+ loggers.push_back(memnew(StdLogger));
+ _set_logger(memnew(CompositeLogger(loggers)));
}
OS_JavaScript::~OS_JavaScript() {
diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp
index 8dbb765f13..8d8bbb881f 100644
--- a/servers/visual/visual_server_scene.cpp
+++ b/servers/visual/visual_server_scene.cpp
@@ -659,7 +659,6 @@ void VisualServerScene::instance_set_use_lightmap(RID p_instance, RID p_lightmap
Instance *instance = instance_owner.get(p_instance);
ERR_FAIL_COND(!instance);
- ERR_FAIL_COND(!is_geometry_instance(instance->base_type));
if (instance->lightmap_capture) {
InstanceLightmapCaptureData *lightmap_capture = static_cast<InstanceLightmapCaptureData *>(((Instance *)instance->lightmap_capture)->base_data);
@@ -3298,6 +3297,7 @@ bool VisualServerScene::free(RID p_rid) {
Instance *instance = instance_owner.get(p_rid);
+ instance_set_use_lightmap(p_rid, RID(), RID());
instance_set_scenario(p_rid, RID());
instance_set_base(p_rid, RID());
instance_geometry_set_material_override(p_rid, RID());