- fix for BL_Shader::SetUniform() missing out the last part of the matrix.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 27 Aug 2011 03:20:32 +0000 (03:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 27 Aug 2011 03:20:32 +0000 (03:20 +0000)
- particle.c wasn't setting all components of the vector when reading cache and setting dummy velocity values.
- some functions incorrectly took a float[3] argument when the 4th value was set.
- remove a few redundant lines of code.

source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/editors/physics/physics_pointcache.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/gpu/intern/gpu_material.c
source/gameengine/Ketsji/BL_Shader.cpp

index dff62b0..5bdda8d 100644 (file)
@@ -3134,7 +3134,7 @@ int object_is_modified(Scene *scene, Object *ob)
        int flag= 0;
 
        if(ob_get_key(ob)) {
-               flag |= eModifierMode_Render | eModifierMode_Render;
+               flag |= eModifierMode_Render;
        }
        else {
                ModifierData *md;
index 9aa1c6e..86c646f 100644 (file)
@@ -3161,7 +3161,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
                        }
                        else {
                                ca->vel[0] = ca->vel[1] = 0.0f;
-                               ca->vel[1] = 1.0f;
+                               ca->vel[2] = 1.0f;
                        }
 
                        /* selection coloring in edit mode */
index 797ead3..34f4a1e 100644 (file)
@@ -172,7 +172,6 @@ void PTCACHE_OT_free_bake_all(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name= "Free All Physics Bakes";
-       ot->name= "Free all physics bakes";
        ot->idname= "PTCACHE_OT_free_bake_all";
        
        /* api callbacks */
index 32004fd..d69c1d9 100644 (file)
@@ -512,7 +512,7 @@ static float VecZDepthOrtho(float pt[2], float v1[3], float v2[3], float v3[3],
        return (v1[2]*w[0]) + (v2[2]*w[1]) + (v3[2]*w[2]);
 }
 
-static float VecZDepthPersp(float pt[2], float v1[3], float v2[3], float v3[3], float w[3])
+static float VecZDepthPersp(float pt[2], float v1[4], float v2[4], float v3[4], float w[3])
 {
        float wtot_inv, wtot;
        float w_tmp[3];
@@ -1193,7 +1193,7 @@ static void screen_px_from_ortho(
  * the perspective W coord for each vert */
 static void screen_px_from_persp(
                float uv[2],
-               float v1co[3], float v2co[3], float v3co[3], /* screenspace coords */
+               float v1co[4], float v2co[4], float v3co[4], /* screenspace coords */
                float uv1co[2], float uv2co[2], float uv3co[2],
                float pixelScreenCo[4],
                float w[3])
index ad62125..103a03e 100644 (file)
@@ -316,11 +316,9 @@ static float cube[8][3] = {
 static void drawsolidcube_size(float xsize, float ysize, float zsize)
 {
        static GLuint displist=0;
-       float n[3];
+       float n[3]= {0.0f};
        
        glScalef(xsize, ysize, zsize);
-       
-       n[0]=0; n[1]=0; n[2]=0;
 
        if(displist==0) {
                displist= glGenLists(1);
@@ -346,7 +344,6 @@ static void drawsolidcube_size(float xsize, float ysize, float zsize)
                n[2]= 1.0;
                glNormal3fv(n); 
                glVertex3fv(cube[1]); glVertex3fv(cube[5]); glVertex3fv(cube[6]); glVertex3fv(cube[2]);
-               n[2]=0;
                n[2]= -1.0;
                glNormal3fv(n); 
                glVertex3fv(cube[7]); glVertex3fv(cube[4]); glVertex3fv(cube[0]); glVertex3fv(cube[3]);
index 7065999..0515941 100644 (file)
@@ -833,7 +833,7 @@ static int select_edgeloop(Scene *scene, Image *ima, EditMesh *em, NearestHit *h
        if(extend) {
                tf= CustomData_em_get(&em->fdata, hit->efa->data, CD_MTFACE);
 
-               if(uvedit_uv_selected(scene, hit->efa, tf, hit->edge) && uvedit_uv_selected(scene, hit->efa, tf, hit->edge))
+               if(uvedit_uv_selected(scene, hit->efa, tf, hit->edge))
                        select= 0;
                else
                        select= 1;
index 28624e9..15b96b6 100644 (file)
@@ -358,7 +358,7 @@ void GPU_material_enable_alpha(GPUMaterial *material)
        material->alpha= 1;
 }
 
-GPUBlendMode GPU_material_blend_mode(GPUMaterial *material, float obcol[3])
+GPUBlendMode GPU_material_blend_mode(GPUMaterial *material, float obcol[4])
 {
        if(material->alpha || (material->obcolalpha && obcol[3] < 1.0f))
                return GPU_BLEND_ALPHA;
index 621cabf..aea3324 100644 (file)
@@ -690,7 +690,7 @@ void BL_Shader::SetUniform(int uniform, const MT_Matrix3x3& vec, bool transpose)
                float value[9];
                value[0] = (float)vec[0][0]; value[1] = (float)vec[1][0]; value[2] = (float)vec[2][0]; 
                value[3] = (float)vec[0][1]; value[4] = (float)vec[1][1]; value[5] = (float)vec[2][1]; 
-               value[6] = (float)vec[0][2]; value[7] = (float)vec[1][2]; value[7] = (float)vec[2][2]; 
+               value[6] = (float)vec[0][2]; value[7] = (float)vec[1][2]; value[8] = (float)vec[2][2];
                glUniformMatrix3fvARB(uniform, 1, transpose?GL_TRUE:GL_FALSE, value);
        }
 }