summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/gi_probe.cpp7
-rw-r--r--scene/resources/texture.cpp4
2 files changed, 6 insertions, 5 deletions
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp
index 3542b8b876..2acbed3b4e 100644
--- a/scene/3d/gi_probe.cpp
+++ b/scene/3d/gi_probe.cpp
@@ -909,10 +909,11 @@ Vector<Color> GIProbe::_get_bake_texture(Ref<Image> p_image, const Color &p_colo
for (int i = 0; i < bake_texture_size * bake_texture_size; i++) {
Color c;
- c.r = r[i * 4 + 0] / 255.0;
- c.g = r[i * 4 + 1] / 255.0;
- c.b = r[i * 4 + 2] / 255.0;
+ c.r = (r[i * 4 + 0] / 255.0) * p_color.r;
+ c.g = (r[i * 4 + 1] / 255.0) * p_color.g;
+ c.b = (r[i * 4 + 2] / 255.0) * p_color.b;
c.a = r[i * 4 + 3] / 255.0;
+
ret[i] = c;
}
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index bc8deb501e..68a11b821d 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -494,9 +494,9 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
img = Image::lossy_unpacker(pv);
}
- if (img.is_null()) {
+ if (img.is_null() || img->empty()) {
memdelete(f);
- ERR_FAIL_COND_V(img->empty(), ERR_FILE_CORRUPT);
+ ERR_FAIL_COND_V(img.is_null() || img->empty(), ERR_FILE_CORRUPT);
}
total_size += img->get_data().size();