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:
authorCampbell Barton <ideasman42@gmail.com>2011-09-20 10:25:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-20 10:25:15 +0400
commit13dfd8299758a5248613624e99a1643f35e2ff4e (patch)
tree6e10f1aa1c9fab187cae0172890153bb6ff5d252 /source/blender/editors
parent2b1513dbdad785c0f95acbe195215706a2ee873b (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.c4
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c2
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;