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:
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/Makefile2
-rw-r--r--source/blender/editors/space_view3d/SConscript4
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c21
-rw-r--r--source/blender/editors/space_view3d/drawobject.c55
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c25
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c2
6 files changed, 42 insertions, 67 deletions
diff --git a/source/blender/editors/space_view3d/Makefile b/source/blender/editors/space_view3d/Makefile
index 442ab502e65..dd4eab89411 100644
--- a/source/blender/editors/space_view3d/Makefile
+++ b/source/blender/editors/space_view3d/Makefile
@@ -38,7 +38,6 @@ CFLAGS += $(LEVEL_1_C_WARNINGS)
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
-CPPFLAGS += -I$(NAN_BMFONT)/include
# not very neat....
CPPFLAGS += -I../../windowmanager
@@ -51,6 +50,7 @@ CPPFLAGS += -I../../python
CPPFLAGS += -I../../gpu
CPPFLAGS += -I../../makesrna
CPPFLAGS += -I../../render/extern/include
+CPPFLAGS += -I../../blenfont
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# own include
diff --git a/source/blender/editors/space_view3d/SConscript b/source/blender/editors/space_view3d/SConscript
index c9b29f61e44..b771095c781 100644
--- a/source/blender/editors/space_view3d/SConscript
+++ b/source/blender/editors/space_view3d/SConscript
@@ -5,7 +5,7 @@ sources = env.Glob('*.c')
incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
-incs += ' ../../render/extern/include #/intern/guardedalloc #intern/bmfont'
-incs += ' ../../gpu ../../makesrna'
+incs += ' ../../render/extern/include #/intern/guardedalloc'
+incs += ' ../../gpu ../../makesrna ../../blenfont'
env.BlenderLib ( 'bf_editors_space_view3d', sources, Split(incs), [], libtype=['core'], priority=[40] )
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 5d130cee48d..dfdd70b11e7 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -37,8 +37,6 @@
#include "MEM_guardedalloc.h"
-#include "BMF_Api.h"
-
#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
@@ -74,6 +72,7 @@
#include "WM_api.h"
#include "WM_types.h"
+#include "BLF_api.h"
#include "UI_resources.h"
@@ -1806,9 +1805,8 @@ static void draw_pose_channels(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ba
/* Draw names of bone */
if (arm->flag & ARM_DRAWNAMES) {
VecMidf(vec, pchan->pose_head, pchan->pose_tail);
- glRasterPos3fv(vec);
- BMF_DrawString(G.font, " ");
- BMF_DrawString(G.font, pchan->name);
+ BLF_draw_default(vec[0], vec[1], vec[2], " ");
+ BLF_draw_default(vec[0] + BLF_width_default(" "), vec[1], vec[2], pchan->name);
}
/* Draw additional axes on the bone tail */
@@ -1993,8 +1991,8 @@ static void draw_ebones(View3D *v3d, RegionView3D *rv3d, Object *ob, int dt)
if (arm->flag & ARM_DRAWNAMES) {
VecMidf(vec, eBone->head, eBone->tail);
glRasterPos3fv(vec);
- BMF_DrawString(G.font, " ");
- BMF_DrawString(G.font, eBone->name);
+ BLF_draw_default(vec[0], vec[1], vec[2], " ");
+ BLF_draw_default(vec[0] + BLF_width_default(" "), vec[1], vec[2], eBone->name);
}
/* Draw additional axes */
if (arm->flag & ARM_DRAWAXES) {
@@ -2155,15 +2153,13 @@ static void draw_pose_paths(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
/* only draw framenum if several consecutive highlighted points don't occur on same point */
if (a == 0) {
- glRasterPos3fv(fp);
sprintf(str, " %d\n", (a+sfra));
- BMF_DrawString(G.font, str);
+ BLF_draw_default(fp[0], fp[1], fp[2], str);
}
else if ((a > stepsize) && (a < len-stepsize)) {
if ((VecEqual(fp, fp-(stepsize*3))==0) || (VecEqual(fp, fp+(stepsize*3))==0)) {
- glRasterPos3fv(fp);
sprintf(str, " %d\n", (a+sfra));
- BMF_DrawString(G.font, str);
+ BLF_draw_default(fp[0], fp[1], fp[2], str);
}
}
}
@@ -2205,9 +2201,8 @@ static void draw_pose_paths(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
if (ak->cfra == (a+sfra)) {
char str[32];
- glRasterPos3fv(fp);
sprintf(str, " %d\n", (a+sfra));
- BMF_DrawString(G.font, str);
+ BLF_draw_default(fp[0], fp[1], fp[2], str);
}
}
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 10edd4eccb5..3725fc24b6c 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -34,8 +34,6 @@
#include "MEM_guardedalloc.h"
-#include "BMF_Api.h"
-
#include "IMB_imbuf.h"
@@ -107,6 +105,7 @@
#include "UI_interface_icons.h"
#include "WM_api.h"
+#include "BLF_api.h"
#include "view3d_intern.h" // own include
@@ -361,16 +360,15 @@ void drawaxes(float size, int flag, char drawtype)
glEnd();
v2[axis]+= size*0.125;
- glRasterPos3fv(v2);
// patch for 3d cards crashing on glSelect for text drawing (IBM)
if((flag & DRAW_PICKING) == 0) {
if (axis==0)
- BMF_DrawString(G.font, "x");
+ BLF_draw_default(v2[0], v2[1], v2[2], "x");
else if (axis==1)
- BMF_DrawString(G.font, "y");
+ BLF_draw_default(v2[0], v2[1], v2[2], "y");
else
- BMF_DrawString(G.font, "z");
+ BLF_draw_default(v2[0], v2[1], v2[2], "z");
}
}
break;
@@ -1778,7 +1776,7 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
Mesh *me= ob->data;
EditEdge *eed;
EditFace *efa;
- float v1[3], v2[3], v3[3], v4[3];
+ float v1[3], v2[3], v3[3], v4[3], x, y, z;
float fvec[3];
char val[32]; /* Stores the measurement display text here */
char conv_float[5]; /* Use a float conversion matching the grid size */
@@ -1818,7 +1816,9 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
VECCOPY(v1, eed->v1->co);
VECCOPY(v2, eed->v2->co);
- glRasterPos3f( 0.5*(v1[0]+v2[0]), 0.5*(v1[1]+v2[1]), 0.5*(v1[2]+v2[2]));
+ x= 0.5*(v1[0]+v2[0]);
+ y= 0.5*(v1[1]+v2[1]);
+ z= 0.5*(v1[2]+v2[2]);
if(v3d->flag & V3D_GLOBAL_STATS) {
Mat4MulVecfl(ob->obmat, v1);
@@ -1826,7 +1826,7 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
}
sprintf(val, conv_float, VecLenf(v1, v2));
- BMF_DrawString( G.fonts, val);
+ BLF_draw_default(x, y, z, val);
}
}
}
@@ -1861,8 +1861,7 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
area = AreaT3Dfl(v1, v2, v3);
sprintf(val, conv_float, area);
- glRasterPos3fv(efa->cent);
- BMF_DrawString( G.fonts, val);
+ BLF_draw_default(efa->cent[0], efa->cent[1], efa->cent[2], val);
}
}
}
@@ -1904,15 +1903,13 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
/* Vec 1 */
sprintf(val,"%.3f", VecAngle3(v4, v1, v2));
VecLerpf(fvec, efa->cent, efa->v1->co, 0.8);
- glRasterPos3fv(fvec);
- BMF_DrawString( G.fonts, val);
+ BLF_draw_default(efa->cent[0], efa->cent[1], efa->cent[2], val);
}
if( (e1->f & e2->f & SELECT) || (G.moving && (efa->v2->f & SELECT)) ) {
/* Vec 2 */
sprintf(val,"%.3f", VecAngle3(v1, v2, v3));
VecLerpf(fvec, efa->cent, efa->v2->co, 0.8);
- glRasterPos3fv(fvec);
- BMF_DrawString( G.fonts, val);
+ BLF_draw_default(fvec[0], fvec[1], fvec[2], val);
}
if( (e2->f & e3->f & SELECT) || (G.moving && (efa->v3->f & SELECT)) ) {
/* Vec 3 */
@@ -1921,16 +1918,14 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
else
sprintf(val,"%.3f", VecAngle3(v2, v3, v1));
VecLerpf(fvec, efa->cent, efa->v3->co, 0.8);
- glRasterPos3fv(fvec);
- BMF_DrawString( G.fonts, val);
+ BLF_draw_default(fvec[0], fvec[1], fvec[2], val);
}
/* Vec 4 */
if(efa->v4) {
if( (e3->f & e4->f & SELECT) || (G.moving && (efa->v4->f & SELECT)) ) {
sprintf(val,"%.3f", VecAngle3(v3, v4, v1));
VecLerpf(fvec, efa->cent, efa->v4->co, 0.8);
- glRasterPos3fv(fvec);
- BMF_DrawString( G.fonts, val);
+ BLF_draw_default(fvec[0], fvec[1], fvec[2], val);
}
}
}
@@ -3257,9 +3252,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
if(part->draw&PART_DRAW_NUM && !(G.f & G_RENDER_SHADOW)){
/* in path drawing state.co is the end point */
- glRasterPos3f(state.co[0], state.co[1], state.co[2]);
sprintf(val," %i",a);
- BMF_DrawString(G.font, val);
+ BLF_draw_default(state.co[0], state.co[1], state.co[2], val);
}
}
}
@@ -3574,9 +3568,8 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob
for(k=0, key=edit->keys[i]+k; k<pa->totkey; k++, key++){
if(key->flag & PEK_HIDE) continue;
- glRasterPos3fv(key->world_co);
sprintf(val," %.1f",*key->time);
- BMF_DrawString(G.font, val);
+ BLF_draw_default(key->world_co[0], key->world_co[1], key->world_co[2], val);
}
}
}
@@ -3598,9 +3591,8 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob
glEnd();
if((pset->flag & PE_SHOW_TIME) && !(G.f & G_RENDER_SHADOW)){
- glRasterPos3fv(key->world_co);
sprintf(val," %.1f",*key->time);
- BMF_DrawString(G.font, val);
+ BLF_draw_default(key->world_co[0], key->world_co[1], key->world_co[2], val);
}
}
}
@@ -4625,13 +4617,12 @@ void drawRBpivot(bRigidBodyJointConstraint *data)
glVertex3fv(v1);
glVertex3fv(v);
glEnd();
- glRasterPos3fv(v);
if (axis==0)
- BMF_DrawString(G.font, "px");
+ BLF_draw_default(v[0], v[1], v[2], "px");
else if (axis==1)
- BMF_DrawString(G.font, "py");
+ BLF_draw_default(v[0], v[1], v[2], "py");
else
- BMF_DrawString(G.font, "pz");
+ BLF_draw_default(v[0], v[1], v[2], "pz");
}
glLineWidth (1.0f);
setlinestyle(0);
@@ -5051,10 +5042,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
/* but, we also dont draw names for sets or duplicators */
if(flag == 0) {
if(v3d->zbuf) glDisable(GL_DEPTH_TEST);
- glRasterPos3f(0.0, 0.0, 0.0);
-
- BMF_DrawString(G.font, " ");
- BMF_DrawString(G.font, ob->id.name+2);
+ BLF_draw_default(0.0, 0.0, 0.0, " ");
+ BLF_draw_default(0.0 + BLF_width_default(" "), 0.0, 0.0, ob->id.name+2);
if(v3d->zbuf) glEnable(GL_DEPTH_TEST);
}
}
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index cb67a1fc9aa..bbf0279692a 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -69,9 +69,9 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "BMF_Api.h"
#include "WM_api.h"
+#include "BLF_api.h"
#include "ED_armature.h"
#include "ED_keyframing.h"
@@ -558,8 +558,7 @@ static void draw_view_axis(RegionView3D *rv3d)
dy = vec[1] * k;
fdrawline(start, start + ydisp, start + dx, start + dy + ydisp);
if (fabs(dx) > toll || fabs(dy) > toll) {
- glRasterPos2i(start + dx + 2, start + dy + ydisp + 2);
- BMF_DrawString(G.fonts, "x");
+ BLF_draw_default(start + dx + 2, start + dy + ydisp + 2, 0.0f, "x");
}
/* Y */
@@ -579,8 +578,7 @@ static void draw_view_axis(RegionView3D *rv3d)
dy = vec[1] * k;
fdrawline(start, start + ydisp, start + dx, start + dy + ydisp);
if (fabs(dx) > toll || fabs(dy) > toll) {
- glRasterPos2i(start + dx + 2, start + dy + ydisp + 2);
- BMF_DrawString(G.fonts, "y");
+ BLF_draw_default(start + dx + 2, start + dy + ydisp + 2, 0.0f, "y");
}
/* Z */
@@ -600,8 +598,7 @@ static void draw_view_axis(RegionView3D *rv3d)
dy = vec[1] * k;
fdrawline(start, start + ydisp, start + dx, start + dy + ydisp);
if (fabs(dx) > toll || fabs(dy) > toll) {
- glRasterPos2i(start + dx + 2, start + dy + ydisp + 2);
- BMF_DrawString(G.fonts, "z");
+ BLF_draw_default(start + dx + 2, start + dy + ydisp + 2, 0.0f, "z");
}
/* restore line-width */
@@ -693,8 +690,7 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d)
if (printable) {
UI_ThemeColor(TH_TEXT_HI);
- glRasterPos2i(10, ar->winy-20);
- BMF_DrawString(G.fonts, printable);
+ BLF_draw_default(10, ar->winy-20, 0.0f, printable);
}
if (v3d->localview) {
@@ -799,7 +795,7 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d)
}
/* colour depends on whether there is a keyframe */
- if (id_frame_has_keyframe((ID *)ob, /*frame_to_float(scene, CFRA)*/(float)(CFRA), v3d->keyflags))
+ if (id_frame_has_keyframe((ID *)ob, /*frame_to_float(scene, CFRA)*/(float)(CFRA), v3d->keyflags))
UI_ThemeColor(TH_VERTEX_SELECT);
else
UI_ThemeColor(TH_TEXT_HI);
@@ -817,9 +813,8 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d)
if (U.uiflag & USER_SHOW_ROTVIEWICON)
offset = 14 + (U.rvisize * 2);
-
- glRasterPos2i(offset, 10);
- BMF_DrawString(G.fonts, info);
+
+ BLF_draw_default(offset, 10, 0.0f, info);
}
static void view3d_get_viewborder_size(Scene *scene, ARegion *ar, float size_r[2])
@@ -999,9 +994,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
/* camera name - draw in highlighted text color */
if (ca && (ca->flag & CAM_SHOWNAME)) {
UI_ThemeColor(TH_TEXT_HI);
- glRasterPos2f(x1, y1-15);
-
- BMF_DrawString(G.font, v3d->camera->id.name+2);
+ BLF_draw_default(x1, y1-15, 0.0f, v3d->camera->id.name+2);
UI_ThemeColor(TH_WIRE);
}
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index fba8e0c4eb7..24d211d81ab 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -92,8 +92,6 @@
#include "UI_resources.h"
#include "UI_view2d.h"
-#include "BMF_Api.h"
-
#include "view3d_intern.h"