diff options
author | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-09-04 22:49:07 +0400 |
---|---|---|
committer | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-09-04 22:49:07 +0400 |
commit | 90b464d3728d9ed8ec26fdf59058d236b99dbcd9 (patch) | |
tree | e88cab4fb1358e962b19f658064ca8c9f8d29f5b /source/blender/editors/space_console/console_draw.c | |
parent | 08d02dd04d836976b25793bb1d4c6a86b3f924c7 (diff) | |
parent | b0b787ef38f9947b3176642556f5282eb3518f69 (diff) |
COLLADA branch: merge from trunk -r 28015:31610.soc-2009-chingachgook
Diffstat (limited to 'source/blender/editors/space_console/console_draw.c')
-rw-r--r-- | source/blender/editors/space_console/console_draw.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c index db7bb8419e8..74d47ad675d 100644 --- a/source/blender/editors/space_console/console_draw.c +++ b/source/blender/editors/space_console/console_draw.c @@ -33,7 +33,6 @@ #include <sys/stat.h> #include <limits.h> -#include "MEM_guardedalloc.h" #include "BLF_api.h" @@ -42,10 +41,7 @@ #include "DNA_space_types.h" #include "DNA_screen_types.h" -#include "BKE_global.h" -#include "BKE_main.h" // #include "BKE_suggestions.h" -#include "BKE_text.h" #include "BKE_report.h" #include "BKE_utildefines.h" @@ -59,17 +55,16 @@ #include "console_intern.h" + +static int mono= -1; // XXX needs proper storage and change all the BLF_* here! + static void console_font_begin(SpaceConsole *sc) { - static int mono= -1; // XXX needs proper storage - if(mono == -1) mono= BLF_load_mem("monospace", (unsigned char*)datatoc_bmonofont_ttf, datatoc_bmonofont_ttf_size); - BLF_set(mono); - BLF_aspect(1.0); - - BLF_size(sc->lheight-2, 72); + BLF_aspect(mono, 1.0); + BLF_size(mono, sc->lheight-2, 72); } static void console_line_color(unsigned char *fg, int type) @@ -224,8 +219,8 @@ static int console_draw_string(ConsoleDrawContext *cdc, char *str, int str_len, glColor3ub(fg[0], fg[1], fg[2]); /* last part needs no clipping */ - BLF_position(cdc->xy[0], cdc->xy[1], 0); - BLF_draw(line_stride); + BLF_position(mono, cdc->xy[0], cdc->xy[1], 0); + BLF_draw(mono, line_stride); if(cdc->sel[0] != cdc->sel[1]) { cdc->sel[0] += str_len - (cdc->console_width % str_len); @@ -242,8 +237,8 @@ static int console_draw_string(ConsoleDrawContext *cdc, char *str, int str_len, eol = line_stride[cdc->console_width]; line_stride[cdc->console_width]= '\0'; - BLF_position(cdc->xy[0], cdc->xy[1], 0); - BLF_draw(line_stride); + BLF_position(mono, cdc->xy[0], cdc->xy[1], 0); + BLF_draw(mono, line_stride); if(cdc->sel[0] != cdc->sel[1]) { console_draw_sel(cdc->sel, cdc->xy, cdc->console_width, cdc->cwidth, cdc->console_width, cdc->lheight); @@ -268,8 +263,8 @@ static int console_draw_string(ConsoleDrawContext *cdc, char *str, int str_len, glColor3ub(fg[0], fg[1], fg[2]); - BLF_position(cdc->xy[0], cdc->xy[1], 0); - BLF_draw(str); + BLF_position(mono, cdc->xy[0], cdc->xy[1], 0); + BLF_draw(mono, str); if(cdc->sel[0] != cdc->sel[1]) console_draw_sel(cdc->sel, cdc->xy, str_len, cdc->cwidth, cdc->console_width, cdc->lheight); @@ -301,7 +296,7 @@ static int console_text_main__internal(struct SpaceConsole *sc, struct ARegion * unsigned char fg[3]; console_font_begin(sc); - cwidth = BLF_fixed_width(); + cwidth = BLF_fixed_width(mono); console_width= (ar->winx - (CONSOLE_DRAW_SCROLL + CONSOLE_DRAW_MARGIN*2) )/cwidth; if (console_width < 8) console_width= 8; @@ -344,11 +339,11 @@ static int console_text_main__internal(struct SpaceConsole *sc, struct ARegion * /* command line */ if(prompt_len) { - BLF_position(xy[0], xy[1], 0); xy[0] += cwidth * prompt_len; - BLF_draw(sc->prompt); + BLF_position(mono, xy[0], xy[1], 0); xy[0] += cwidth * prompt_len; + BLF_draw(mono, sc->prompt); } - BLF_position(xy[0], xy[1], 0); - BLF_draw(cl->line); + BLF_position(mono, xy[0], xy[1], 0); + BLF_draw(mono, cl->line); /* cursor */ UI_GetThemeColor3ubv(TH_CONSOLE_CURSOR, (char *)fg); |