diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-20 10:25:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-20 10:25:15 +0400 |
commit | 13dfd8299758a5248613624e99a1643f35e2ff4e (patch) | |
tree | 6e10f1aa1c9fab187cae0172890153bb6ff5d252 /source/blender/editors | |
parent | 2b1513dbdad785c0f95acbe195215706a2ee873b (diff) |
changes for materials to treat them as shorts not int/chars (since they are stored as shorts intermally)
- converting nurbs to mesh was casting the material to unsigned char.
- subsurf was casting to char, then int -> short in a loop.
- have material functions take & return shorts.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawmesh.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 32e52916b77..526bf177ab7 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -217,7 +217,7 @@ int join_mesh_exec(bContext *C, wmOperator *op) if(me->totvert) { /* Add this object's materials to the base one's if they don't exist already (but only if limits not exceeded yet) */ - if(totcol < MAXMAT-1) { + if(totcol < MAXMAT) { for(a=1; a<=base->object->totcol; a++) { ma= give_current_material(base->object, a); @@ -231,7 +231,7 @@ int join_mesh_exec(bContext *C, wmOperator *op) } totcol++; } - if(totcol>=MAXMAT-1) + if(totcol >= MAXMAT) break; } } diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 37abf01b0da..b6e76885719 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -557,7 +557,7 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl) ddm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH); for(a=0, mf=mface; a<totface; a++, tface++, mf++) { - int matnr= mf->mat_nr; + short matnr= mf->mat_nr; int mf_smooth= mf->flag & ME_SMOOTH; Material *mat = me->mat[matnr]; int mode= mat->game.flag; |