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/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/constraint.c22
-rw-r--r--source/blender/blenkernel/intern/ipo.c196
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c12
3 files changed, 126 insertions, 104 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 99cf58e8e5a..4914732b801 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -842,7 +842,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrain
if (nocopy == 0) { \
datatar= ct->tar; \
strcpy(datasubtarget, ct->subtarget); \
- con->tarspace= ct->space; \
+ con->tarspace= (char)ct->space; \
} \
\
BLI_freelinkN(list, ct); \
@@ -862,7 +862,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrain
bConstraintTarget *ctn = ct->next; \
if (nocopy == 0) { \
datatar= ct->tar; \
- con->tarspace= ct->space; \
+ con->tarspace= (char)ct->space; \
} \
\
BLI_freelinkN(list, ct); \
@@ -1434,9 +1434,9 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
Mat4ToEul(cob->matrix, eul);
/* eulers: radians to degrees! */
- eul[0] = (eul[0] / M_PI * 180);
- eul[1] = (eul[1] / M_PI * 180);
- eul[2] = (eul[2] / M_PI * 180);
+ eul[0] = (float)(eul[0] / M_PI * 180);
+ eul[1] = (float)(eul[1] / M_PI * 180);
+ eul[2] = (float)(eul[2] / M_PI * 180);
/* limiting of euler values... */
if (data->flag & LIMIT_XROT) {
@@ -1462,9 +1462,9 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
}
/* eulers: degrees to radians ! */
- eul[0] = (eul[0] / 180 * M_PI);
- eul[1] = (eul[1] / 180 * M_PI);
- eul[2] = (eul[2] / 180 * M_PI);
+ eul[0] = (float)(eul[0] / 180 * M_PI);
+ eul[1] = (float)(eul[1] / 180 * M_PI);
+ eul[2] = (float)(eul[2] / 180 * M_PI);
LocEulSizeToMat4(cob->matrix, loc, eul, size);
}
@@ -2508,7 +2508,7 @@ static void distlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
else if (data->flag & LIMITDIST_USESOFT) {
// FIXME: there's a problem with "jumping" when this kicks in
if (dist >= (data->dist - data->soft)) {
- sfac = data->soft*(1.0 - exp(-(dist - data->dist)/data->soft)) + data->dist;
+ sfac = (float)( data->soft*(1.0 - exp(-(dist - data->dist)/data->soft)) + data->dist );
sfac /= dist;
clamp_surf= 1;
@@ -3139,7 +3139,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
case 1: /* rotation (convert to degrees first) */
Mat4ToEul(ct->matrix, dvec);
for (i=0; i<3; i++)
- dvec[i] = dvec[i] / M_PI * 180;
+ dvec[i] = (float)(dvec[i] / M_PI * 180);
break;
default: /* location */
VecCopyf(dvec, ct->matrix[3]);
@@ -3189,7 +3189,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
eul[i]= tmin + (sval[data->map[i]] * (tmax - tmin));
/* now convert final value back to radians */
- eul[i] = eul[i] / 180 * M_PI;
+ eul[i] = (float)(eul[i] / 180 * M_PI);
}
break;
default: /* location */
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index a115ac39e1a..9f0ea0f1388 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -234,46 +234,46 @@ void ipo_default_v2d_cur (int blocktype, rctf *cur)
{
switch (blocktype) {
case ID_CA:
- cur->xmin= G.scene->r.sfra;
- cur->xmax= G.scene->r.efra;
- cur->ymin= 0.0;
- cur->ymax= 100.0;
+ cur->xmin= (float)G.scene->r.sfra;
+ cur->xmax= (float)G.scene->r.efra;
+ cur->ymin= 0.0f;
+ cur->ymax= 100.0f;
break;
case ID_MA: case ID_WO: case ID_LA:
case ID_CU: case ID_CO:
- cur->xmin= (float)G.scene->r.sfra-0.1;
- cur->xmax= G.scene->r.efra;
- cur->ymin= (float)-0.1;
- cur->ymax= (float)+1.1;
+ cur->xmin= (float)(G.scene->r.sfra - 0.1f);
+ cur->xmax= (float)G.scene->r.efra;
+ cur->ymin= (float)-0.1f;
+ cur->ymax= (float)+1.1f;
break;
case ID_TE:
- cur->xmin= (float)G.scene->r.sfra-0.1;
- cur->xmax= G.scene->r.efra;
- cur->ymin= (float)-0.1;
- cur->ymax= (float)+1.1;
+ cur->xmin= (float)(G.scene->r.sfra - 0.1f);
+ cur->xmax= (float)G.scene->r.efra;
+ cur->ymin= (float)-0.1f;
+ cur->ymax= (float)+1.1f;
break;
case ID_SEQ:
- cur->xmin= -5.0;
- cur->xmax= 105.0;
- cur->ymin= (float)-0.1;
- cur->ymax= (float)+1.1;
+ cur->xmin= -5.0f;
+ cur->xmax= 105.0f;
+ cur->ymin= (float)-0.1f;
+ cur->ymax= (float)+1.1f;
break;
case ID_KE:
- cur->xmin= (float)G.scene->r.sfra-0.1;
- cur->xmax= G.scene->r.efra;
- cur->ymin= (float)-0.1;
- cur->ymax= (float)+2.1;
+ cur->xmin= (float)(G.scene->r.sfra - 0.1f);
+ cur->xmax= (float)G.scene->r.efra;
+ cur->ymin= (float)-0.1f;
+ cur->ymax= (float)+2.1f;
break;
default: /* ID_OB and everything else */
- cur->xmin= G.scene->r.sfra;
- cur->xmax= G.scene->r.efra;
- cur->ymin= -5.0;
- cur->ymax= +5.0;
+ cur->xmin= (float)G.scene->r.sfra;
+ cur->xmax= (float)G.scene->r.efra;
+ cur->ymin= -5.0f;
+ cur->ymax= +5.0f;
break;
}
}
@@ -1053,11 +1053,11 @@ static float eval_driver (IpoDriver *driver, float ipotime)
case OB_LOC_Z:
return ob->loc[2];
case OB_ROT_X: /* hack: euler rotations are divided by 10 deg to fit on same axes as other channels */
- return ob->rot[0]/(M_PI_2/9.0);
+ return (float)( ob->rot[0]/(M_PI_2/9.0) );
case OB_ROT_Y: /* hack: euler rotations are divided by 10 deg to fit on same axes as other channels */
- return ob->rot[1]/(M_PI_2/9.0);
+ return (float)( ob->rot[1]/(M_PI_2/9.0) );
case OB_ROT_Z: /* hack: euler rotations are divided by 10 deg to fit on same axes as other channels */
- return ob->rot[2]/(M_PI_2/9.0);
+ return (float)( ob->rot[2]/(M_PI_2/9.0) );
case OB_SIZE_X:
return ob->size[0];
case OB_SIZE_Y:
@@ -1090,7 +1090,7 @@ static float eval_driver (IpoDriver *driver, float ipotime)
angle = 2.0f * (saacos(quat[0]));
angle= ABS(angle);
- return (angle > M_PI) ? ((2.0f * M_PI) - angle) : (angle);
+ return (angle > M_PI) ? (float)((2.0f * M_PI) - angle) : (float)(angle);
}
}
@@ -1112,11 +1112,11 @@ static float eval_driver (IpoDriver *driver, float ipotime)
case OB_LOC_Z:
return loc[2];
case OB_ROT_X: /* hack: euler rotations are divided by 10 deg to fit on same axes as other channels */
- return eul[0]/(M_PI_2/9.0);
+ return (float)( eul[0]/(M_PI_2/9.0) );
case OB_ROT_Y: /* hack: euler rotations are divided by 10 deg to fit on same axes as other channels */
- return eul[1]/(M_PI_2/9.0);
+ return (float)( eul[1]/(M_PI_2/9.0) );
case OB_ROT_Z: /* hack: euler rotations are divided by 10 deg to fit on same axes as other channels */
- return eul[2]/(M_PI_2/9.0);
+ return (float)( eul[2]/(M_PI_2/9.0) );
case OB_SIZE_X:
return size[0];
case OB_SIZE_Y:
@@ -2487,79 +2487,92 @@ void set_icu_vars (IpoCurve *icu)
{
switch (icu->adrcode & (MA_MAP1-1)) {
case TE_NSIZE:
- icu->ymin= 0.0001;
- icu->ymax= 2.0; break;
+ icu->ymin= 0.0001f;
+ icu->ymax= 2.0f;
+ break;
case TE_NDEPTH:
icu->vartype= IPO_SHORT;
icu->ipo= IPO_CONST;
- icu->ymax= 6.0; break;
+ icu->ymax= 6.0f;
+ break;
case TE_NTYPE:
icu->vartype= IPO_SHORT;
icu->ipo= IPO_CONST;
- icu->ymax= 1.0; break;
+ icu->ymax= 1.0f;
+ break;
case TE_TURB:
- icu->ymax= 200.0; break;
+ icu->ymax= 200.0f;
+ break;
case TE_VNW1:
case TE_VNW2:
case TE_VNW3:
case TE_VNW4:
- icu->ymax= 2.0;
- icu->ymin= -2.0; break;
+ icu->ymax= 2.0f;
+ icu->ymin= -2.0f;
+ break;
case TE_VNMEXP:
- icu->ymax= 10.0;
- icu->ymin= 0.01; break;
+ icu->ymax= 10.0f;
+ icu->ymin= 0.01f;
+ break;
case TE_VN_DISTM:
icu->vartype= IPO_SHORT;
icu->ipo= IPO_CONST;
- icu->ymax= 6.0; break;
+ icu->ymax= 6.0f;
+ break;
case TE_VN_COLT:
icu->vartype= IPO_SHORT;
icu->ipo= IPO_CONST;
- icu->ymax= 3.0; break;
+ icu->ymax= 3.0f;
+ break;
case TE_ISCA:
- icu->ymax= 10.0;
- icu->ymin= 0.01; break;
+ icu->ymax= 10.0f;
+ icu->ymin= 0.01f;
+ break;
case TE_DISTA:
- icu->ymax= 10.0; break;
+ icu->ymax= 10.0f;
+ break;
case TE_MG_TYP:
icu->vartype= IPO_SHORT;
icu->ipo= IPO_CONST;
- icu->ymax= 6.0; break;
+ icu->ymax= 6.0f;
+ break;
case TE_MGH:
- icu->ymin= 0.0001;
- icu->ymax= 2.0; break;
+ icu->ymin= 0.0001f;
+ icu->ymax= 2.0f;
+ break;
case TE_MG_LAC:
case TE_MG_OFF:
case TE_MG_GAIN:
- icu->ymax= 6.0; break;
+ icu->ymax= 6.0f; break;
case TE_MG_OCT:
- icu->ymax= 8.0; break;
+ icu->ymax= 8.0f; break;
case TE_N_BAS1:
case TE_N_BAS2:
icu->vartype= IPO_SHORT;
icu->ipo= IPO_CONST;
- icu->ymax= 8.0; break;
+ icu->ymax= 8.0f;
+ break;
case TE_COL_R:
- icu->ymax= 0.0; break;
+ icu->ymax= 0.0f; break;
case TE_COL_G:
- icu->ymax= 2.0; break;
+ icu->ymax= 2.0f; break;
case TE_COL_B:
- icu->ymax= 2.0; break;
+ icu->ymax= 2.0f; break;
case TE_BRIGHT:
- icu->ymax= 2.0; break;
+ icu->ymax= 2.0f; break;
case TE_CONTRA:
- icu->ymax= 5.0; break;
+ icu->ymax= 5.0f; break;
}
}
break;
case ID_SEQ: /* sequence channels ----------------------------- */
{
- icu->ymax= 1.0;
+ icu->ymax= 1.0f;
}
break;
case ID_CU: /* curve channels ----------------------------- */
{
- icu->ymax= 1.0;
+ icu->ymax= 1.0f;
}
break;
case ID_WO: /* world channels ----------------------------- */
@@ -2567,7 +2580,8 @@ void set_icu_vars (IpoCurve *icu)
if (icu->adrcode < MA_MAP1) {
switch (icu->adrcode) {
case WO_EXPOS:
- icu->ymax= 5.0; break;
+ icu->ymax= 5.0f; break;
+
case WO_MISTDI:
case WO_MISTSTA:
case WO_MISTHI:
@@ -2576,7 +2590,7 @@ void set_icu_vars (IpoCurve *icu)
break;
default:
- icu->ymax= 1.0;
+ icu->ymax= 1.0f;
break;
}
}
@@ -2588,8 +2602,8 @@ void set_icu_vars (IpoCurve *icu)
case MAP_SIZE_X:
case MAP_SIZE_Y:
case MAP_SIZE_Z:
- icu->ymax= 100.0;
- icu->ymin= -100.0;
+ icu->ymax= 100.0f;
+ icu->ymin= -100.0f;
break;
case MAP_R:
case MAP_G:
@@ -2599,7 +2613,7 @@ void set_icu_vars (IpoCurve *icu)
case MAP_NORF:
case MAP_VARF:
case MAP_DISP:
- icu->ymax= 1.0;
+ icu->ymax= 1.0f;
}
}
}
@@ -2618,13 +2632,13 @@ void set_icu_vars (IpoCurve *icu)
case LA_SPOTBL:
case LA_QUAD1:
case LA_QUAD2:
- icu->ymax= 1.0; break;
+ icu->ymax= 1.0f; break;
case LA_SPOTSI:
- icu->ymax= 180.0; break;
+ icu->ymax= 180.0f; break;
case LA_HALOINT:
- icu->ymax= 5.0; break;
+ icu->ymax= 5.0f; break;
}
}
else {
@@ -2635,8 +2649,8 @@ void set_icu_vars (IpoCurve *icu)
case MAP_SIZE_X:
case MAP_SIZE_Y:
case MAP_SIZE_Z:
- icu->ymax= 100.0;
- icu->ymin= -100.0;
+ icu->ymax= 100.0f;
+ icu->ymin= -100.0f;
break;
case MAP_R:
case MAP_G:
@@ -2646,7 +2660,7 @@ void set_icu_vars (IpoCurve *icu)
case MAP_NORF:
case MAP_VARF:
case MAP_DISP:
- icu->ymax= 1.0;
+ icu->ymax= 1.0f;
}
}
}
@@ -2655,8 +2669,8 @@ void set_icu_vars (IpoCurve *icu)
{
switch (icu->adrcode) {
case CAM_LENS:
- icu->ymin= 1.0;
- icu->ymax= 1000.0;
+ icu->ymin= 1.0f;
+ icu->ymax= 1000.0f;
break;
case CAM_STA:
icu->ymin= 0.001f;
@@ -2666,12 +2680,12 @@ void set_icu_vars (IpoCurve *icu)
break;
case CAM_YF_APERT:
- icu->ymin = 0.0;
- icu->ymax = 2.0;
+ icu->ymin = 0.0f;
+ icu->ymax = 2.0f;
break;
case CAM_YF_FDIST:
- icu->ymin = 0.0;
- icu->ymax = 5000.0;
+ icu->ymin = 0.0f;
+ icu->ymax = 5000.0f;
break;
case CAM_SHIFT_X:
@@ -2686,20 +2700,20 @@ void set_icu_vars (IpoCurve *icu)
{
switch (icu->adrcode) {
case SND_VOLUME:
- icu->ymin= 0.0;
- icu->ymax= 1.0;
+ icu->ymin= 0.0f;
+ icu->ymax= 1.0f;
break;
case SND_PITCH:
- icu->ymin= -12.0;
- icu->ymin= 12.0;
+ icu->ymin= -12.0f;
+ icu->ymin= 12.0f;
break;
case SND_PANNING:
- icu->ymin= 0.0;
- icu->ymax= 1.0;
+ icu->ymin= 0.0f;
+ icu->ymax= 1.0f;
break;
case SND_ATTEN:
- icu->ymin= 0.0;
- icu->ymin= 1.0;
+ icu->ymin= 0.0f;
+ icu->ymin= 1.0f;
break;
}
}
@@ -2713,28 +2727,28 @@ void set_icu_vars (IpoCurve *icu)
case PART_EMIT_VEL:
case PART_EMIT_AVE:
case PART_EMIT_SIZE:
- icu->ymin= 0.0;
+ icu->ymin= 0.0f;
break;
case PART_CLUMP:
- icu->ymin= -1.0;
- icu->ymax= 1.0;
+ icu->ymin= -1.0f;
+ icu->ymax= 1.0f;
break;
case PART_DRAG:
case PART_DAMP:
case PART_LENGTH:
- icu->ymin= 0.0;
- icu->ymax= 1.0;
+ icu->ymin= 0.0f;
+ icu->ymax= 1.0f;
break;
case PART_KINK_SHAPE:
- icu->ymin= -0.999;
- icu->ymax= 0.999;
+ icu->ymin= -0.999f;
+ icu->ymax= 0.999f;
break;
}
}
break;
case ID_CO: /* constraint channels ----------------------------- */
{
- icu->ymin= 0.0;
+ icu->ymin= 0.0f;
icu->ymax= 1.0f;
}
break;
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index 76af9a763ee..28bf7aee884 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -215,7 +215,11 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
BENCH(bvhtree_from_mesh_verts(&treeData, calc->target, 0.0, 2, 6));
- if(treeData.tree == NULL) return OUT_OF_MEMORY();
+ if(treeData.tree == NULL)
+ {
+ OUT_OF_MEMORY();
+ return;
+ }
//Setup nearest
nearest.index = -1;
@@ -526,7 +530,11 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
//Create a bvh-tree of the given target
BENCH(bvhtree_from_mesh_faces( &treeData, calc->target, 0.0, 2, 6));
- if(treeData.tree == NULL) return OUT_OF_MEMORY();
+ if(treeData.tree == NULL)
+ {
+ OUT_OF_MEMORY();
+ return;
+ }
//Setup nearest
nearest.index = -1;