forked from bartvdbraak/blender
style cleanup: view3d
This commit is contained in:
parent
facc976371
commit
80a766cbd0
@ -1035,9 +1035,10 @@ void draw_mesh_paint(RegionView3D *rv3d, Object *ob, DerivedMesh *dm, int draw_f
|
||||
GPU_disable_material();
|
||||
}
|
||||
else if (ob->mode & OB_MODE_VERTEX_PAINT) {
|
||||
if (me->mloopcol)
|
||||
if (me->mloopcol) {
|
||||
dm->drawMappedFaces(dm, facemask, GPU_enable_material, NULL, me,
|
||||
DM_DRAW_USE_COLORS | DM_DRAW_ALWAYS_SMOOTH);
|
||||
}
|
||||
else {
|
||||
glColor3f(1.0f, 1.0f, 1.0f);
|
||||
dm->drawMappedFaces(dm, facemask, GPU_enable_material, NULL, me,
|
||||
|
@ -102,7 +102,7 @@ static void star_stuff_init_func(void)
|
||||
glPointSize(1.0);
|
||||
glBegin(GL_POINTS);
|
||||
}
|
||||
static void star_stuff_vertex_func(float*i)
|
||||
static void star_stuff_vertex_func(float *i)
|
||||
{
|
||||
glVertex3fv(i);
|
||||
}
|
||||
@ -716,7 +716,7 @@ static void draw_rotation_guide(RegionView3D *rv3d)
|
||||
glColor4fv(color);
|
||||
glBegin(GL_LINE_LOOP);
|
||||
for (i = 0, angle = 0.f; i < ROT_AXIS_DETAIL; ++i, angle += step) {
|
||||
float p[3] = {s * cosf(angle), s * sinf(angle), 0.0f};
|
||||
float p[3] = {s *cosf(angle), s * sinf(angle), 0.0f};
|
||||
|
||||
if (!upright) {
|
||||
mul_qt_v3(q, p);
|
||||
@ -1861,7 +1861,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
|
||||
* offset feature (used in group-duplicate.blend but no longer works in 2.5)
|
||||
* so for now it should be ok to - campbell */
|
||||
|
||||
if (/* if this is the last no need to make a displist */
|
||||
if ( /* if this is the last no need to make a displist */
|
||||
(dob_next == NULL || dob_next->ob != dob->ob) ||
|
||||
/* lamp drawing messes with matrices, could be handled smarter... but this works */
|
||||
(dob->ob->type == OB_LAMP) ||
|
||||
@ -2556,7 +2556,7 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar,
|
||||
|
||||
/* transp and X-ray afterdraw stuff */
|
||||
if (v3d->afterdraw_transp.first) view3d_draw_transp(scene, ar, v3d);
|
||||
if (v3d->afterdraw_xray.first) view3d_draw_xray(scene, ar, v3d, 1); // clears zbuffer if it is used!
|
||||
if (v3d->afterdraw_xray.first) view3d_draw_xray(scene, ar, v3d, 1); /* clears zbuffer if it is used! */
|
||||
if (v3d->afterdraw_xraytransp.first) view3d_draw_xraytransp(scene, ar, v3d, 1);
|
||||
|
||||
if (rv3d->rflag & RV3D_CLIPPING)
|
||||
|
@ -986,12 +986,12 @@ void VIEW3D_OT_rotate(wmOperatorType *ot)
|
||||
/* NDOF utility functions
|
||||
* (should these functions live in this file?)
|
||||
*/
|
||||
float ndof_to_axis_angle(struct wmNDOFMotionData*ndof, float axis[3])
|
||||
float ndof_to_axis_angle(struct wmNDOFMotionData *ndof, float axis[3])
|
||||
{
|
||||
return ndof->dt * normalize_v3_v3(axis, ndof->rvec);
|
||||
}
|
||||
|
||||
void ndof_to_quat(struct wmNDOFMotionData*ndof, float q[4])
|
||||
void ndof_to_quat(struct wmNDOFMotionData *ndof, float q[4])
|
||||
{
|
||||
float axis[3];
|
||||
float angle;
|
||||
@ -1010,8 +1010,8 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event
|
||||
return OPERATOR_CANCELLED;
|
||||
else {
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
RegionView3D*rv3d = CTX_wm_region_view3d(C);
|
||||
wmNDOFMotionData*ndof = (wmNDOFMotionData *) event->customdata;
|
||||
RegionView3D *rv3d = CTX_wm_region_view3d(C);
|
||||
wmNDOFMotionData *ndof = (wmNDOFMotionData *) event->customdata;
|
||||
|
||||
ED_view3d_camera_lock_init(v3d, rv3d);
|
||||
|
||||
@ -1162,8 +1162,8 @@ static int ndof_pan_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
|
||||
return OPERATOR_CANCELLED;
|
||||
else {
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
RegionView3D*rv3d = CTX_wm_region_view3d(C);
|
||||
wmNDOFMotionData*ndof = (wmNDOFMotionData *) event->customdata;
|
||||
RegionView3D *rv3d = CTX_wm_region_view3d(C);
|
||||
wmNDOFMotionData *ndof = (wmNDOFMotionData *) event->customdata;
|
||||
|
||||
ED_view3d_camera_lock_init(v3d, rv3d);
|
||||
|
||||
@ -2239,7 +2239,7 @@ static int viewselected_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
size = v3d->near * 1.5f;
|
||||
}
|
||||
}
|
||||
else /* ortho */ {
|
||||
else { /* ortho */
|
||||
if (size < 0.0001f) {
|
||||
/* bounding box was a single point so do not zoom */
|
||||
ok_dist = 0;
|
||||
|
@ -174,7 +174,7 @@ typedef struct FlyInfo {
|
||||
unsigned char use_freelook;
|
||||
|
||||
int mval[2]; /* latest 2D mouse values */
|
||||
wmNDOFMotionData*ndof; /* latest 3D mouse values */
|
||||
wmNDOFMotionData *ndof; /* latest 3D mouse values */
|
||||
|
||||
/* fly state state */
|
||||
float speed; /* the speed the view is moving per redraw */
|
||||
@ -690,7 +690,7 @@ static void move_camera(bContext *C, RegionView3D *rv3d, FlyInfo *fly, int orien
|
||||
{
|
||||
/* we are in camera view so apply the view ofs and quat to the view matrix and set the camera to the view */
|
||||
|
||||
View3D*v3d = fly->v3d;
|
||||
View3D *v3d = fly->v3d;
|
||||
Scene *scene = fly->scene;
|
||||
ID *id_key;
|
||||
|
||||
@ -1031,7 +1031,7 @@ static int flyApply_ndof(bContext *C, FlyInfo *fly)
|
||||
/* shorthand for oft-used variables */
|
||||
wmNDOFMotionData *ndof = fly->ndof;
|
||||
const float dt = ndof->dt;
|
||||
RegionView3D*rv3d = fly->rv3d;
|
||||
RegionView3D *rv3d = fly->rv3d;
|
||||
const int flag = U.ndof_flag;
|
||||
|
||||
#if 0
|
||||
|
@ -95,8 +95,8 @@ void VIEW3D_OT_render_border(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_zoom_border(struct wmOperatorType *ot);
|
||||
|
||||
void view3d_boxview_copy(ScrArea *sa, ARegion *ar);
|
||||
void ndof_to_quat(struct wmNDOFMotionData* ndof, float q[4]);
|
||||
float ndof_to_axis_angle(struct wmNDOFMotionData* ndof, float axis[3]);
|
||||
void ndof_to_quat(struct wmNDOFMotionData *ndof, float q[4]);
|
||||
float ndof_to_axis_angle(struct wmNDOFMotionData *ndof, float axis[3]);
|
||||
|
||||
/* view3d_fly.c */
|
||||
void view3d_keymap(struct wmKeyConfig *keyconf);
|
||||
@ -120,12 +120,12 @@ void drawaxes(float size, char drawtype);
|
||||
|
||||
void view3d_cached_text_draw_begin(void);
|
||||
void view3d_cached_text_draw_add(const float co[3], const char *str, short xoffs, short flag, const unsigned char col[4]);
|
||||
void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, float mat[][4]);
|
||||
#define V3D_CACHE_TEXT_ZBUF (1<<0)
|
||||
#define V3D_CACHE_TEXT_WORLDSPACE (1<<1)
|
||||
#define V3D_CACHE_TEXT_ASCII (1<<2)
|
||||
#define V3D_CACHE_TEXT_GLOBALSPACE (1<<3)
|
||||
#define V3D_CACHE_TEXT_LOCALCLIP (1<<4)
|
||||
void view3d_cached_text_draw_end(View3D * v3d, ARegion * ar, int depth_write, float mat[][4]);
|
||||
#define V3D_CACHE_TEXT_ZBUF (1 << 0)
|
||||
#define V3D_CACHE_TEXT_WORLDSPACE (1 << 1)
|
||||
#define V3D_CACHE_TEXT_ASCII (1 << 2)
|
||||
#define V3D_CACHE_TEXT_GLOBALSPACE (1 << 3)
|
||||
#define V3D_CACHE_TEXT_LOCALCLIP (1 << 4)
|
||||
|
||||
/* drawarmature.c */
|
||||
int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag, const short is_outline);
|
||||
@ -136,7 +136,7 @@ void draw_mesh_paint(RegionView3D *rv3d, struct Object *ob, struct DerivedMesh *
|
||||
|
||||
/* view3d_draw.c */
|
||||
void view3d_main_area_draw(const struct bContext *C, struct ARegion *ar);
|
||||
void draw_depth(Scene *scene, struct ARegion *ar, View3D *v3d, int (* func)(void *));
|
||||
void draw_depth(Scene *scene, struct ARegion *ar, View3D *v3d, int (*func)(void *));
|
||||
void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d);
|
||||
void add_view3d_after(ListBase *lb, Base *base, int flag);
|
||||
|
||||
@ -160,7 +160,7 @@ void VIEW3D_OT_localview(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_game_start(struct wmOperatorType *ot);
|
||||
|
||||
|
||||
int ED_view3d_boundbox_clip(RegionView3D *rv3d, float obmat[][4], struct BoundBox *bb);
|
||||
int ED_view3d_boundbox_clip(RegionView3D * rv3d, float obmat[][4], struct BoundBox *bb);
|
||||
|
||||
void smooth_view(struct bContext *C, struct View3D *v3d, struct ARegion *ar, struct Object *, struct Object *,
|
||||
float *ofs, float *quat, float *dist, float *lens);
|
||||
|
@ -2055,7 +2055,7 @@ static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], un
|
||||
/* gets called via generic mouse select operator */
|
||||
static int mouse_weight_paint_vertex_select(bContext *C, const int mval[2], short extend, Object *obact)
|
||||
{
|
||||
Mesh*me = obact->data; /* already checked for NULL */
|
||||
Mesh *me = obact->data; /* already checked for NULL */
|
||||
unsigned int index = 0;
|
||||
MVert *mv;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user