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:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/imbuf/intern/thumbs_font.c
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/imbuf/intern/thumbs_font.c')
-rw-r--r--source/blender/imbuf/intern/thumbs_font.c67
1 files changed, 36 insertions, 31 deletions
diff --git a/source/blender/imbuf/intern/thumbs_font.c b/source/blender/imbuf/intern/thumbs_font.c
index ec45749e513..1213927d329 100644
--- a/source/blender/imbuf/intern/thumbs_font.c
+++ b/source/blender/imbuf/intern/thumbs_font.c
@@ -28,7 +28,6 @@
#include "IMB_thumbs.h"
-
/* XXX, bad level call */
#include "../../blenfont/BLF_api.h"
#include "../../blentranslation/BLT_translation.h"
@@ -44,51 +43,57 @@ static const char *thumb_str[] = {
struct ImBuf *IMB_thumb_load_font(const char *filename, unsigned int x, unsigned int y)
{
- const int font_size = y / 4;
+ const int font_size = y / 4;
- struct ImBuf *ibuf;
- float font_color[4];
+ struct ImBuf *ibuf;
+ float font_color[4];
- /* create a white image (theme color is used for drawing) */
- font_color[0] = font_color[1] = font_color[2] = 1.0f;
+ /* create a white image (theme color is used for drawing) */
+ font_color[0] = font_color[1] = font_color[2] = 1.0f;
- /* fill with zero alpha */
- font_color[3] = 0.0f;
+ /* fill with zero alpha */
+ font_color[3] = 0.0f;
- ibuf = IMB_allocImBuf(x, y, 32, IB_rect | IB_metadata);
- IMB_rectfill(ibuf, font_color);
+ ibuf = IMB_allocImBuf(x, y, 32, IB_rect | IB_metadata);
+ IMB_rectfill(ibuf, font_color);
- /* draw with full alpha */
- font_color[3] = 1.0f;
+ /* draw with full alpha */
+ font_color[3] = 1.0f;
- BLF_thumb_preview(
- filename, thumb_str, ARRAY_SIZE(thumb_str),
- font_color, font_size,
- (unsigned char *)ibuf->rect, ibuf->x, ibuf->y, ibuf->channels);
+ BLF_thumb_preview(filename,
+ thumb_str,
+ ARRAY_SIZE(thumb_str),
+ font_color,
+ font_size,
+ (unsigned char *)ibuf->rect,
+ ibuf->x,
+ ibuf->y,
+ ibuf->channels);
- return ibuf;
+ return ibuf;
}
bool IMB_thumb_load_font_get_hash(char *r_hash)
{
- char buf[1024];
- char *str = buf;
- size_t len = 0;
+ char buf[1024];
+ char *str = buf;
+ size_t len = 0;
- int draw_str_lines = ARRAY_SIZE(thumb_str);
- int i;
+ int draw_str_lines = ARRAY_SIZE(thumb_str);
+ int i;
- unsigned char digest[16];
+ unsigned char digest[16];
- len += BLI_strncpy_rlen(str + len, THUMB_DEFAULT_HASH, sizeof(buf) - len);
+ len += BLI_strncpy_rlen(str + len, THUMB_DEFAULT_HASH, sizeof(buf) - len);
- for (i = 0; (i < draw_str_lines) && (len < sizeof(buf)); i++) {
- len += BLI_strncpy_rlen(str + len, BLT_translate_do(BLT_I18NCONTEXT_DEFAULT, thumb_str[i]), sizeof(buf) - len);
- }
+ for (i = 0; (i < draw_str_lines) && (len < sizeof(buf)); i++) {
+ len += BLI_strncpy_rlen(
+ str + len, BLT_translate_do(BLT_I18NCONTEXT_DEFAULT, thumb_str[i]), sizeof(buf) - len);
+ }
- BLI_hash_md5_buffer(str, len, digest);
- r_hash[0] = '\0';
- BLI_hash_md5_to_hexdigest(digest, r_hash);
+ BLI_hash_md5_buffer(str, len, digest);
+ r_hash[0] = '\0';
+ BLI_hash_md5_to_hexdigest(digest, r_hash);
- return true;
+ return true;
}