diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-06-01 20:21:27 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-06-01 20:42:56 +0300 |
commit | bec3131112bb1f568f948e244784389523927111 (patch) | |
tree | 46a531df746d909052f1c4c4d19c6a223869a09f /source/blender/imbuf/IMB_thumbs.h | |
parent | 2d8880643dad51f09370851248d3d6d80b5bf6d9 (diff) |
Font Preview: much better handling of i18n case.
We have to regenerate previews when we change language. But we also need to do it
when translation is changed or added for a language, etc.
Previously, we were storing one preview per language, which was also stuffing
preview dir with (potentially) tens of PNGs per font file, if user plays with translations.
Now we use a better system, which is storing an additional optional metadata in previews
(some hexdigest), that Blender can use in addition to datetime to decide when to regenerate
previews.
This is only used (and needed) by font previews so far, but can easily be reused for other
types of previews if needed.
Diffstat (limited to 'source/blender/imbuf/IMB_thumbs.h')
-rw-r--r-- | source/blender/imbuf/IMB_thumbs.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/imbuf/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h index 2cb56832a00..f2f75973bcd 100644 --- a/source/blender/imbuf/IMB_thumbs.h +++ b/source/blender/imbuf/IMB_thumbs.h @@ -63,6 +63,11 @@ typedef enum ThumbSource { #define PREVIEW_RENDER_DEFAULT_HEIGHT 128 +/* Note this can also be used as versionning system, + * to force refreshing all thumbnails if e.g. we change some thumb generating code or so. + * Only used by fonts so far. */ +#define THUMB_DEFAULT_HASH "00000000000000000000000000000000" + /* create thumbnail for file and returns new imbuf for thumbnail */ ImBuf *IMB_thumb_create(const char *path, ThumbSize size, ThumbSource source, ImBuf *ibuf); @@ -84,7 +89,7 @@ void IMB_thumb_overlay_blend(unsigned int *thumb, int width, int height, float /* special function for previewing fonts */ ImBuf *IMB_thumb_load_font(const char *filename, unsigned int x, unsigned int y); -const char *IMB_thumb_load_font_get_language(void); +bool IMB_thumb_load_font_get_hash(char *r_hash); #ifdef __cplusplus } |