diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-26 20:07:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-26 20:07:31 +0300 |
commit | cfd3b11630161a802233b905f7076899888c6fe3 (patch) | |
tree | 29653a787a140e0769256c50e823288821c8c802 | |
parent | cf0820d6285c3a9379dd529ee50dcf39e2efa21c (diff) |
fix building blenderplayer and a divide by zero bug with the console view.
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_info/textview.c | 1 |
3 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 360c79ed06a..eb7a89bf840 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -66,6 +66,10 @@ int global_font_default= -1; int global_font_points= 11; int global_font_dpi= 72; +// XXX, should these be made into global_font_'s too? +int blf_mono_font= -1; +int blf_mono_font_render= -1; + static FontBLF *BLF_get(int fontid) { if (fontid >= 0 && fontid < BLF_MAX_FONT) diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index f7079c04a66..43f11ae421e 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -264,9 +264,6 @@ void UI_DrawString(float x, float y, const char *str) BLF_disable(style->widget.uifont_id, BLF_KERNING_DEFAULT); } -int blf_mono_font= -1; -int blf_mono_font_render= -1; - /* ************** init exit ************************ */ /* called on each startup.blend read */ diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index 315130136a2..343130d96ce 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -238,6 +238,7 @@ int textview_draw(TextViewContext *tvc, int draw, int mval[2], void **mouse_pick assert(cdc.cwidth > 0); cdc.lheight= tvc->lheight; cdc.console_width= (tvc->winx - (CONSOLE_DRAW_SCROLL + CONSOLE_DRAW_MARGIN*2) ) / cdc.cwidth; + CLAMP(cdc.console_width, 1, INT_MAX); /* avoid divide by zero on small windows */ cdc.winx= tvc->winx-(CONSOLE_DRAW_MARGIN+CONSOLE_DRAW_SCROLL); cdc.ymin= tvc->ymin; cdc.ymax= tvc->ymax; |