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>2016-04-22 13:02:03 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-04-22 13:02:41 +0300
commitc12e1a09ec7e76455d81fe4114e91a1561cbdb6d (patch)
treecb6fb333f48f0e04a102cccd558377e649409db8 /source/blender/blenfont
parenta9729e6d75c74f48c6135df710f117435e7ff2f3 (diff)
BLF: use float vector passing color args
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/BLF_api.h4
-rw-r--r--source/blender/blenfont/intern/blf.c11
2 files changed, 6 insertions, 9 deletions
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);
}
}