From c12e1a09ec7e76455d81fe4114e91a1561cbdb6d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 Apr 2016 20:02:03 +1000 Subject: BLF: use float vector passing color args --- source/blender/blenfont/BLF_api.h | 4 ++-- source/blender/blenfont/intern/blf.c | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'source/blender/blenfont') diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index e565ffe3cc1..1f38d64924c 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -153,7 +153,7 @@ void BLF_disable(int fontid, int option); * the other argument are the rgba color. * Take care that shadow need to be enable using BLF_enable!!! */ -void BLF_shadow(int fontid, int level, float r, float g, float b, float a); +void BLF_shadow(int fontid, int level, const float rgba[4]) ATTR_NONNULL(3); /* Set the offset for shadow text, this is the current cursor * position plus this offset, don't need call BLF_position before @@ -174,7 +174,7 @@ void BLF_shadow_offset(int fontid, int x, int y); void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, struct ColorManagedDisplay *display); /* Set the color to be used for text. */ -void BLF_buffer_col(int fontid, float r, float g, float b, float a); +void BLF_buffer_col(int fontid, const float rgba[4]) ATTR_NONNULL(2); /* Draw the string into the buffer, this function draw in both buffer, float and unsigned char _BUT_ * it's not necessary set both buffer, NULL is valid here. diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 977fa771014..132a0ec3808 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -849,16 +849,13 @@ void BLF_wordwrap(int fontid, int wrap_width) } } -void BLF_shadow(int fontid, int level, float r, float g, float b, float a) +void BLF_shadow(int fontid, int level, const float rgba[4]) { FontBLF *font = blf_get(fontid); if (font) { font->shadow = level; - font->shadow_col[0] = r; - font->shadow_col[1] = g; - font->shadow_col[2] = b; - font->shadow_col[3] = a; + copy_v4_v4(font->shadow_col, rgba); } } @@ -886,12 +883,12 @@ void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int } } -void BLF_buffer_col(int fontid, float r, float g, float b, float a) +void BLF_buffer_col(int fontid, const float rgba[4]) { FontBLF *font = blf_get(fontid); if (font) { - ARRAY_SET_ITEMS(font->buf_info.col_init, r, g, b, a); + copy_v4_v4(font->buf_info.col_init, rgba); } } -- cgit v1.2.3