diff options
author | Joshua Leung <aligorith@gmail.com> | 2007-12-31 02:27:35 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2007-12-31 02:27:35 +0300 |
commit | d00d1f1c89f217e485e18020ff0bac087ffcd77f (patch) | |
tree | ae159a22fafaa03107cc6084a363595104310b23 /source/blender | |
parent | 71f8eaa04b40a72cd460057f46f29f8050a81c7b (diff) |
Routine purge of compiler warnings
* Most were uninitialised vars
* Fixed whitespace in a few places
* The change I made in rendercore.c -> do_bake_shade() was for an uninitialised var, but I hope it does't cause any rendering errors...
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 2 | ||||
-rw-r--r-- | source/blender/include/BDR_editobject.h | 1 | ||||
-rw-r--r-- | source/blender/render/intern/source/rendercore.c | 12 | ||||
-rw-r--r-- | source/blender/src/buttons_object.c | 1 | ||||
-rw-r--r-- | source/blender/src/editobject.c | 25 |
5 files changed, 20 insertions, 21 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index de4f4555823..fd22579ea67 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -1467,7 +1467,7 @@ void makeBevelList(Object *ob) BevPoint *bevp, *bevp2, *bevp1 = NULL, *bevp0; float *data, *data_a, *v1, *v2, min, inp, x1, x2, y1, y2, vec[3]; struct bevelsort *sortdata, *sd, *sd1; - int a, b, len, nr, poly, resolu; + int a, b, nr, poly, resolu, len=0; /* this function needs an object, because of tflag and upflag */ cu= ob->data; diff --git a/source/blender/include/BDR_editobject.h b/source/blender/include/BDR_editobject.h index 93e7873fe55..b38ee8d3939 100644 --- a/source/blender/include/BDR_editobject.h +++ b/source/blender/include/BDR_editobject.h @@ -81,6 +81,7 @@ void make_links(short event); void make_duplilist_real(void); void apply_objects_locrot(void); void apply_objects_visual_tx(void); +void apply_object(void); /* old transform */ void apply_keyb_grid(float *val, float fac1, float fac2, float fac3, int invert); diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 5b9a275ad32..3eda349eef9 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -1976,15 +1976,15 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v) if(bs->actob) { Isect isec, minisec; float co[3], minco[3]; - int hit, sign, dir; + int hit, sign, dir=1; /* intersect with ray going forward and backward*/ hit= 0; memset(&minisec, 0, sizeof(minisec)); minco[0]= minco[1]= minco[2]= 0.0f; - + VECCOPY(bs->dir, shi->vn); - + for(sign=-1; sign<=1; sign+=2) { memset(&isec, 0, sizeof(isec)); VECCOPY(isec.start, shi->co); @@ -1992,7 +1992,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v) isec.faceorig= (RayFace*)vlr; isec.oborig= RAY_OBJECT_SET(&R, obi); isec.userdata= bs; - + if(bake_intersect_tree(R.raytree, &isec, shi->vn, sign, co)) { if(!hit || VecLenf(shi->co, co) < VecLenf(shi->co, minco)) { minisec= isec; @@ -2014,13 +2014,11 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v) obi= RAY_OBJECT_GET(&R, minisec.ob); quad= (minisec.isect == 2); VECCOPY(shi->co, minco); - + u= -minisec.u; v= -minisec.v; bake_set_shade_input(obi, vlr, shi, quad, 1, x, y, u, v); } - - } if(bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT) diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index dc33f2d2ac4..8451a4c8afd 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -3752,7 +3752,6 @@ static void object_panel_particle_extra(Object *ob) ParticleSettings *part; short butx=0, buty=160, butw=150, buth=20; static short vgnum=0; - int event; if (psys==NULL) return; part=psys->part; diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 5c1742467b7..eea97e15f00 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -3700,6 +3700,7 @@ void apply_objects_locrot( void ) { Base *base, *basact; Object *ob; + bArmature *arm; Mesh *me; Curve *cu; Nurb *nu; @@ -3714,21 +3715,23 @@ void apply_objects_locrot( void ) if TESTBASELIB(base) { ob= base->object; if(ob->type==OB_MESH) { + me= ob->data; + if(me->id.us>1) { error("Can't apply to a multi user mesh, doing nothing."); - return 0; + return; } if(me->key) { error("Can't apply to a mesh with vertex keys, doing nothing."); - return 0; + return; } } - else if (ob->type==OB_ARMATURE){ - bArmature *arm; + else if (ob->type==OB_ARMATURE) { arm= ob->data; + if(arm->id.us>1) { error("Can't apply to a multi user armature, doing nothing."); - return 0; + return; } } else if ELEM(ob->type, OB_CURVE, OB_SURF) { @@ -3736,11 +3739,11 @@ void apply_objects_locrot( void ) if(cu->id.us>1) { error("Can't apply to a multi user curve, doing nothing."); - return 0; + return; } if(cu->key) { error("Can't apply to a curve with vertex keys, doing nothing."); - return 0; + return; } } } @@ -3752,7 +3755,7 @@ void apply_objects_locrot( void ) for (base= FIRSTBASE; base; base= base->next) { if TESTBASELIB(base) { ob= base->object; - + if(ob->type==OB_MESH) { object_to_mat3(ob, mat); me= ob->data; @@ -3778,15 +3781,13 @@ void apply_objects_locrot( void ) change = 1; } - else if (ob->type==OB_ARMATURE){ - bArmature *arm; - + else if (ob->type==OB_ARMATURE) { object_to_mat3(ob, mat); arm= ob->data; /* see checks above */ + apply_rot_armature(ob, mat); - apply_rot_armature (ob, mat); /* Reset the object's transforms */ ob->size[0]= ob->size[1]= ob->size[2]= 1.0; ob->rot[0]= ob->rot[1]= ob->rot[2]= 0.0; |