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/blenkernel/intern/image.c | 2 +- source/blender/blenkernel/intern/image_gen.c | 7 +++++-- source/blender/blenkernel/intern/seqeffects.c | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index cdb3d1afc29..340b406722f 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1992,7 +1992,7 @@ void BKE_image_stamp_buf( BLF_wordwrap(mono, width - (BUFF_MARGIN_X * 2)); BLF_buffer(mono, rectf, rect, width, height, channels, display); - BLF_buffer_col(mono, UNPACK4(scene->r.fg_stamp)); + BLF_buffer_col(mono, scene->r.fg_stamp); pad = BLF_width_max(mono); /* use 'h_fixed' rather than 'h', aligns better */ diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index 303d0c6adfc..10e7d46b315 100644 --- a/source/blender/blenkernel/intern/image_gen.c +++ b/source/blender/blenkernel/intern/image_gen.c @@ -297,6 +297,9 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width */ BLF_buffer(mono, rect_float, rect, width, height, 4, NULL); + const float text_color[4] = {0.0, 0.0, 0.0, 1.0}; + const float text_outline[4] = {1.0, 1.0, 1.0, 1.0}; + for (y = 0; y < height; y += step) { text[1] = '1'; @@ -306,7 +309,7 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width pen_y = y + 44; /* terribly crappy outline font! */ - BLF_buffer_col(mono, 1.0, 1.0, 1.0, 1.0); + BLF_buffer_col(mono, text_outline); BLF_position(mono, pen_x - outline, pen_y, 0.0); BLF_draw_buffer(mono, text, 2); @@ -326,7 +329,7 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width BLF_position(mono, pen_x + outline, pen_y - outline, 0.0); BLF_draw_buffer(mono, text, 2); - BLF_buffer_col(mono, 0.0, 0.0, 0.0, 1.0); + BLF_buffer_col(mono, text_color); BLF_position(mono, pen_x, pen_y, 0.0); BLF_draw_buffer(mono, text, 2); diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 1b807adca4b..dfce931cbf4 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -3188,11 +3188,11 @@ static ImBuf *do_text_effect(const SeqRenderData *context, Sequence *seq, float fontx = BLF_width_max(mono); fonty = line_height; BLF_position(mono, x + max_ii(fontx / 25, 1), y + max_ii(fonty / 25, 1), 0.0f); - BLF_buffer_col(mono, 0.0f, 0.0f, 0.0f, 1.0f); + BLF_buffer_col(mono, (const float[4]){0.0f, 0.0f, 0.0f, 1.0f}); BLF_draw_buffer(mono, data->text, BLF_DRAW_STR_DUMMY_MAX); } BLF_position(mono, x, y, 0.0f); - BLF_buffer_col(mono, 1.0f, 1.0f, 1.0f, 1.0f); + BLF_buffer_col(mono, (const float[4]){1.0f, 1.0f, 1.0f, 1.0f}); BLF_draw_buffer(mono, data->text, BLF_DRAW_STR_DUMMY_MAX); BLF_buffer(mono, NULL, NULL, 0, 0, 0, NULL); -- cgit v1.2.3