- fix for crash when drawing a subsurf after a modifier that lost original indices...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 5 Oct 2010 11:16:07 +0000 (11:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 5 Oct 2010 11:16:07 +0000 (11:16 +0000)
- fix for own mistake used madd_v3_v3fl rather then mul_v3_v3fl, r32241.

source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/gpu/intern/gpu_draw.c

index d6486c3ee4d6106c7647e3fc2797de91a97064b4..b0ea5f979ac2d12c0f20c71b732d40633eceb960 100644 (file)
@@ -1619,8 +1619,10 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
 
                if(drawParams)
                        flag = drawParams(tf, mcol, mat_nr);
-               else
+               else if(index != ORIGINDEX_NONE)
                        flag= (drawParamsMapped)? drawParamsMapped(userData, index): 1;
+               else
+                       flag= 1;
                
                if (flag == 0) { /* flag 0 == the face is hidden or invisible */
                        if(tf) tf += gridFaces*gridFaces*numVerts;
index 372ac97634205ba145ff10818fd6086c5085ad94..53b32dd167c41c1e1dd6ec910a30912594f02279 100644 (file)
@@ -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);
index e8701793e5d8ceac5797ca06e9d452acb237c9e1..55522ea18b98b9ad0f0b5a789b14538e8e1c905b 100644 (file)
@@ -911,10 +911,10 @@ static void gpu_material_to_fixed(GPUMaterialFixed *smat, const Material *bmat,
                }       
        }
        else {
-               madd_v3_v3fl(smat->diff, &bmat->r, bmat->ref + bmat->emit);
+               mul_v3_v3fl(smat->diff, &bmat->r, bmat->ref + bmat->emit);
                smat->diff[3]= 1.0; /* caller may set this to bmat->alpha */
 
-               madd_v3_v3fl(smat->spec, &bmat->specr, bmat->spec);
+               mul_v3_v3fl(smat->spec, &bmat->specr, bmat->spec);
                smat->spec[3]= 1.0; /* always 1 */
                smat->hard= CLAMPIS(bmat->har, 0, 128);
 
@@ -1043,10 +1043,10 @@ int GPU_enable_material(int nr, void *attribs)
 
                memset(&GMS, 0, sizeof(GMS));
 
-               madd_v3_v3fl(diff, &defmaterial.r, defmaterial.ref + defmaterial.emit);
+               mul_v3_v3fl(diff, &defmaterial.r, defmaterial.ref + defmaterial.emit);
                diff[3]= 1.0;
 
-               madd_v3_v3fl(spec, &defmaterial.specr, defmaterial.spec);
+               mul_v3_v3fl(spec, &defmaterial.specr, defmaterial.spec);
                spec[3]= 1.0;
 
                glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diff);
@@ -1286,7 +1286,7 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[][4
                }
                
                /* setup energy */
-               madd_v3_v3fl(energy, &la->r, la->energy);
+               mul_v3_v3fl(energy, &la->r, la->energy);
                energy[3]= 1.0;
 
                glLightfv(GL_LIGHT0+count, GL_DIFFUSE, energy);