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/drawanimviz.c6
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c75
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c21
-rw-r--r--source/blender/editors/space_view3d/drawobject.c151
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c2
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c43
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c32
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c14
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c64
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_intern.h12
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c24
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c25
-rw-r--r--source/blender/editors/space_view3d/view3d_toolbar.c8
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c50
15 files changed, 278 insertions, 251 deletions
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c
index fb271556a9c..4cce166b36b 100644
--- a/source/blender/editors/space_view3d/drawanimviz.c
+++ b/source/blender/editors/space_view3d/drawanimviz.c
@@ -64,7 +64,7 @@
// - include support for editing the path verts
/* Set up drawing environment for drawing motion paths */
-void draw_motion_paths_init(Scene *scene, View3D *v3d, ARegion *ar)
+void draw_motion_paths_init(View3D *v3d, ARegion *ar)
{
RegionView3D *rv3d= ar->regiondata;
@@ -79,7 +79,7 @@ void draw_motion_paths_init(Scene *scene, View3D *v3d, ARegion *ar)
* i.e. draw_motion_paths_init() has been called
*/
// FIXME: the text is still drawn in the wrong space - it includes the current transforms of the object still...
-void draw_motion_path_instance(Scene *scene, View3D *v3d, ARegion *ar,
+void draw_motion_path_instance(Scene *scene,
Object *ob, bPoseChannel *pchan, bAnimVizSettings *avs, bMotionPath *mpath)
{
//RegionView3D *rv3d= ar->regiondata;
@@ -283,7 +283,7 @@ void draw_motion_path_instance(Scene *scene, View3D *v3d, ARegion *ar,
}
/* Clean up drawing environment after drawing motion paths */
-void draw_motion_paths_cleanup(Scene *scene, View3D *v3d, ARegion *ar)
+void draw_motion_paths_cleanup(View3D *v3d)
{
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
glPopMatrix();
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index c6aa4656191..6cbfc2cffe4 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -140,7 +140,7 @@ static void cp_shade_color3ub (char cp[], int offset)
}
/* This function sets the gl-color for coloring a certain bone (based on bcolor) */
-static short set_pchan_glColor (short colCode, int armflag, int boneflag, int constflag)
+static short set_pchan_glColor (short colCode, int boneflag, int constflag)
{
switch (colCode) {
case PCHAN_COLOR_NORMAL:
@@ -551,7 +551,7 @@ static void draw_bone_points(int dt, int armflag, unsigned int boneflag, int id)
}
else {
if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, 0);
+ set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, 0);
else
UI_ThemeColor(TH_BONE_SOLID);
}
@@ -574,7 +574,7 @@ static void draw_bone_points(int dt, int armflag, unsigned int boneflag, int id)
}
else {
if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, 0);
+ set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, 0);
else
UI_ThemeColor(TH_BONE_SOLID);
}
@@ -616,7 +616,7 @@ static float co[16] ={
/* smat, imat = mat & imat to draw screenaligned */
-static void draw_sphere_bone_dist(float smat[][4], float imat[][4], int boneflag, bPoseChannel *pchan, EditBone *ebone)
+static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel *pchan, EditBone *ebone)
{
float head, tail, length, dist;
float *headvec, *tailvec, dirvec[3];
@@ -782,7 +782,7 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag,
else UI_ThemeColor(TH_VERTEX);
}
else if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag);
/* Draw root point if we are not connected */
if ((boneflag & BONE_CONNECTED)==0) {
@@ -903,7 +903,7 @@ static void draw_sphere_bone(int dt, int armflag, int boneflag, int constflag, u
else UI_ThemeColorShade(TH_BONE_SOLID, -30);
}
else if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_SPHEREBONE_END, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_SPHEREBONE_END, boneflag, constflag);
else if (dt==OB_SOLID)
UI_ThemeColorShade(TH_BONE_SOLID, -30);
@@ -933,7 +933,7 @@ static void draw_sphere_bone(int dt, int armflag, int boneflag, int constflag, u
else UI_ThemeColor(TH_BONE_SOLID);
}
else if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_SPHEREBONE_BASE, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_SPHEREBONE_BASE, boneflag, constflag);
else if (dt == OB_SOLID)
UI_ThemeColor(TH_BONE_SOLID);
@@ -1003,7 +1003,7 @@ static void draw_line_bone(int armflag, int boneflag, int constflag, unsigned in
if (armflag & (ARM_EDITMODE|ARM_POSEMODE)) {
glLineWidth(4.0f);
if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag);
else if (armflag & ARM_EDITMODE) {
UI_ThemeColor(TH_WIRE);
}
@@ -1048,7 +1048,7 @@ static void draw_line_bone(int armflag, int boneflag, int constflag, unsigned in
glLoadName(id & 0xFFFF); /* object tag, for bordersel optim */
if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_LINEBONE, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_LINEBONE, boneflag, constflag);
}
glLineWidth(2.0);
@@ -1147,9 +1147,9 @@ static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsign
/* colors for modes */
if (armflag & ARM_POSEMODE) {
if (dt <= OB_WIRE)
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag);
else
- set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, constflag);
}
else if (armflag & ARM_EDITMODE) {
if (dt==OB_WIRE) {
@@ -1171,7 +1171,7 @@ static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsign
glEnable(GL_LIGHTING);
if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, constflag);
else
UI_ThemeColor(TH_BONE_SOLID);
@@ -1186,7 +1186,7 @@ static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsign
if (armflag & ARM_POSEMODE) {
if (constflag) {
/* set constraint colors */
- if (set_pchan_glColor(PCHAN_COLOR_CONSTS, armflag, boneflag, constflag)) {
+ if (set_pchan_glColor(PCHAN_COLOR_CONSTS, boneflag, constflag)) {
glEnable(GL_BLEND);
draw_b_bone_boxes(OB_SOLID, pchan, xwidth, length, zwidth);
@@ -1195,7 +1195,7 @@ static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsign
}
/* restore colors */
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag);
}
}
@@ -1221,9 +1221,9 @@ static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned
/* colors for posemode */
if (armflag & ARM_POSEMODE) {
if (dt <= OB_WIRE)
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag);
else
- set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, constflag);
}
@@ -1245,7 +1245,7 @@ static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned
else if (armflag & ARM_POSEMODE) {
if (constflag) {
/* draw constraint colors */
- if (set_pchan_glColor(PCHAN_COLOR_CONSTS, armflag, boneflag, constflag)) {
+ if (set_pchan_glColor(PCHAN_COLOR_CONSTS, boneflag, constflag)) {
glEnable(GL_BLEND);
draw_bone_solid_octahedral();
@@ -1254,7 +1254,7 @@ static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned
}
/* restore colors */
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag);
}
}
draw_bone_octahedral();
@@ -1262,7 +1262,7 @@ static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned
else {
/* solid */
if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, constflag);
+ set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, constflag);
else
UI_ThemeColor(TH_BONE_SOLID);
draw_bone_solid_octahedral();
@@ -1283,7 +1283,7 @@ static void draw_custom_bone(Scene *scene, View3D *v3d, RegionView3D *rv3d, Obje
/* colors for posemode */
if (armflag & ARM_POSEMODE) {
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, 0);
+ set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, 0);
}
if (id != -1) {
@@ -1565,7 +1565,7 @@ static void bone_matrix_translate_y(float mat[][4], float y)
}
/* assumes object is Armature with pose */
-static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt)
+static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, short ghost)
{
RegionView3D *rv3d= ar->regiondata;
Object *ob= base->object;
@@ -1602,7 +1602,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
if (bone && !(bone->flag & (BONE_HIDDEN_P|BONE_NO_DEFORM|BONE_HIDDEN_PG))) {
if (bone->flag & (BONE_SELECTED)) {
if (bone->layer & arm->layer)
- draw_sphere_bone_dist(smat, imat, bone->flag, pchan, NULL);
+ draw_sphere_bone_dist(smat, imat, pchan, NULL);
}
}
}
@@ -1706,9 +1706,11 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
}
/* prepare colors */
- if (arm->flag & ARM_POSEMODE)
+ if(ghost) {
+ /* 13 October 2009, Disabled this to make ghosting show the right colors (Aligorith) */
+ }
+ else if (arm->flag & ARM_POSEMODE)
set_pchan_colorset(ob, pchan);
-#if 0 // XXX - 13 October 2009, Disabled this to make ghosting show the right colors (Aligorith)
else {
if ((scene->basact)==base) {
if (base->flag & (SELECT+BA_WAS_SEL)) UI_ThemeColor(TH_ACTIVE);
@@ -1719,7 +1721,6 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
else UI_ThemeColor(TH_WIRE);
}
}
-#endif
/* catch exception for bone with hidden parent */
flag= bone->flag;
@@ -1901,7 +1902,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
bone_matrix_translate_y(bmat, pchan->bone->length);
glMultMatrixf(bmat);
- drawaxes(pchan->bone->length*0.25f, 0, OB_ARROWS);
+ drawaxes(pchan->bone->length*0.25f, OB_ARROWS);
glPopMatrix();
}
@@ -1957,7 +1958,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
if (eBone->layer & arm->layer) {
if ((eBone->flag & (BONE_HIDDEN_A|BONE_NO_DEFORM))==0) {
if (eBone->flag & (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL))
- draw_sphere_bone_dist(smat, imat, eBone->flag, NULL, eBone);
+ draw_sphere_bone_dist(smat, imat, NULL, eBone);
}
}
}
@@ -2094,7 +2095,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
bone_matrix_translate_y(bmat, eBone->length);
glMultMatrixf(bmat);
- drawaxes(eBone->length*0.25f, 0, OB_ARROWS);
+ drawaxes(eBone->length*0.25f, OB_ARROWS);
glPopMatrix();
}
@@ -2122,16 +2123,16 @@ static void draw_pose_paths(Scene *scene, View3D *v3d, ARegion *ar, Object *ob)
bPoseChannel *pchan;
/* setup drawing environment for paths */
- draw_motion_paths_init(scene, v3d, ar);
+ draw_motion_paths_init(v3d, ar);
/* draw paths where they exist and they releated bone is visible */
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if ((pchan->bone->layer & arm->layer) && (pchan->mpath))
- draw_motion_path_instance(scene, v3d, ar, ob, pchan, avs, pchan->mpath);
+ draw_motion_path_instance(scene, ob, pchan, avs, pchan->mpath);
}
/* cleanup after drawing */
- draw_motion_paths_cleanup(scene, v3d, ar);
+ draw_motion_paths_cleanup(v3d);
}
@@ -2211,7 +2212,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base
BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
where_is_pose(scene, ob);
- draw_pose_bones(scene, v3d, ar, base, OB_WIRE);
+ draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE);
}
glDisable(GL_BLEND);
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
@@ -2290,7 +2291,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *
BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
where_is_pose(scene, ob);
- draw_pose_bones(scene, v3d, ar, base, OB_WIRE);
+ draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE);
}
glDisable(GL_BLEND);
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
@@ -2360,7 +2361,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
if (CFRA != cfrao) {
BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
where_is_pose(scene, ob);
- draw_pose_bones(scene, v3d, ar, base, OB_WIRE);
+ draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE);
}
}
@@ -2375,7 +2376,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
if (CFRA != cfrao) {
BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
where_is_pose(scene, ob);
- draw_pose_bones(scene, v3d, ar, base, OB_WIRE);
+ draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE);
}
}
}
@@ -2409,7 +2410,7 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in
/* we use color for solid lighting */
glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);
glEnable(GL_COLOR_MATERIAL);
- glColor3ub(0,0,0); // clear spec
+ glColor3ub(255,0,255); // clear spec
glDisable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
@@ -2458,7 +2459,7 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in
}
}
}
- draw_pose_bones(scene, v3d, ar, base, dt);
+ draw_pose_bones(scene, v3d, ar, base, dt, FALSE);
arm->flag &= ~ARM_POSEMODE;
if(ob->mode & OB_MODE_POSE)
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 2da2b39ff19..6b166b470be 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -192,7 +192,7 @@ static int draw_tfaces3D__drawFaceOpts(void *userData, int index)
return 0;
}
-static void draw_tfaces3D(RegionView3D *rv3d, Object *ob, Mesh *me, DerivedMesh *dm)
+static void draw_tfaces3D(RegionView3D *rv3d, Mesh *me, DerivedMesh *dm)
{
struct { Mesh *me; EdgeHash *eh; } data;
@@ -523,7 +523,7 @@ static int draw_em_tf_mapped__set_draw(void *userData, int index)
MCol *mcol;
int matnr;
- if (efa==NULL || efa->h)
+ if (efa->h)
return 0;
tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
@@ -536,12 +536,13 @@ static int draw_em_tf_mapped__set_draw(void *userData, int index)
static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r)
{
Mesh *me = (Mesh*)userData;
- MTFace *tface = (me->mtface)? &me->mtface[index]: NULL;
- MFace *mface = (me->mface)? &me->mface[index]: NULL;
-
- if ((mface->flag&ME_HIDE) || (tface && (tface->mode&TF_INVISIBLE)))
- return 0;
-
+
+ if ( (me->mface && me->mface[index].flag & ME_HIDE) ||
+ (me->mtface && (me->mtface[index].mode & TF_INVISIBLE))
+ ) {
+ return 0;
+ }
+
*drawSmooth_r = 1;
return 1;
}
@@ -647,7 +648,7 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *o
dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, me->edit_mesh);
} else if(faceselect) {
if(ob->mode & OB_MODE_WEIGHT_PAINT)
- dm->drawMappedFaces(dm, NULL, wpaint__setSolidDrawOptions, me, DM_DRAW_VERTEX_COLORS);
+ dm->drawMappedFaces(dm, NULL, wpaint__setSolidDrawOptions, me, GPU_enable_material, DM_DRAW_VERTEX_COLORS);
else
dm->drawMappedFacesTex(dm, draw_tface_mapped__set_draw, me);
}
@@ -670,7 +671,7 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *o
/* draw edges and selected faces over textured mesh */
if(!(ob == scene->obedit) && faceselect)
- draw_tfaces3D(rv3d, ob, me, dm);
+ draw_tfaces3D(rv3d, me, dm);
/* reset from negative scale correction */
glFrontFace(GL_CCW);
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 615f5969a52..5ac76719517 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -398,8 +398,7 @@ static void draw_xyz_wire(float *c, float size, int axis)
}
-/* flag is same as for draw_object */
-void drawaxes(float size, int flag, char drawtype)
+void drawaxes(float size, char drawtype)
{
int axis;
float v1[3]= {0.0, 0.0, 0.0};
@@ -917,6 +916,9 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
copy_m4_m4(imat, rv3d->viewinv);
normalize_v3(imat[0]);
normalize_v3(imat[1]);
+
+ /* lamp center */
+ copy_v3_v3(vec, ob->obmat[3]);
/* for AA effects */
glGetFloatv(GL_CURRENT_COLOR, curcol);
@@ -931,7 +933,6 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
}
/* Inner Circle */
- copy_v3_v3(vec, ob->obmat[3]);
glEnable(GL_BLEND);
drawcircball(GL_LINE_LOOP, vec, lampsize, imat);
glDisable(GL_BLEND);
@@ -1210,7 +1211,7 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob
/* a standing up pyramid with (0,0,0) as top */
Camera *cam;
World *wrld;
- float nobmat[4][4], vec[8][4], fac, facx, facy, depth, aspx, aspy, caspx, caspy;
+ float nobmat[4][4], vec[8][4], fac, facx, facy, depth, aspx, aspy, caspx, caspy, shx, shy;
int i;
cam= ob->data;
@@ -1232,6 +1233,8 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob
if(rv3d->persp>=2 && cam->type==CAM_ORTHO && ob==v3d->camera) {
facx= 0.5*cam->ortho_scale*caspx;
facy= 0.5*cam->ortho_scale*caspy;
+ shx= cam->shiftx * cam->ortho_scale;
+ shy= cam->shifty * cam->ortho_scale;
depth= -cam->clipsta-0.1;
}
else {
@@ -1241,13 +1244,15 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob
depth= - fac*cam->lens/16.0;
facx= fac*caspx;
facy= fac*caspy;
+ shx= cam->shiftx*fac*2;
+ shy= cam->shifty*fac*2;
}
vec[0][0]= 0.0; vec[0][1]= 0.0; vec[0][2]= 0.001; /* GLBUG: for picking at iris Entry (well thats old!) */
- vec[1][0]= facx; vec[1][1]= facy; vec[1][2]= depth;
- vec[2][0]= facx; vec[2][1]= -facy; vec[2][2]= depth;
- vec[3][0]= -facx; vec[3][1]= -facy; vec[3][2]= depth;
- vec[4][0]= -facx; vec[4][1]= facy; vec[4][2]= depth;
+ vec[1][0]= shx + facx; vec[1][1]= shy + facy; vec[1][2]= depth;
+ vec[2][0]= shx + facx; vec[2][1]= shy - facy; vec[2][2]= depth;
+ vec[3][0]= shx - facx; vec[3][1]= shy - facy; vec[3][2]= depth;
+ vec[4][0]= shx - facx; vec[4][1]= shy + facy; vec[4][2]= depth;
glBegin(GL_LINE_LOOP);
glVertex3fv(vec[1]);
@@ -1280,16 +1285,16 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob
if (i==0) glBegin(GL_LINE_LOOP);
else if (i==1 && (ob == v3d->camera)) glBegin(GL_TRIANGLES);
else break;
-
- vec[0][0]= -0.7 * cam->drawsize;
- vec[0][1]= cam->drawsize * (caspy + 0.1);
+
+ vec[0][0]= shx + (-0.7 * cam->drawsize);
+ vec[0][1]= shy + (cam->drawsize * (caspy + 0.1));
glVertex3fv(vec[0]); /* left */
- vec[0][0] *= -1.0;
+ vec[0][0]= shx + (0.7 * cam->drawsize);
glVertex3fv(vec[0]); /* right */
- vec[0][0]= 0.0;
- vec[0][1]= 1.1 * cam->drawsize * (caspy + 0.7);
+ vec[0][0]= shx;
+ vec[0][1]= shy + (1.1 * cam->drawsize * (caspy + 0.7));
glVertex3fv(vec[0]); /* top */
glEnd();
@@ -1461,7 +1466,7 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob)
* if not, ED_view3d_init_mats_rv3d() can be used for selection tools
* but would not give correct results with dupli's for eg. which dont
* use the object matrix in the useual way */
-static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
+static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
{
struct { void (*func)(void *userData, EditVert *eve, int x, int y, int index); void *userData; ViewContext vc; int clipVerts; } *data = userData;
EditVert *eve = EM_get_vert_for_index(index);
@@ -1545,7 +1550,7 @@ void mesh_foreachScreenEdge(ViewContext *vc, void (*func)(void *userData, EditEd
dm->release(dm);
}
-static void mesh_foreachScreenFace__mapFunc(void *userData, int index, float *cent, float *no)
+static void mesh_foreachScreenFace__mapFunc(void *userData, int index, float *cent, float *UNUSED(no))
{
struct { void (*func)(void *userData, EditFace *efa, int x, int y, int index); void *userData; ViewContext vc; } *data = userData;
EditFace *efa = EM_get_face_for_index(index);
@@ -1656,7 +1661,7 @@ static void draw_dm_face_normals(Scene *scene, DerivedMesh *dm)
glEnd();
}
-static void draw_dm_face_centers__mapFunc(void *userData, int index, float *cent, float *no)
+static void draw_dm_face_centers__mapFunc(void *userData, int index, float *cent, float *UNUSED(no))
{
EditFace *efa = EM_get_face_for_index(index);
int sel = *((int*) userData);
@@ -1700,7 +1705,7 @@ static void draw_dm_vert_normals(Scene *scene, DerivedMesh *dm)
}
/* Draw verts with color set based on selection */
-static void draw_dm_verts__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
+static void draw_dm_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
{
struct { int sel; EditVert *eve_act; } * data = userData;
EditVert *eve = EM_get_vert_for_index(index);
@@ -1777,7 +1782,7 @@ static void draw_dm_edges_sel(DerivedMesh *dm, unsigned char *baseCol, unsigned
}
/* Draw edges */
-static int draw_dm_edges__setDrawOptions(void *userData, int index)
+static int draw_dm_edges__setDrawOptions(void *UNUSED(userData), int index)
{
return EM_get_edge_for_index(index)->h==0;
}
@@ -1787,7 +1792,7 @@ static void draw_dm_edges(DerivedMesh *dm)
}
/* Draw edges with color interpolated based on selection */
-static int draw_dm_edges_sel_interp__setDrawOptions(void *userData, int index)
+static int draw_dm_edges_sel_interp__setDrawOptions(void *UNUSED(userData), int index)
{
return EM_get_edge_for_index(index)->h==0;
}
@@ -1812,7 +1817,7 @@ static void draw_dm_edges_sel_interp(DerivedMesh *dm, unsigned char *baseCol, un
}
/* Draw only seam edges */
-static int draw_dm_edges_seams__setDrawOptions(void *userData, int index)
+static int draw_dm_edges_seams__setDrawOptions(void *UNUSED(userData), int index)
{
EditEdge *eed = EM_get_edge_for_index(index);
@@ -1824,7 +1829,7 @@ static void draw_dm_edges_seams(DerivedMesh *dm)
}
/* Draw only sharp edges */
-static int draw_dm_edges_sharp__setDrawOptions(void *userData, int index)
+static int draw_dm_edges_sharp__setDrawOptions(void *UNUSED(userData), int index)
{
EditEdge *eed = EM_get_edge_for_index(index);
@@ -1838,7 +1843,7 @@ static void draw_dm_edges_sharp(DerivedMesh *dm)
/* Draw faces with color set based on selection
* return 2 for the active face so it renders with stipple enabled */
-static int draw_dm_faces_sel__setDrawOptions(void *userData, int index, int *drawSmooth_r)
+static int draw_dm_faces_sel__setDrawOptions(void *userData, int index, int *UNUSED(drawSmooth_r))
{
struct { unsigned char *cols[3]; EditFace *efa_act; } * data = userData;
EditFace *efa = EM_get_face_for_index(index);
@@ -1867,10 +1872,10 @@ static void draw_dm_faces_sel(DerivedMesh *dm, unsigned char *baseCol, unsigned
data.cols[2] = actCol;
data.efa_act = efa_act;
- dm->drawMappedFaces(dm, NULL, draw_dm_faces_sel__setDrawOptions, &data, 0);
+ dm->drawMappedFaces(dm, NULL, draw_dm_faces_sel__setDrawOptions, &data, GPU_enable_material, 0);
}
-static int draw_dm_creases__setDrawOptions(void *userData, int index)
+static int draw_dm_creases__setDrawOptions(void *UNUSED(userData), int index)
{
EditEdge *eed = EM_get_edge_for_index(index);
@@ -1888,7 +1893,7 @@ static void draw_dm_creases(DerivedMesh *dm)
glLineWidth(1.0);
}
-static int draw_dm_bweights__setDrawOptions(void *userData, int index)
+static int draw_dm_bweights__setDrawOptions(void *UNUSED(userData), int index)
{
EditEdge *eed = EM_get_edge_for_index(index);
@@ -1899,7 +1904,7 @@ static int draw_dm_bweights__setDrawOptions(void *userData, int index)
return 0;
}
}
-static void draw_dm_bweights__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
+static void draw_dm_bweights__mapFunc(void *UNUSED(userData), int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
{
EditVert *eve = EM_get_vert_for_index(index);
@@ -1934,7 +1939,7 @@ static void draw_dm_bweights(Scene *scene, DerivedMesh *dm)
/* EditMesh drawing routines*/
-static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, EditMesh *em, DerivedMesh *cageDM, EditVert *eve_act)
+static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, DerivedMesh *cageDM, EditVert *eve_act)
{
ToolSettings *ts= scene->toolsettings;
int sel;
@@ -2225,7 +2230,7 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
}
}
-static int draw_em_fancy__setFaceOpts(void *userData, int index, int *drawSmooth_r)
+static int draw_em_fancy__setFaceOpts(void *UNUSED(userData), int index, int *UNUSED(drawSmooth_r))
{
EditFace *efa = EM_get_face_for_index(index);
@@ -2237,7 +2242,7 @@ static int draw_em_fancy__setFaceOpts(void *userData, int index, int *drawSmooth
return 0;
}
-static int draw_em_fancy__setGLSLFaceOpts(void *userData, int index)
+static int draw_em_fancy__setGLSLFaceOpts(void *UNUSED(userData), int index)
{
EditFace *efa = EM_get_face_for_index(index);
@@ -2287,7 +2292,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object
glEnable(GL_LIGHTING);
glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
- finalDM->drawMappedFaces(finalDM, NULL, draw_em_fancy__setFaceOpts, NULL, 0);
+ finalDM->drawMappedFaces(finalDM, NULL, draw_em_fancy__setFaceOpts, NULL, GPU_enable_material, 0);
glFrontFace(GL_CCW);
glDisable(GL_LIGHTING);
@@ -2383,7 +2388,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object
if(em) {
// XXX retopo_matrix_update(v3d);
- draw_em_fancy_verts(scene, v3d, ob, em, cageDM, eve_act);
+ draw_em_fancy_verts(scene, v3d, ob, cageDM, eve_act);
if(me->drawflag & ME_DRAWNORMALS) {
UI_ThemeColor(TH_NORMAL);
@@ -2433,7 +2438,7 @@ static void draw_mesh_object_outline(View3D *v3d, Object *ob, DerivedMesh *dm)
}
}
-static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r)
+static int wpaint__setSolidDrawOptions(void *UNUSED(userData), int UNUSED(index), int *drawSmooth_r)
{
*drawSmooth_r = 1;
return 1;
@@ -2538,25 +2543,29 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
/* weight paint in solid mode, special case. focus on making the weights clear
* rather then the shading, this is also forced in wire view */
GPU_enable_material(0, NULL);
- dm->drawMappedFaces(dm, NULL, wpaint__setSolidDrawOptions, me->mface, DM_DRAW_VERTEX_COLORS);
+
+ dm->drawMappedFaces(dm, NULL, wpaint__setSolidDrawOptions,
+ me->mface, GPU_enable_material,
+ DM_DRAW_VERTEX_COLORS);
bglPolygonOffset(rv3d->dist, 1.0);
glDepthMask(0); // disable write in zbuffer, selected edge wires show better
glEnable(GL_BLEND);
- glColor4ub(196, 196, 196, 196);
+ glColor4ub(255, 255, 255, 96);
glEnable(GL_LINE_STIPPLE);
- glLineStipple(1, 0x8888);
+ glLineStipple(1, 0xAAAA);
- dm->drawEdges(dm, 1, 0);
+ dm->drawEdges(dm, 1, 1);
bglPolygonOffset(rv3d->dist, 0.0);
glDepthMask(1);
glDisable(GL_LINE_STIPPLE);
GPU_disable_material();
-
-
+
+ /* since we already draw wire as wp guide, dont draw over the top */
+ draw_wire= 0;
}
else {
if((v3d->flag&V3D_SELECT_OUTLINE) && ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) && (base->flag&SELECT) && !draw_wire && !ob->paint)
@@ -2602,7 +2611,9 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
- dm->drawMappedFaces(dm, NULL, wpaint__setSolidDrawOptions, me->mface, DM_DRAW_VERTEX_COLORS);
+ dm->drawMappedFaces(dm, NULL, wpaint__setSolidDrawOptions,
+ me->mface, GPU_enable_material,
+ DM_DRAW_VERTEX_COLORS);
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_LIGHTING);
@@ -2622,12 +2633,14 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
dm->drawMappedFaces(dm, paint_redraw_planes,
wpaint__setSolidDrawOptions, NULL,
+ GPU_enable_material,
dm_flags);
glDisable(GL_LIGHTING);
}
else {
glColor3f(1.0f, 1.0f, 1.0f);
- dm->drawMappedFaces(dm, NULL, wpaint__setSolidDrawOptions, NULL, 0);
+
+ dm->drawMappedFaces(dm, NULL, wpaint__setSolidDrawOptions, NULL, GPU_enable_material, 0);
}
}
else do_draw= 1;
@@ -4044,7 +4057,7 @@ static void draw_update_ptcache_edit(Scene *scene, Object *ob, PTCacheEdit *edit
psys_cache_edit_paths(scene, ob, edit, CFRA);
}
-static void draw_ptcache_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, PTCacheEdit *edit, int dt)
+static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
{
ParticleCacheKey **cache, *path, *pkey;
PTCacheEditPoint *point;
@@ -4838,9 +4851,9 @@ static void draw_empty_cone (float size)
}
/* draw points on curve speed handles */
+#if 0 // XXX old animation system stuff
static void curve_draw_speed(Scene *scene, Object *ob)
{
-#if 0 // XXX old animation system stuff
Curve *cu= ob->data;
IpoCurve *icu;
BezTriple *bezt;
@@ -4866,8 +4879,8 @@ static void curve_draw_speed(Scene *scene, Object *ob)
glPointSize(1.0);
bglEnd();
-#endif // XXX old animation system stuff
}
+#endif // XXX old animation system stuff
static void draw_textcurs(float textcurs[][2])
@@ -5663,13 +5676,13 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
bAnimVizSettings *avs= &ob->avs;
/* setup drawing environment for paths */
- draw_motion_paths_init(scene, v3d, ar);
+ draw_motion_paths_init(v3d, ar);
/* draw motion path for object */
- draw_motion_path_instance(scene, v3d, ar, ob, NULL, avs, ob->mpath);
+ draw_motion_path_instance(scene, ob, NULL, avs, ob->mpath);
/* cleanup after drawing */
- draw_motion_paths_cleanup(scene, v3d, ar);
+ draw_motion_paths_cleanup(v3d);
}
/* multiply view with object matrix.
@@ -5893,9 +5906,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
else if(boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
empty_object= drawDispList(scene, v3d, rv3d, base, dt);
-
- if(cu->path)
- curve_draw_speed(scene, ob);
+
+//XXX old animsys if(cu->path)
+// curve_draw_speed(scene, ob);
}
break;
case OB_MBALL:
@@ -5914,7 +5927,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
case OB_EMPTY:
if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
- drawaxes(ob->empty_drawsize, flag, ob->empty_drawtype);
+ drawaxes(ob->empty_drawsize, ob->empty_drawtype);
break;
case OB_LAMP:
if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
@@ -5940,7 +5953,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
break;
default:
if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
- drawaxes(1.0, flag, OB_ARROWS);
+ drawaxes(1.0, OB_ARROWS);
}
}
@@ -6012,7 +6025,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
PTCacheEdit *edit = PE_create_current(scene, ob);
if(edit) {
glLoadMatrixf(rv3d->viewmat);
- draw_ptcache_edit(scene, v3d, rv3d, ob, edit, dt);
+ draw_ptcache_edit(scene, v3d, edit);
glMultMatrixf(ob->obmat);
}
}
@@ -6066,7 +6079,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
// #if 0
smd->domain->tex = NULL;
GPU_create_smoke(smd, 0);
- draw_volume(scene, ar, v3d, base, smd->domain->tex, smd->domain->p0, smd->domain->p1, smd->domain->res, smd->domain->dx, smd->domain->tex_shadow);
+ draw_volume(ar, smd->domain->tex, smd->domain->p0, smd->domain->p1, smd->domain->res, smd->domain->dx, smd->domain->tex_shadow);
GPU_free_smoke(smd);
// #endif
#if 0
@@ -6117,7 +6130,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
{
smd->domain->tex = NULL;
GPU_create_smoke(smd, 1);
- draw_volume(scene, ar, v3d, base, smd->domain->tex, smd->domain->p0, smd->domain->p1, smd->domain->res_wt, smd->domain->dx_wt, smd->domain->tex_shadow);
+ draw_volume(ar, smd->domain->tex, smd->domain->p0, smd->domain->p1, smd->domain->res_wt, smd->domain->dx_wt, smd->domain->tex_shadow);
GPU_free_smoke(smd);
}
}
@@ -6140,7 +6153,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if(dtx && (G.f & G_RENDER_OGL)==0) {
if(dtx & OB_AXIS) {
- drawaxes(1.0f, flag, OB_ARROWS);
+ drawaxes(1.0f, OB_ARROWS);
}
if(dtx & OB_BOUNDBOX) {
if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
@@ -6280,7 +6293,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
/* ***************** BACKBUF SEL (BBS) ********* */
-static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
+static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
{
int offset = (intptr_t) userData;
EditVert *eve = EM_get_vert_for_index(index);
@@ -6316,7 +6329,7 @@ static void bbs_mesh_wire(DerivedMesh *dm, int offset)
dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, (void*)(intptr_t) offset);
}
-static int bbs_mesh_solid__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r)
+static int bbs_mesh_solid__setSolidDrawOptions(void *userData, int index, int *UNUSED(drawSmooth_r))
{
if (EM_get_face_for_index(index)->h==0) {
if (userData) {
@@ -6328,7 +6341,7 @@ static int bbs_mesh_solid__setSolidDrawOptions(void *userData, int index, int *d
}
}
-static void bbs_mesh_solid__drawCenter(void *userData, int index, float *cent, float *no)
+static void bbs_mesh_solid__drawCenter(void *UNUSED(userData), int index, float *cent, float *UNUSED(no))
{
EditFace *efa = EM_get_face_for_index(index);
@@ -6345,7 +6358,7 @@ static void bbs_mesh_solid_EM(Scene *scene, View3D *v3d, Object *ob, DerivedMesh
cpack(0);
if (facecol) {
- dm->drawMappedFaces(dm, NULL, bbs_mesh_solid__setSolidDrawOptions, (void*)(intptr_t) 1, 0);
+ dm->drawMappedFaces(dm, NULL, bbs_mesh_solid__setSolidDrawOptions, (void*)(intptr_t) 1, GPU_enable_material, 0);
if(check_ob_drawface_dot(scene, v3d, ob->dt)) {
glPointSize(UI_GetThemeValuef(TH_FACEDOT_SIZE));
@@ -6356,17 +6369,17 @@ static void bbs_mesh_solid_EM(Scene *scene, View3D *v3d, Object *ob, DerivedMesh
}
} else {
- dm->drawMappedFaces(dm, NULL, bbs_mesh_solid__setSolidDrawOptions, (void*) 0, 0);
+ dm->drawMappedFaces(dm, NULL, bbs_mesh_solid__setSolidDrawOptions, (void*) 0, GPU_enable_material, 0);
}
}
-static int bbs_mesh_solid__setDrawOpts(void *userData, int index, int *drawSmooth_r)
+static int bbs_mesh_solid__setDrawOpts(void *UNUSED(userData), int index, int *UNUSED(drawSmooth_r))
{
WM_set_framebuffer_index_color(index+1);
return 1;
}
-static int bbs_mesh_solid_hide__setDrawOpts(void *userData, int index, int *drawSmooth_r)
+static int bbs_mesh_solid_hide__setDrawOpts(void *userData, int index, int *UNUSED(drawSmooth_r))
{
Mesh *me = userData;
@@ -6387,9 +6400,13 @@ static void bbs_mesh_solid(Scene *scene, View3D *v3d, Object *ob)
glColor3ub(0, 0, 0);
if(face_sel_mode)
- dm->drawMappedFaces(dm, NULL, bbs_mesh_solid_hide__setDrawOpts, me, DM_DRAW_BACKBUF_SELECTION);
+ dm->drawMappedFaces(dm, NULL, bbs_mesh_solid_hide__setDrawOpts,
+ me, GPU_enable_material,
+ DM_DRAW_BACKBUF_SELECTION);
else
- dm->drawMappedFaces(dm, NULL, bbs_mesh_solid__setDrawOpts, me, DM_DRAW_BACKBUF_SELECTION);
+ dm->drawMappedFaces(dm, NULL, bbs_mesh_solid__setDrawOpts,
+ me, GPU_enable_material,
+ DM_DRAW_BACKBUF_SELECTION);
dm->release(dm);
}
@@ -6496,7 +6513,7 @@ static void draw_object_mesh_instance(Scene *scene, View3D *v3d, RegionView3D *r
GPU_end_object_materials();
}
else if(edm)
- edm->drawMappedFaces(edm, NULL, NULL, NULL, 0);
+ edm->drawMappedFaces(edm, NULL, NULL, NULL, GPU_enable_material, 0);
glDisable(GL_LIGHTING);
}
@@ -6515,7 +6532,7 @@ void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object
draw_object_mesh_instance(scene, v3d, rv3d, ob, dt, outline);
break;
case OB_EMPTY:
- drawaxes(ob->empty_drawsize, 0, ob->empty_drawtype);
+ drawaxes(ob->empty_drawsize, ob->empty_drawtype);
break;
}
}
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 678920f8173..611cf68d81c 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -175,7 +175,7 @@ static int larger_pow2(int n)
return n*2;
}
-void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture *tex, float *min, float *max, int res[3], float dx, GPUTexture *tex_shadow)
+void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3], float dx, GPUTexture *tex_shadow)
{
RegionView3D *rv3d= ar->regiondata;
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 8a215834c38..6261ca52564 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -274,7 +274,7 @@ static void view3d_free(SpaceLink *sl)
/* spacetype; init callback */
-static void view3d_init(struct wmWindowManager *wm, ScrArea *sa)
+static void view3d_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa))
{
}
@@ -387,7 +387,7 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar)
}
-static int view3d_ob_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
+static int view3d_ob_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
if(drag->type==WM_DRAG_ID) {
ID *id= (ID *)drag->poin;
@@ -397,7 +397,7 @@ static int view3d_ob_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
return 0;
}
-static int view3d_mat_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
+static int view3d_mat_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
if(drag->type==WM_DRAG_ID) {
ID *id= (ID *)drag->poin;
@@ -407,7 +407,7 @@ static int view3d_mat_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
return 0;
}
-static int view3d_ima_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
+static int view3d_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
if(drag->type==WM_DRAG_ID) {
ID *id= (ID *)drag->poin;
@@ -548,22 +548,36 @@ static void view3d_recalc_used_layers(ARegion *ar, wmNotifier *wmn, Scene *scene
base= base->next;
}
- sa= win->screen->areabase.first;
- while(sa) {
- if(sa->spacetype == SPACE_VIEW3D)
- if(BLI_findindex(&sa->regionbase, ar) >= 0) {
+ for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ if(sa->spacetype == SPACE_VIEW3D) {
+ if(BLI_findindex(&sa->regionbase, ar) != -1) {
View3D *v3d= sa->spacedata.first;
v3d->lay_used= lay_used;
break;
}
+ }
+ }
+}
- sa= sa->next;
+static View3D *view3d_from_wmn(ARegion *ar, wmNotifier *wmn)
+{
+ wmWindow *win= wmn->wm->winactive;
+ ScrArea *sa;
+
+ for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ if(sa->spacetype == SPACE_VIEW3D)
+ if(BLI_findindex(&sa->regionbase, ar) != -1) {
+ return (View3D *)sa->spacedata.first;
+ }
}
+
+ return NULL;
}
static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
{
bScreen *sc;
+ View3D *v3d;
/* context changes */
switch(wmn->category) {
@@ -600,6 +614,11 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
case ND_MODE:
ED_region_tag_redraw(ar);
break;
+ case ND_WORLD:
+ v3d= view3d_from_wmn(ar, wmn);
+ if(v3d->flag2 & V3D_RENDER_OVERRIDE)
+ ED_region_tag_redraw(ar);
+ break;
}
if (wmn->action == NA_EDITED)
ED_region_tag_redraw(ar);
@@ -650,7 +669,9 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
case NC_WORLD:
switch(wmn->data) {
case ND_WORLD_DRAW:
- ED_region_tag_redraw(ar);
+ v3d= view3d_from_wmn(ar, wmn);
+ if(v3d->flag2 & V3D_RENDER_OVERRIDE)
+ ED_region_tag_redraw(ar);
break;
}
break;
@@ -705,7 +726,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
}
/* concept is to retrieve cursor type context-less */
-static void view3d_main_area_cursor(wmWindow *win, ScrArea *sa, ARegion *ar)
+static void view3d_main_area_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion *UNUSED(ar))
{
Scene *scene= win->screen->scene;
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index a0167c87d87..450b3725bdb 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -128,7 +128,7 @@ typedef struct {
/* is used for both read and write... */
-static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d, Object *ob, float lim)
+static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim)
{
uiBlock *block= (layout)? uiLayoutAbsoluteBlock(layout): NULL;
MDeformVert *dvert=NULL;
@@ -643,7 +643,7 @@ static void vgroup_normalize_active(Object *ob)
}
-static void do_view3d_vgroup_buttons(bContext *C, void *arg, int event)
+static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event)
{
Scene *scene= CTX_data_scene(C);
Object *ob= OBACT;
@@ -670,7 +670,7 @@ static void do_view3d_vgroup_buttons(bContext *C, void *arg, int event)
WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
}
-int view3d_panel_vgroup_poll(const bContext *C, PanelType *pt)
+int view3d_panel_vgroup_poll(const bContext *C, PanelType *UNUSED(pt))
{
Scene *scene= CTX_data_scene(C);
Object *ob= OBACT;
@@ -794,7 +794,7 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr)
}
}
-static void v3d_posearmature_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim)
+static void v3d_posearmature_buts(uiLayout *layout, Object *ob)
{
// uiBlock *block= uiLayoutGetBlock(layout);
// bArmature *arm;
@@ -896,7 +896,7 @@ void validate_editbonebutton_cb(bContext *C, void *bonev, void *namev)
WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, CTX_data_edit_object(C)); // XXX fix
}
-static void v3d_editarmature_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim)
+static void v3d_editarmature_buts(uiLayout *layout, Object *ob)
{
// uiBlock *block= uiLayoutGetBlock(layout);
bArmature *arm= ob->data;
@@ -930,7 +930,7 @@ static void v3d_editarmature_buts(uiLayout *layout, View3D *v3d, Object *ob, flo
uiItemR(col, &eboneptr, "roll", 0, "Roll", 0);
}
-static void v3d_editmetaball_buts(uiLayout *layout, Object *ob, float lim)
+static void v3d_editmetaball_buts(uiLayout *layout, Object *ob)
{
PointerRNA mbptr, ptr;
MetaBall *mball= ob->data;
@@ -989,7 +989,7 @@ static int test_parent_loop(Object *par, Object *ob)
return test_parent_loop(par->parent, ob);
}
-static void do_view3d_region_buttons(bContext *C, void *arg, int event)
+static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event)
{
Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
@@ -1012,7 +1012,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event)
case B_OBJECTPANELMEDIAN:
if(ob) {
- v3d_editvertex_buts(C, NULL, v3d, ob, 1.0);
+ v3d_editvertex_buts(NULL, v3d, ob, 1.0);
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
}
break;
@@ -1152,12 +1152,12 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event)
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, ob);
}
-void removeTransformOrientation_func(bContext *C, void *target, void *unused)
+void removeTransformOrientation_func(bContext *C, void *target, void *UNUSED(arg))
{
BIF_removeTransformOrientation(C, (TransformOrientation *) target);
}
-void selectTransformOrientation_func(bContext *C, void *target, void *unused)
+void selectTransformOrientation_func(bContext *C, void *target, void *UNUSED(arg))
{
BIF_selectTransformOrientation(C, (TransformOrientation *) target);
}
@@ -1203,12 +1203,12 @@ static void view3d_panel_object(const bContext *C, Panel *pa)
RNA_id_pointer_create(&ob->id, &obptr);
if(ob==obedit) {
- if(ob->type==OB_ARMATURE) v3d_editarmature_buts(col, v3d, ob, lim);
- if(ob->type==OB_MBALL) v3d_editmetaball_buts(col, ob, lim);
- else v3d_editvertex_buts(C, col, v3d, ob, lim);
+ if(ob->type==OB_ARMATURE) v3d_editarmature_buts(col, ob);
+ if(ob->type==OB_MBALL) v3d_editmetaball_buts(col, ob);
+ else v3d_editvertex_buts(col, v3d, ob, lim);
}
else if(ob->mode & OB_MODE_POSE) {
- v3d_posearmature_buts(col, v3d, ob, lim);
+ v3d_posearmature_buts(col, ob);
}
else {
@@ -1421,7 +1421,7 @@ static void view3d_panel_operator_redo(const bContext *C, Panel *pa)
}
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
- uiDefAutoButsRNA(C, pa->layout, &ptr, 2);
+ uiDefAutoButsRNA(pa->layout, &ptr, 2);
}
#endif // XXX not used
@@ -1451,7 +1451,7 @@ void view3d_buttons_register(ARegionType *art)
// XXX view3d_panel_preview(C, ar, 0);
}
-static int view3d_properties(bContext *C, wmOperator *op)
+static int view3d_properties(bContext *C, wmOperator *UNUSED(op))
{
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= view3d_has_buttons_region(sa);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index c643b47f5d2..ef3894a02e0 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1141,7 +1141,7 @@ ImBuf *view3d_read_backbuf(ViewContext *vc, short xmin, short ymin, short xmax,
if(ymax >= vc->ar->winy) ymaxc= vc->ar->winy-1; else ymaxc= ymax;
if(yminc > ymaxc) return NULL;
- ibuf= IMB_allocImBuf((xmaxc-xminc+1), (ymaxc-yminc+1), 32, IB_rect,0);
+ ibuf= IMB_allocImBuf((xmaxc-xminc+1), (ymaxc-yminc+1), 32, IB_rect);
view3d_validate_backbuf(vc);
@@ -1161,7 +1161,7 @@ ImBuf *view3d_read_backbuf(ViewContext *vc, short xmin, short ymin, short xmax,
if(xminc==xmin && xmaxc==xmax && yminc==ymin && ymaxc==ymax)
return ibuf;
- ibuf1= IMB_allocImBuf( (xmax-xmin+1),(ymax-ymin+1),32,IB_rect,0);
+ ibuf1= IMB_allocImBuf( (xmax-xmin+1),(ymax-ymin+1),32,IB_rect);
rd= ibuf->rect;
dr= ibuf1->rect;
@@ -1590,7 +1590,7 @@ static void draw_dupli_objects(Scene *scene, ARegion *ar, View3D *v3d, Base *bas
}
-void view3d_update_depths(ARegion *ar, View3D *v3d)
+void view3d_update_depths(ARegion *ar)
{
RegionView3D *rv3d= ar->regiondata;
@@ -2093,7 +2093,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
}
/* read in pixels & stamp */
- ibuf= IMB_allocImBuf(sizex, sizey, 32, flag, 0);
+ ibuf= IMB_allocImBuf(sizex, sizey, 32, flag);
if(ibuf->rect_float)
glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, ibuf->rect_float);
@@ -2386,7 +2386,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
// retopo= retopo_mesh_check() || retopo_curve_check();
sculptparticle= (obact && obact->mode & (OB_MODE_PARTICLE_EDIT)) && !scene->obedit;
if(retopo)
- view3d_update_depths(ar, v3d);
+ view3d_update_depths(ar);
/* draw selected and editmode */
for(base= scene->base.first; base; base= base->next) {
@@ -2397,7 +2397,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
}
if(!retopo && sculptparticle && !(obact && (obact->dtx & OB_DRAWXRAY))) {
- view3d_update_depths(ar, v3d);
+ view3d_update_depths(ar);
}
// REEB_draw();
@@ -2410,7 +2410,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
if(!retopo && sculptparticle && (obact && (OBACT->dtx & OB_DRAWXRAY))) {
- view3d_update_depths(ar, v3d);
+ view3d_update_depths(ar);
}
if(rv3d->rflag & RV3D_CLIPPING)
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 06d93f01e02..dc75efcc5ca 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -1274,7 +1274,7 @@ void VIEW3D_OT_zoom(wmOperatorType *ot)
RNA_def_int(ot->srna, "my", 0, 0, INT_MAX, "Zoom Position Y", "", 0, INT_MAX);
}
-static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.4x */
+static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.4x */
{
ARegion *ar= CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
@@ -1289,12 +1289,11 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.
int ok= 1, onedone=0;
if(center) {
- min[0]= min[1]= min[2]= 0.0f;
- max[0]= max[1]= max[2]= 0.0f;
-
/* in 2.4x this also move the cursor to (0, 0, 0) (with shift+c). */
curs= give_cursor(scene, v3d);
- curs[0]= curs[1]= curs[2]= 0.0;
+ zero_v3(min);
+ zero_v3(max);
+ zero_v3(curs);
}
else {
INIT_MINMAX(min, max);
@@ -1318,9 +1317,7 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.
return OPERATOR_FINISHED;
}
- afm[0]= (max[0]-min[0]);
- afm[1]= (max[1]-min[1]);
- afm[2]= (max[2]-min[2]);
+ sub_v3_v3v3(afm, max, min);
size= 0.7f*MAX3(afm[0], afm[1], afm[2]);
if(size==0.0) ok= 0;
@@ -1342,7 +1339,7 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.
if (rv3d->persp==RV3D_CAMOB) {
rv3d->persp= RV3D_PERSP;
- smooth_view(C, NULL, v3d->camera, new_ofs, NULL, &new_dist, NULL);
+ smooth_view(C, v3d->camera, NULL, new_ofs, NULL, &new_dist, NULL);
}
else {
smooth_view(C, NULL, NULL, new_ofs, NULL, &new_dist, NULL);
@@ -1358,17 +1355,6 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.
return OPERATOR_FINISHED;
}
-static int viewhome_poll(bContext *C)
-{
- if(ED_operator_view3d_active(C)) {
- RegionView3D *rv3d= CTX_wm_region_view3d(C); //XXX, when accessed from a header menu this doesnt work!
- if(rv3d && rv3d->persp!=RV3D_CAMOB) {
- return 1;
- }
- }
-
- return 0;
-}
void VIEW3D_OT_view_all(wmOperatorType *ot)
{
@@ -1378,8 +1364,8 @@ void VIEW3D_OT_view_all(wmOperatorType *ot)
ot->idname= "VIEW3D_OT_view_all";
/* api callbacks */
- ot->exec= viewhome_exec;
- ot->poll= viewhome_poll;
+ ot->exec= view3d_all_exec;
+ ot->poll= ED_operator_view3d_active;
/* flags */
ot->flag= 0;
@@ -1388,7 +1374,7 @@ void VIEW3D_OT_view_all(wmOperatorType *ot)
}
-static int viewselected_exec(bContext *C, wmOperator *op) /* like a localview without local!, was centerview() in 2.4x */
+static int viewselected_exec(bContext *C, wmOperator *UNUSED(op)) /* like a localview without local!, was centerview() in 2.4x */
{
ARegion *ar= CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
@@ -1528,7 +1514,7 @@ void VIEW3D_OT_view_selected(wmOperatorType *ot)
ot->flag= 0;
}
-static int viewcenter_cursor_exec(bContext *C, wmOperator *op)
+static int viewcenter_cursor_exec(bContext *C, wmOperator *UNUSED(op))
{
View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d= CTX_wm_region_view3d(C);
@@ -1562,7 +1548,7 @@ void VIEW3D_OT_view_center_cursor(wmOperatorType *ot)
ot->flag= 0;
}
-static int view3d_center_camera_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.4x */
+static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was view3d_home() in 2.4x */
{
RegionView3D *rv3d= CTX_wm_region_view3d(C);
@@ -1705,7 +1691,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
rv3d->depths->damaged = 1;
}
- view3d_update_depths(ar, v3d);
+ view3d_update_depths(ar);
/* Constrain rect to depth bounds */
if (rect.xmin < 0) rect.xmin = 0;
@@ -2135,14 +2121,11 @@ static int viewpan_exec(bContext *C, wmOperator *op)
pandir = RNA_enum_get(op->ptr, "type");
initgrabz(rv3d, 0.0, 0.0, 0.0);
-
if(pandir == V3D_VIEW_PANRIGHT) window_to_3d_delta(ar, vec, -32, 0);
else if(pandir == V3D_VIEW_PANLEFT) window_to_3d_delta(ar, vec, 32, 0);
else if(pandir == V3D_VIEW_PANUP) window_to_3d_delta(ar, vec, 0, -25);
else if(pandir == V3D_VIEW_PANDOWN) window_to_3d_delta(ar, vec, 0, 25);
- rv3d->ofs[0]+= vec[0];
- rv3d->ofs[1]+= vec[1];
- rv3d->ofs[2]+= vec[2];
+ add_v3_v3(rv3d->ofs, vec);
if(rv3d->viewlock & RV3D_BOXVIEW)
view3d_boxview_sync(CTX_wm_area(C), ar);
@@ -2168,7 +2151,7 @@ void VIEW3D_OT_view_pan(wmOperatorType *ot)
RNA_def_enum(ot->srna, "type", prop_view_pan_items, 0, "Pan", "Direction of View Pan");
}
-static int viewpersportho_exec(bContext *C, wmOperator *op)
+static int viewpersportho_exec(bContext *C, wmOperator *UNUSED(op))
{
ARegion *ar= CTX_wm_region(C);
RegionView3D *rv3d= CTX_wm_region_view3d(C);
@@ -2217,16 +2200,15 @@ static BGpic *add_background_image(bContext *C)
return bgpic;
}
-static int add_background_image_exec(bContext *C, wmOperator *op)
+static int add_background_image_exec(bContext *C, wmOperator *UNUSED(op))
{
add_background_image(C);
return OPERATOR_FINISHED;
}
-static int add_background_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int add_background_image_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- Scene *scene= CTX_data_scene(C);
View3D *v3d= CTX_wm_view3d(C);
Image *ima= NULL;
BGpic *bgpic;
@@ -2237,7 +2219,7 @@ static int add_background_image_invoke(bContext *C, wmOperator *op, wmEvent *eve
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);
- ima= BKE_add_image_file(path, scene ? scene->r.cfra : 1);
+ ima= BKE_add_image_file(path);
}
else if(RNA_property_is_set(op->ptr, "name")) {
RNA_string_get(op->ptr, "name", name);
@@ -2427,7 +2409,7 @@ void VIEW3D_OT_clip_border(wmOperatorType *ot)
/* ***************** 3d cursor cursor op ******************* */
/* mx my in region coords */
-static int set_3dcursor_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
Scene *scene= CTX_data_scene(C);
ARegion *ar= CTX_wm_region(C);
@@ -2552,7 +2534,7 @@ void VIEW3D_OT_manipulator(wmOperatorType *ot)
Transform_Properties(ot, P_CONSTRAINT);
}
-static int enable_manipulator_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int enable_manipulator_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
View3D *v3d = CTX_wm_view3d(C);
@@ -2661,7 +2643,7 @@ int view_autodist(Scene *scene, ARegion *ar, View3D *v3d, short *mval, float mou
rv3d->depths->damaged = 1;
}
- view3d_update_depths(ar, v3d);
+ view3d_update_depths(ar);
depth_close= view_autodist_depth_margin(ar, mval, 4);
@@ -2705,7 +2687,7 @@ int view_autodist_init(Scene *scene, ARegion *ar, View3D *v3d, int mode) //, flo
rv3d->depths->damaged = 1;
}
- view3d_update_depths(ar, v3d);
+ view3d_update_depths(ar);
return 1;
}
@@ -2802,7 +2784,7 @@ void filterNDOFvalues(float *sbval)
int dz_flag = 0;
float m_dist;
-void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int mode)
+void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int UNUSED(mode))
{
RegionView3D *rv3d= ar->regiondata;
int i;
@@ -2931,7 +2913,7 @@ void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int mode)
// XXX BIF_view3d_previewrender_signal(ar, PR_DBASE|PR_DISPRECT);
}
-void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
+void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int UNUSED(mode))
{
RegionView3D *rv3d= ar->regiondata;
float fval[7];
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index f9b8c6a5d62..c8a24acd582 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -304,7 +304,7 @@ static char *view3d_modeselect_pup(Scene *scene)
}
-static void do_view3d_header_buttons(bContext *C, void *arg, int event)
+static void do_view3d_header_buttons(bContext *C, void *UNUSED(arg), int event)
{
wmWindow *win= CTX_wm_window(C);
ToolSettings *ts= CTX_data_tool_settings(C);
diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h
index 4065b159ccf..9d1f5a77a3f 100644
--- a/source/blender/editors/space_view3d/view3d_intern.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -93,11 +93,11 @@ void VIEW3D_OT_drawtype(struct wmOperatorType *ot);
void view3d_boxview_copy(ScrArea *sa, ARegion *ar);
/* drawanim.c */
-void draw_motion_paths_init(Scene *scene, View3D *v3d, struct ARegion *ar);
-void draw_motion_path_instance(Scene *scene, View3D *v3d, struct ARegion *ar,
+void draw_motion_paths_init(View3D *v3d, struct ARegion *ar);
+void draw_motion_path_instance(Scene *scene,
struct Object *ob, struct bPoseChannel *pchan,
struct bAnimVizSettings *avs, struct bMotionPath *mpath);
-void draw_motion_paths_cleanup(Scene *scene, View3D *v3d, struct ARegion *ar);
+void draw_motion_paths_cleanup(View3D *v3d);
@@ -106,7 +106,7 @@ void draw_object(Scene *scene, struct ARegion *ar, View3D *v3d, Base *base, int
int draw_glsl_material(Scene *scene, struct Object *ob, View3D *v3d, int dt);
void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob, int dt, int outline);
void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob);
-void drawaxes(float size, int flag, char drawtype);
+void drawaxes(float size, char drawtype);
void view3d_cached_text_draw_begin(void);
void view3d_cached_text_draw_add(float x, float y, float z, char *str, short xoffs, short flag);
@@ -130,7 +130,7 @@ void add_view3d_after(ListBase *lb, Base *base, int flag);
void circf(float x, float y, float rad);
void circ(float x, float y, float rad);
-void view3d_update_depths(struct ARegion *ar, View3D *v3d);
+void view3d_update_depths(struct ARegion *ar);
/* view3d_select.c */
void VIEW3D_OT_select(struct wmOperatorType *ot);
@@ -189,7 +189,7 @@ ARegion *view3d_has_buttons_region(ScrArea *sa);
ARegion *view3d_has_tools_region(ScrArea *sa);
/* draw_volume.c */
-void draw_volume(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct Base *base, struct GPUTexture *tex, float *min, float *max, int res[3], float dx, struct GPUTexture *tex_shadow);
+void draw_volume(struct ARegion *ar, struct GPUTexture *tex, float *min, float *max, int res[3], float dx, struct GPUTexture *tex_shadow);
#endif /* ED_VIEW3D_INTERN_H */
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 7e6e8e0e6af..e3212e8a3d1 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -189,9 +189,9 @@ void EM_backbuf_checkAndSelectTFaces(Mesh *me, int select)
}
}
+#if 0
void arrows_move_cursor(unsigned short event)
{
-#if 0
short mval[2];
getmouseco_sc(mval);
@@ -205,8 +205,8 @@ void arrows_move_cursor(unsigned short event)
} else if(event==RIGHTARROWKEY) {
warp_pointer(mval[0]+1, mval[1]);
}
-#endif
}
+#endif
/* *********************** GESTURE AND LASSO ******************* */
@@ -404,7 +404,7 @@ void lasso_select_boundbox(rcti *rect, short mcords[][2], short moves)
}
}
-static void do_lasso_select_mesh__doSelectVert(void *userData, EditVert *eve, int x, int y, int index)
+static void do_lasso_select_mesh__doSelectVert(void *userData, EditVert *eve, int x, int y, int UNUSED(index))
{
struct { ViewContext vc; rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData;
@@ -431,7 +431,7 @@ static void do_lasso_select_mesh__doSelectEdge(void *userData, EditEdge *eed, in
}
}
}
-static void do_lasso_select_mesh__doSelectFace(void *userData, EditFace *efa, int x, int y, int index)
+static void do_lasso_select_mesh__doSelectFace(void *userData, EditFace *efa, int x, int y, int UNUSED(index))
{
struct { ViewContext vc; rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData;
@@ -560,7 +560,7 @@ static void do_lasso_select_mesh_uv(short mcords[][2], short moves, short select
}
#endif
-static void do_lasso_select_curve__doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
+static void do_lasso_select_curve__doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
{
struct { ViewContext *vc; short (*mcords)[2]; short moves; short select; } *data = userData;
Object *obedit= data->vc->obedit;
@@ -1291,7 +1291,7 @@ int edge_inside_circle(short centx, short centy, short rad, short x1, short y1,
return 0;
}
-static void do_nurbs_box_select__doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
+static void do_nurbs_box_select__doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
{
struct { ViewContext *vc; rcti *rect; int select; } *data = userData;
Object *obedit= data->vc->obedit;
@@ -1359,7 +1359,7 @@ static void do_lattice_box_select(ViewContext *vc, rcti *rect, int select, int e
lattice_foreachScreenVert(vc, do_lattice_box_select__doSelect, &data);
}
-static void do_mesh_box_select__doSelectVert(void *userData, EditVert *eve, int x, int y, int index)
+static void do_mesh_box_select__doSelectVert(void *userData, EditVert *eve, int x, int y, int UNUSED(index))
{
struct { ViewContext vc; rcti *rect; short select, pass, done; } *data = userData;
@@ -1384,7 +1384,7 @@ static void do_mesh_box_select__doSelectEdge(void *userData, EditEdge *eed, int
}
}
}
-static void do_mesh_box_select__doSelectFace(void *userData, EditFace *efa, int x, int y, int index)
+static void do_mesh_box_select__doSelectFace(void *userData, EditFace *efa, int x, int y, int UNUSED(index))
{
struct { ViewContext vc; rcti *rect; short select, pass, done; } *data = userData;
@@ -1800,7 +1800,7 @@ void VIEW3D_OT_select(wmOperatorType *ot)
/* -------------------- circle select --------------------------------------------- */
-static void mesh_circle_doSelectVert(void *userData, EditVert *eve, int x, int y, int index)
+static void mesh_circle_doSelectVert(void *userData, EditVert *eve, int x, int y, int UNUSED(index))
{
struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
@@ -1810,7 +1810,7 @@ static void mesh_circle_doSelectVert(void *userData, EditVert *eve, int x, int y
eve->f = data->select?(eve->f|1):(eve->f&~1);
}
}
-static void mesh_circle_doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index)
+static void mesh_circle_doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int UNUSED(index))
{
struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData;
@@ -1818,7 +1818,7 @@ static void mesh_circle_doSelectEdge(void *userData, EditEdge *eed, int x0, int
EM_select_edge(eed, data->select);
}
}
-static void mesh_circle_doSelectFace(void *userData, EditFace *efa, int x, int y, int index)
+static void mesh_circle_doSelectFace(void *userData, EditFace *efa, int x, int y, int UNUSED(index))
{
struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
@@ -1892,7 +1892,7 @@ static void paint_facesel_circle_select(ViewContext *vc, int selecting, short *m
}
-static void nurbscurve_circle_doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
+static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
{
struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index 7f5f7665028..d6778070931 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -82,7 +82,7 @@ static TransVert *transvmain=NULL;
static int tottrans= 0;
/* copied from editobject.c, now uses (almost) proper depgraph */
-static void special_transvert_update(Scene *scene, Object *obedit)
+static void special_transvert_update(Object *obedit)
{
if(obedit) {
@@ -443,7 +443,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
/* *********************** operators ******************** */
-static int snap_sel_to_grid(bContext *C, wmOperator *op)
+static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
{
extern float originmat[3][3]; /* XXX object.c */
Main *bmain= CTX_data_main(C);
@@ -481,7 +481,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *op)
VECCOPY(tv->loc, vec);
}
- special_transvert_update(scene, obedit);
+ special_transvert_update(obedit);
MEM_freeN(transvmain);
transvmain= NULL;
@@ -577,7 +577,7 @@ void VIEW3D_OT_snap_selected_to_grid(wmOperatorType *ot)
/* *************************************************** */
-static int snap_sel_to_curs(bContext *C, wmOperator *op)
+static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
{
extern float originmat[3][3]; /* XXX object.c */
Main *bmain= CTX_data_main(C);
@@ -602,15 +602,12 @@ static int snap_sel_to_curs(bContext *C, wmOperator *op)
tv= transvmain;
for(a=0; a<tottrans; a++, tv++) {
- vec[0]= curs[0]-obedit->obmat[3][0];
- vec[1]= curs[1]-obedit->obmat[3][1];
- vec[2]= curs[2]-obedit->obmat[3][2];
-
+ sub_v3_v3v3(vec, curs, obedit->obmat[3]);
mul_m3_v3(imat, vec);
- VECCOPY(tv->loc, vec);
+ copy_v3_v3(tv->loc, vec);
}
- special_transvert_update(scene, obedit);
+ special_transvert_update(obedit);
MEM_freeN(transvmain);
transvmain= NULL;
@@ -703,7 +700,7 @@ void VIEW3D_OT_snap_selected_to_cursor(wmOperatorType *ot)
/* *************************************************** */
-static int snap_curs_to_grid(bContext *C, wmOperator *op)
+static int snap_curs_to_grid(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene= CTX_data_scene(C);
RegionView3D *rv3d= CTX_wm_region_data(C);
@@ -740,7 +737,7 @@ void VIEW3D_OT_snap_cursor_to_grid(wmOperatorType *ot)
/* **************************************************** */
-static int snap_curs_to_sel(bContext *C, wmOperator *op)
+static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
Scene *scene= CTX_data_scene(C);
@@ -847,7 +844,7 @@ void VIEW3D_OT_snap_cursor_to_selected(wmOperatorType *ot)
/* ********************************************** */
-static int snap_curs_to_active(bContext *C, wmOperator *op)
+static int snap_curs_to_active(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
Object *obact= CTX_data_active_object(C);
@@ -898,7 +895,7 @@ void VIEW3D_OT_snap_cursor_to_active(wmOperatorType *ot)
/* **************************************************** */
/*New Code - Snap Cursor to Center -*/
-static int snap_curs_to_center(bContext *C, wmOperator *op)
+static int snap_curs_to_center(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene= CTX_data_scene(C);
View3D *v3d= CTX_wm_view3d(C);
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c
index 6e2624cb60b..16896f75915 100644
--- a/source/blender/editors/space_view3d/view3d_toolbar.c
+++ b/source/blender/editors/space_view3d/view3d_toolbar.c
@@ -65,7 +65,7 @@
/* op->invoke */
-static void redo_cb(bContext *C, void *arg_op, void *arg2)
+static void redo_cb(bContext *C, void *arg_op, void *UNUSED(arg2))
{
wmOperator *lastop= arg_op;
@@ -114,7 +114,7 @@ static void view3d_panel_operator_redo_buts(const bContext *C, Panel *pa, wmOper
op->layout= NULL;
}
else
- uiDefAutoButsRNA(C, pa->layout, &ptr, 1);
+ uiDefAutoButsRNA(pa->layout, &ptr, 1);
}
static void view3d_panel_operator_redo_header(const bContext *C, Panel *pa)
@@ -177,7 +177,7 @@ static void operator_call_cb(struct bContext *C, void *arg_listbase, void *arg2)
}
-static void operator_search_cb(const struct bContext *C, void *arg, char *str, uiSearchItems *items)
+static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), char *str, uiSearchItems *items)
{
wmOperatorType *ot = WM_operatortype_first();
@@ -280,7 +280,7 @@ void view3d_tool_props_register(ARegionType *art)
/* ********** operator to open/close toolshelf region */
-static int view3d_toolshelf(bContext *C, wmOperator *op)
+static int view3d_toolshelf(bContext *C, wmOperator *UNUSED(op))
{
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= view3d_has_tools_region(sa);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index d66144b2c30..8b3d99e355d 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -205,7 +205,7 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo
if(quat) copy_qt_qt(sms.new_quat, quat);
if(dist) sms.new_dist= *dist;
if(lens) sms.new_lens= *lens;
-
+
if (camera) {
view3d_settings_from_ob(camera, sms.new_ofs, sms.new_quat, &sms.new_dist, &sms.new_lens);
sms.to_camera= 1; /* restore view3d values in end */
@@ -214,15 +214,15 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo
if (C && U.smooth_viewtx) {
int changed = 0; /* zero means no difference */
- if (sms.new_dist != rv3d->dist)
+ if (oldcamera != camera)
changed = 1;
- if (sms.new_lens != v3d->lens)
+ else if (sms.new_dist != rv3d->dist)
changed = 1;
-
- if (!equals_v3v3(sms.new_ofs, rv3d->ofs))
+ else if (sms.new_lens != v3d->lens)
changed = 1;
-
- if (!equals_v4v4(sms.new_quat, rv3d->viewquat))
+ else if (!equals_v3v3(sms.new_ofs, rv3d->ofs))
+ changed = 1;
+ else if (!equals_v4v4(sms.new_quat, rv3d->viewquat))
changed = 1;
/* The new view is different from the old one
@@ -296,7 +296,7 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo
}
/* only meant for timer usage */
-static int view3d_smoothview_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d= CTX_wm_region_view3d(C);
@@ -380,7 +380,7 @@ void VIEW3D_OT_smoothview(wmOperatorType *ot)
/* ****************** change view operators ****************** */
-static void setcameratoview3d(View3D *v3d, RegionView3D *rv3d, Object *ob)
+static void setcameratoview3d(RegionView3D *rv3d, Object *ob)
{
float dvec[3];
float mat3[3][3];
@@ -399,7 +399,7 @@ static void setcameratoview3d(View3D *v3d, RegionView3D *rv3d, Object *ob)
}
-static int view3d_setcameratoview_exec(bContext *C, wmOperator *op)
+static int view3d_setcameratoview_exec(bContext *C, wmOperator *UNUSED(op))
{
View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d= CTX_wm_region_view3d(C);
@@ -408,7 +408,7 @@ static int view3d_setcameratoview_exec(bContext *C, wmOperator *op)
rv3d->lview= rv3d->view;
rv3d->lpersp= rv3d->persp;
- setcameratoview3d(v3d, rv3d, v3d->camera);
+ setcameratoview3d(rv3d, v3d->camera);
rv3d->persp = RV3D_CAMOB;
WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, v3d->camera);
@@ -444,22 +444,26 @@ void VIEW3D_OT_setcameratoview(wmOperatorType *ot)
}
-static int view3d_setobjectascamera_exec(bContext *C, wmOperator *op)
+static int view3d_setobjectascamera_exec(bContext *C, wmOperator *UNUSED(op))
{
View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d= CTX_wm_region_view3d(C);
Scene *scene= CTX_data_scene(C);
-
- if(BASACT) {
+ Object *ob = CTX_data_active_object(C);
+
+ if(ob) {
+ Object *camera_old= (rv3d->persp == RV3D_CAMOB && scene->camera) ? scene->camera : NULL;
rv3d->persp= RV3D_CAMOB;
- v3d->camera= OBACT;
+ v3d->camera= ob;
if(v3d->scenelock)
- scene->camera= OBACT;
- smooth_view(C, NULL, v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, &v3d->lens);
+ scene->camera= ob;
+
+ if(camera_old != ob) /* unlikely but looks like a glitch when set to the same */
+ smooth_view(C, camera_old, v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, &v3d->lens);
+
+ WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, CTX_data_scene(C));
}
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, CTX_data_scene(C));
-
return OPERATOR_FINISHED;
}
@@ -1596,7 +1600,7 @@ static void endlocalview(Scene *scene, ScrArea *sa)
}
}
-static int localview_exec(bContext *C, wmOperator *unused)
+static int localview_exec(bContext *C, wmOperator *UNUSED(unused))
{
View3D *v3d= CTX_wm_view3d(C);
@@ -1663,6 +1667,7 @@ static void RestoreState(bContext *C)
win->queue= queue_back;
GPU_state_init();
+ GPU_set_tpage(NULL, 0);
glPopAttrib();
}
@@ -1775,6 +1780,8 @@ static int game_engine_exec(bContext *C, wmOperator *op)
RegionView3D *rv3d;
rcti cam_frame;
+ (void)op; /* unused */
+
// bad context switch ..
if(!ED_view3d_context_activate(C))
return OPERATOR_CANCELLED;
@@ -1823,6 +1830,7 @@ static int game_engine_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
#else
+ (void)C; /* unused */
BKE_report(op->reports, RPT_ERROR, "Game engine is disabled in this build.");
return OPERATOR_CANCELLED;
#endif
@@ -1981,7 +1989,7 @@ typedef struct FlyInfo {
} FlyInfo;
-static void drawFlyPixel(const struct bContext *C, struct ARegion *ar, void *arg)
+static void drawFlyPixel(const struct bContext *UNUSED(C), struct ARegion *UNUSED(ar), void *arg)
{
FlyInfo *fly = arg;