diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-08-13 13:56:27 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-08-13 16:37:11 +0300 |
commit | 03bf84db86bc023cfad501b1b4764cecb6435422 (patch) | |
tree | 6745f3914466f745d104e937d46a94b5ef7fe9e5 /source/blender/blenkernel/intern/pointcache.c | |
parent | 6f9cbbc8ec4f42131f46d3d25e7608112bcb7eab (diff) |
Fix T66373: Strange translation text behaviour.
i18n code does not work from threads on some plaforms, so it is disabled
in Blender when called from non-main thread.
Means that we have to go to a slightly different approach, with dirty
tag and generating string on request for UI.
Note: Also had to update the `info` string size, to fit with expensive
asiatic scripts in utf-8... Using mem for that kind of runtime data is
not really nice, but for now it will have to do.
Diffstat (limited to 'source/blender/blenkernel/intern/pointcache.c')
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 90ae512074d..2d42406520d 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -3337,7 +3337,7 @@ int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra) cache->cached_frames[cfra - cache->startframe] = 1; } - BKE_ptcache_update_info(pid); + cache->flag |= PTCACHE_FLAG_INFO_DIRTY; return !error; } @@ -3500,8 +3500,9 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra) break; } - BKE_ptcache_update_info(pid); + pid->cache->flag |= PTCACHE_FLAG_INFO_DIRTY; } + int BKE_ptcache_id_exist(PTCacheID *pid, int cfra) { if (!pid->cache) { @@ -4288,7 +4289,7 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) BKE_ptcache_id_time(pid, NULL, 0.0f, NULL, NULL, NULL); - BKE_ptcache_update_info(pid); + cache->flag |= PTCACHE_FLAG_INFO_DIRTY; if ((cache->flag & PTCACHE_DISK_CACHE) == 0) { if (cache->index) { @@ -4461,7 +4462,8 @@ void BKE_ptcache_load_external(PTCacheID *pid) cache->cached_frames = NULL; cache->cached_frames_len = 0; } - BKE_ptcache_update_info(pid); + + cache->flag |= PTCACHE_FLAG_INFO_DIRTY; } void BKE_ptcache_update_info(PTCacheID *pid) @@ -4469,7 +4471,9 @@ void BKE_ptcache_update_info(PTCacheID *pid) PointCache *cache = pid->cache; PTCacheExtra *extra = NULL; int totframes = 0; - char mem_info[64]; + char mem_info[sizeof(((PointCache *)0)->info) / sizeof(*(((PointCache *)0)->info))]; + + cache->flag &= ~PTCACHE_FLAG_INFO_DIRTY; if (cache->flag & PTCACHE_EXTERNAL) { int cfra = cache->startframe; |