Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-08-05 12:30:00 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-08-05 12:30:00 +0300
commiteee9eee0f55a66507e620f9ed506f678f7671e55 (patch)
treebf3f1700295de002d851361f0fe7d3b4d104186a /source/blender/blenloader
parent6197d4dafa8ee623f3779c883babb20a7555c992 (diff)
parent70884222832f748975ec9684822ce3ecc8a190c6 (diff)
Merge branch 'master' into greasepencil-edit-curve
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c7
-rw-r--r--source/blender/blenloader/intern/writefile.c12
2 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index c24b4545e22..462ba170d70 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6032,7 +6032,7 @@ static void direct_link_lightcache_texture(BlendDataReader *reader, LightCacheTe
if (lctex->data) {
BLO_read_data_address(reader, &lctex->data);
- if (BLO_read_requires_endian_switch(reader)) {
+ if (lctex->data && BLO_read_requires_endian_switch(reader)) {
int data_size = lctex->components * lctex->tex_size[0] * lctex->tex_size[1] *
lctex->tex_size[2];
@@ -6044,10 +6044,15 @@ static void direct_link_lightcache_texture(BlendDataReader *reader, LightCacheTe
}
}
}
+
+ if (lctex->data == NULL) {
+ zero_v3_int(lctex->tex_size);
+ }
}
static void direct_link_lightcache(BlendDataReader *reader, LightCache *cache)
{
+ cache->flag &= ~LIGHTCACHE_NOT_USABLE;
direct_link_lightcache_texture(reader, &cache->cube_tx);
direct_link_lightcache_texture(reader, &cache->grid_tx);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 118de49baa8..285d58ce34a 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2497,7 +2497,12 @@ static void write_lightcache_texture(BlendWriter *writer, LightCacheTexture *tex
else if (tex->data_type == LIGHTCACHETEX_UINT) {
data_size *= sizeof(uint);
}
- BLO_write_raw(writer, data_size, tex->data);
+
+ /* FIXME: We can't save more than what 32bit systems can handle.
+ * The solution would be to split the texture but it is too late for 2.90. (see T78529) */
+ if (data_size < INT_MAX) {
+ BLO_write_raw(writer, data_size, tex->data);
+ }
}
}
@@ -4054,8 +4059,9 @@ static bool write_file_handle(Main *mainvar,
* avoid thumbnail detecting changes because of this. */
mywrite_flush(wd);
- OverrideLibraryStorage *override_storage =
- wd->use_memfile ? NULL : BKE_lib_override_library_operations_store_initialize();
+ OverrideLibraryStorage *override_storage = wd->use_memfile ?
+ NULL :
+ BKE_lib_override_library_operations_store_init();
#define ID_BUFFER_STATIC_SIZE 8192
/* This outer loop allows to save first data-blocks from real mainvar,