~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/gameengine/Rasterizer/RAS_MeshObject.cpp

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
 
174
174
RAS_MeshMaterial* RAS_MeshObject::GetMeshMaterial(unsigned int matid)
175
175
{
176
 
        if (m_materials.size() > 0 && (matid < m_materials.size()))
 
176
        if ((m_materials.empty() == false) && (matid < m_materials.size()))
177
177
        {
178
178
                list<RAS_MeshMaterial>::iterator it = m_materials.begin();
179
179
                while (matid--) ++it;
324
324
 
325
325
void RAS_MeshObject::AddVertex(RAS_Polygon *poly, int i,
326
326
                                                                const MT_Point3& xyz,
327
 
                                                                const MT_Point2& uv,
328
 
                                                                const MT_Point2& uv2,
 
327
                                                                const MT_Point2 uvs[RAS_TexVert::MAX_UNIT],
329
328
                                                                const MT_Vector4& tangent,
330
329
                                                                const unsigned int rgba,
331
330
                                                                const MT_Vector3& normal,
332
331
                                                                bool flat,
333
332
                                                                int origindex)
334
333
{
335
 
        RAS_TexVert texvert(xyz, uv, uv2, tangent, rgba, normal, flat, origindex);
 
334
        RAS_TexVert texvert(xyz, uvs, tangent, rgba, normal, flat, origindex);
336
335
        RAS_MeshMaterial *mmat;
337
336
        RAS_DisplayArray *darray;
338
337
        RAS_MeshSlot *slot;
536
535
                const MT_Vector3 pnorm(transform.getBasis()[2]);
537
536
                // unneeded: const MT_Scalar pval = transform.getOrigin()[2];
538
537
 
539
 
                vector<polygonSlot> slots(totpoly);
 
538
                vector<polygonSlot> poly_slots(totpoly);
540
539
 
541
540
                /* get indices and z into temporary array */
542
541
                for (j=0; j<totpoly; j++)
543
 
                        slots[j].get(it.vertex, it.index, j*nvert, nvert, pnorm);
 
542
                        poly_slots[j].get(it.vertex, it.index, j*nvert, nvert, pnorm);
544
543
 
545
544
                /* sort (stable_sort might be better, if flickering happens?) */
546
 
                std::sort(slots.begin(), slots.end(), backtofront());
 
545
                std::sort(poly_slots.begin(), poly_slots.end(), backtofront());
547
546
 
548
547
                /* get indices from temporary array again */
549
548
                for (j=0; j<totpoly; j++)
550
 
                        slots[j].set(it.index, j*nvert, nvert);
 
549
                        poly_slots[j].set(it.index, j*nvert, nvert);
551
550
        }
552
551
}
553
552
 
584
583
        if (!m_mesh->key)
585
584
                return;
586
585
 
587
 
        for (kbindex=0, kb= (KeyBlock*)m_mesh->key->block.first; kb; kb= (KeyBlock*)kb->next, kbindex++)
 
586
        for (kbindex = 0, kb = (KeyBlock *)m_mesh->key->block.first; kb; kb = kb->next, kbindex++)
588
587
        {
589
588
                // first check the cases where the weight must be cleared
590
589
                if (kb->vgroup[0] == 0 ||
608
607
                        weights= (float*)MEM_mallocN(totvert*sizeof(float), "weights");
609
608
                
610
609
                        for (i=0; i < totvert; i++, dv++) {
611
 
                                weights[i]= defvert_find_weight(dv, defindex);
 
610
                                weights[i] = defvert_find_weight(dv, defindex);
612
611
                        }
613
612
 
614
613
                        kb->weights = weights;