~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/editors/space_view3d/drawarmature.c

  • Committer: Reinhard Tartler
  • Date: 2014-05-31 01:50:05 UTC
  • mfrom: (14.2.27 sid)
  • Revision ID: siretart@tauware.de-20140531015005-ml6druahuj82nsav
mergeĀ fromĀ debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
304
304
/* *************** Armature drawing, helper calls for parts ******************* */
305
305
 
306
306
/* half the cube, in Y */
307
 
static float cube[8][3] = {
 
307
static const float cube[8][3] = {
308
308
        {-1.0,  0.0, -1.0},
309
309
        {-1.0,  0.0,  1.0},
310
310
        {-1.0,  1.0,  1.0},
440
440
        glCallList(displist);
441
441
}
442
442
 
443
 
static float bone_octahedral_verts[6][3] = {
 
443
static const float bone_octahedral_verts[6][3] = {
444
444
        { 0.0f, 0.0f,  0.0f},
445
445
        { 0.1f, 0.1f,  0.1f},
446
446
        { 0.1f, 0.1f, -0.1f},
449
449
        { 0.0f, 1.0f,  0.0f}
450
450
};
451
451
 
452
 
static unsigned int bone_octahedral_wire_sides[8] = {0, 1, 5, 3, 0, 4, 5, 2};
453
 
static unsigned int bone_octahedral_wire_square[8] = {1, 2, 3, 4, 1};
 
452
static const unsigned int bone_octahedral_wire_sides[8] = {0, 1, 5, 3, 0, 4, 5, 2};
 
453
static const unsigned int bone_octahedral_wire_square[8] = {1, 2, 3, 4, 1};
454
454
 
455
 
static unsigned int bone_octahedral_solid_tris[8][3] = {
 
455
static const unsigned int bone_octahedral_solid_tris[8][3] = {
456
456
        {2, 1, 0}, /* bottom */
457
457
        {3, 2, 0},
458
458
        {4, 3, 0},
465
465
};
466
466
 
467
467
/* aligned with bone_octahedral_solid_tris */
468
 
static float bone_octahedral_solid_normals[8][3] = {
 
468
static const float bone_octahedral_solid_normals[8][3] = {
469
469
        { 0.70710683f, -0.70710683f,  0.00000000f},
470
470
        {-0.00000000f, -0.70710683f, -0.70710683f},
471
471
        {-0.70710683f, -0.70710683f,  0.00000000f},
599
599
}
600
600
 
601
601
/* 16 values of sin function (still same result!) */
602
 
static float si[16] = {
 
602
static const float si[16] = {
603
603
        0.00000000f,
604
604
        0.20129852f, 0.39435585f,
605
605
        0.57126821f, 0.72479278f,
611
611
        0.10116832f
612
612
};
613
613
/* 16 values of cos function (still same result!) */
614
 
static float co[16] = {
 
614
static const float co[16] = {
615
615
        1.00000000f,
616
616
        0.97952994f, 0.91895781f,
617
617
        0.82076344f, 0.68896691f,
1878
1878
                }
1879
1879
                /* if solid && posemode, we draw again with polygonoffset */
1880
1880
                else if ((dt > OB_WIRE) && (arm->flag & ARM_POSEMODE)) {
1881
 
                        bglPolygonOffset(rv3d->dist, 1.0);
 
1881
                        ED_view3d_polygon_offset(rv3d, 1.0);
1882
1882
                }
1883
1883
                else {
1884
1884
                        /* and we use selection indices if not done yet */
1986
1986
                }
1987
1987
                /* restore things */
1988
1988
                if (!ELEM(arm->drawtype, ARM_WIRE, ARM_LINE) && (dt > OB_WIRE) && (arm->flag & ARM_POSEMODE))
1989
 
                        bglPolygonOffset(rv3d->dist, 0.0);
 
1989
                        ED_view3d_polygon_offset(rv3d, 0.0);
1990
1990
        }
1991
1991
        
1992
1992
        /* restore */
2154
2154
                        index = 0;
2155
2155
        }
2156
2156
        else if (dt > OB_WIRE) 
2157
 
                bglPolygonOffset(rv3d->dist, 1.0f);
 
2157
                ED_view3d_polygon_offset(rv3d, 1.0);
2158
2158
        else if (arm->flag & ARM_EDITMODE) 
2159
2159
                index = 0;  /* do selection codes */
2160
2160
        
2221
2221
                /* pass */
2222
2222
        }
2223
2223
        else if (dt > OB_WIRE) {
2224
 
                bglPolygonOffset(rv3d->dist, 0.0f);
 
2224
                ED_view3d_polygon_offset(rv3d, 0.0);
2225
2225
        }
2226
2226
        
2227
2227
        /* finally names and axes */