source: GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsLibrary.cpp @ 1552

Revision 1552, 19.2 KB checked in by gumbau, 18 years ago (diff)

Fixed degenerates in LodStripsFixed?

Line 
1/*==========================================================================
2 *      (C) 2005 Universitat Jaume I
3 *==========================================================================
4 *      PROYECT:        GAME TOOLS
5 *==========================================================================
6 *      CONTENT:
7 *
8 *
9 *      @file   GeoLodStripsLibrary.cpp
10 *===========================================================================*/
11
12#include "GeoLodStripsLibrary.h"
13
14using namespace Geometry;
15using   namespace       std;
16
17//-----------------------------------------------------------------------------
18//      Constructor.
19//-----------------------------------------------------------------------------
20LodStripsLibrary::LodStripsLibrary(const LodStripsLibraryData *lodstripsdata, Mesh *geomesh, IndexData *userindexdata)
21//:dataRetrievalInterface(idfun?idfun:DefaultIndexDataCreator)
22{
23//      const   char    *name_of_file;
24
25        //      Sets the current lod.
26        mCurrentLod     =       0;
27
28        //      Converts a String to const char *.
29//      name_of_file    =       name.data();
30
31        //      Sets the global mesh.
32        mGeoMesh = geomesh;
33
34        delete_indexdata=false;
35        dataRetrievalInterface=userindexdata;
36       
37        indices_x_submesh = NULL;
38        offsets_x_submesh = NULL;
39        mStripsSubmesh = NULL;
40        submesh_x_strip = NULL;
41        lodFactor=1.0f;
42        current_triangle_count=0;
43       
44        //      Loads the Level Of Detail file.
45        LodStripsLibrary::LoadStripMesh(lodstripsdata,mGeoMesh);
46
47        GoToLod(0.0f); 
48        minFaces = 0;
49        for (unsigned int strip = 0; strip < mTotalStrips; strip++)
50                minFaces += int(mStrips[strip].size() - 2);
51
52        GoToLod(1.0f);
53        maxFaces = 0;
54        for (unsigned int strip = 0; strip < mTotalStrips; strip++)
55                maxFaces += int(mStrips[strip].size() - 2);
56}
57
58//-----------------------------------------------------------------------------
59//      Destructor
60//-----------------------------------------------------------------------------
61LodStripsLibrary::~LodStripsLibrary()
62{
63        delete  [] mStrips;
64        if (delete_indexdata)
65                delete dataRetrievalInterface;
66        if (indices_x_submesh)
67                delete[] indices_x_submesh;
68        if (offsets_x_submesh)
69                delete[] offsets_x_submesh;
70        if (mStripsSubmesh)
71                delete[] mStripsSubmesh;
72        if (submesh_x_strip)
73                delete[] submesh_x_strip;
74}
75
76//-----------------------------------------------------------------------------
77//      Public.
78//-----------------------------------------------------------------------------
79
80//-----------------------------------------------------------------------------
81//      Go to the level of detail.
82//-----------------------------------------------------------------------------
83void LodStripsLibrary::GoToLod(float lodfactor)
84{
85        register        int                     j;
86        register        int                     offset;
87        long                    int                     i;
88        long                    int                     k;
89        long                    int                     b_change_ok     =       1;
90        unsigned long   int     lod;
91        long                    int                     t;
92        long                    int                     r;
93        long                    int                     next;
94        long                    int                     el1;
95        long                    int                     el2;
96        long                    int                     total_changes;
97        long                    int                     totalR;
98        SmallIntVector                                          *strip;
99        SmallIntVector::iterator        start;
100
101        if (lodfactor<0.0f) lodfactor=0.0f;
102        if (lodfactor>1.0f) lodfactor=1.0f;
103
104        uint32 newLOD = (uint32)((1.0f - lodfactor) * mLods);
105
106        lodFactor=lodfactor;
107   
108        if (newLOD != mCurrentLod)
109        {
110                if (newLOD > mCurrentLod)
111                {
112                        //      Forwards.
113                        //      Increments LOD (decreases level of detail)
114                        for (   lod     =       mCurrentLod;
115                                                (lod < newLOD)
116                                                ||
117                                                ((mCurrentRegLOD->obligatory == 1) && (lod < (mLods - 1)));
118                                                lod++)
119                        {
120                                next                                    =       mVertex[lod];
121                                total_changes   =       mPChanges[lod];
122
123                                for (i = 0; i < total_changes; i++)
124                                {
125                                        //      Strip change.
126                                        t                       =       mCurrentRegLOD->strip;
127                                        strip   =       &(mStrips[t]);
128                                        start   =       strip->begin();
129
130                                        int stripsize_ini = strip->size();
131                               
132                                        //      Position.
133                                        totalR  =       mCurrentRegLOD->position;
134
135                                        for (j = totalR - 1; j >= 0; j--)
136                                        {
137                                                start[*mCurrentData]    =       next;                                           
138                                                ++mCurrentData;
139                                        }
140                                       
141                                        //      L1.
142                                        totalR  =       mCurrentRegLOD->vertexRepetition;
143                                       
144                                        for (j = totalR - 1; j >= 0; j--)
145                                        {
146                                                offset  =       *mCurrentData + 1;
147
148                                                strip->erase(   start + offset,
149                                                                                                        start
150                                                                                                        +
151                                                                                                        offset
152                                                                                                        +
153                                                                                                        (*(mCurrentData + 1)));
154
155                                                ++mCurrentData;
156                                                ++mCurrentData;
157                                        }
158                                       
159                                        //      L2
160                                        totalR  =       mCurrentRegLOD->edgeRepetition;
161                                       
162                                        for (j = totalR - 1; j >= 0; j--)
163                                        {
164                                                offset  =       *mCurrentData + 2;
165                                                strip->erase(   start   +       offset,
166                                                                                                        start
167                                                                                                        +
168                                                                                                        offset
169                                                                                                        +
170                                                                                                        2*(*(mCurrentData + 1)));
171
172                                                mCurrentData++;
173                                                mCurrentData++;
174                                        }
175
176//                                      lastLOD = mCurrentRegLOD;
177                                        mCurrentRegLOD++;
178                                       
179                                        mStripsChanges[t]       =       1;
180
181                                        int stripsize_end = strip->size();
182                                        indices_x_submesh[submesh_x_strip[t]] -= (stripsize_ini - stripsize_end);
183                               
184                                }
185                               
186                                mCurrentLod     =       lod + 1;
187                        }
188
189                }
190                //      If LOD is less than actual.
191                else
192                {
193                        mCurrentRegLOD--;
194                        mCurrentData--;
195
196
197                        //      Decrements LOD.
198                        for (   lod     =       mCurrentLod;
199                                                (lod > newLOD)
200                                                ||
201                                                ((mCurrentRegLOD->obligatory == 1) && (lod > 0))
202                                                ||
203                                                ((mCurrentRegLOD[1].obligatory == 1) && (lod > 0));
204                                                lod--)
205                        {
206
207                                total_changes   =       mPChanges[lod - 1];
208                               
209                                for (i = 0; i < total_changes; i++)
210                                {
211                                        t                       =       mCurrentRegLOD->strip;
212                                        strip   =       &(mStrips[t]);
213                                        start   =       mStrips[t].begin();
214                                        int stripsize_ini = strip->size();
215
216                                        //      L2.
217                                        totalR  =       mCurrentRegLOD->edgeRepetition;
218                                       
219                                        for (j = 0; j < totalR; j++)
220                                        {
221                                                el1     =       (*strip)[*(mCurrentData - 1)];
222                                                el2     =       (*strip)[*(mCurrentData - 1) + 1];
223                                                r               =       *(mCurrentData);
224                                               
225                                                for (k = 0; k < r; k++)
226                                                {
227                                                        (*strip).insert(start+*(mCurrentData - 1),el2);
228                                                        (*strip).insert(start+*(mCurrentData - 1),el1);
229                                                }
230                                               
231                                                mCurrentData--;
232                                                mCurrentData--;
233                                        }
234
235                                        //      Vertex Repetition.
236                                        totalR  =       mCurrentRegLOD->vertexRepetition;
237                                       
238                                        for (j = 0; j < totalR; j++)
239                                        {
240                                                el1     =       (*strip)[*(mCurrentData-1)];
241                                                r               =       *(mCurrentData);
242                                               
243                                                for (k = 0; k < r; k++)
244                                                {
245                                                        (*strip).insert(start+*(mCurrentData-1),el1);
246                                                }
247
248                                                mCurrentData--;
249                                                mCurrentData--;
250                                        }
251                                       
252                                        //      POS.
253                                        totalR  =       mCurrentRegLOD->position;
254                                       
255                                        for (j = 0; j < totalR; j++)
256                                        {
257                                                (*strip)[*mCurrentData] =       lod - 1;
258                                                mCurrentData--;
259                                        }
260                                       
261        //                              lastLOD = mCurrentRegLOD;
262                                        mCurrentRegLOD--;
263                                        mStripsChanges[t]       =       1;
264
265                                        int stripsize_end = strip->size();
266                                        indices_x_submesh[submesh_x_strip[t]] += (stripsize_end - stripsize_ini);
267                                }                       
268                               
269                                //      Update LOD.
270                                mCurrentLod     =       lod - 1;
271
272                                //      Debug.
273                                cout    <<      "Obligatory: "
274                                                        <<      (int)mCurrentRegLOD->obligatory
275                                                        <<      endl;
276                        }
277                       
278                        mCurrentData++;
279                        mCurrentRegLOD++;
280                }
281        }
282
283/*      // debug!
284        FILE *f = fopen("lodstrips_lodinfo.txt","wt");
285        fprintf(f,"mCurrentLOD: %d",mCurrentLod);
286        fprintf(f,"mLods: %d",mLods);
287        for (int i=0; i<mTotalStrips; i++)
288        {
289                fprintf(f,"\nstrip: %d - ",i);
290                for (int j=0; j<mStrips[i].size(); j++)
291                {
292                        int ind = mStrips[i][j];
293                        fprintf(f,"%d ",ind);
294                }
295        }
296        fclose(f);*/
297
298        UpdateDataRetrievalInterface();
299//      return  return_value;
300}
301
302//-----------------------------------------------------------------------------
303//      Returns the number of vertices of the highest LOD.
304//-----------------------------------------------------------------------------
305uint32  LodStripsLibrary::MaxVertices()
306{
307        return  mMaxVerticesLOD;
308}
309
310//-----------------------------------------------------------------------------
311//      Returns the number of vertices of the lowest LOD.
312//-----------------------------------------------------------------------------
313uint32  LodStripsLibrary::MinVertices()
314{
315        uint32  number_of_vertices;
316
317        //      Total vertices of minimum lod.
318        number_of_vertices      =       mMaxVerticesLOD - (mMinLod + 1);
319
320        return  number_of_vertices;
321}
322
323//-----------------------------------------------------------------------------
324//      Returns the number of triangles of the highest LOD.
325//-----------------------------------------------------------------------------
326uint32  LodStripsLibrary::MaxFaces()
327{
328/*      uint32  number_of_faces;
329
330        uint32  current_lod;
331
332        current_lod     =       GoToLod(MaxLod());
333
334        //      Initialize number of faces count.
335        number_of_faces =       0;
336
337        //      For each strip.
338        for (unsigned int strip =       0; strip < mTotalStrips; strip++)
339        {
340                number_of_faces +=      int(mStrips[strip].size() - 2);
341        }
342
343        GoToLod(current_lod);
344
345        return  number_of_faces;*/
346
347        return maxFaces;
348}
349
350//-----------------------------------------------------------------------------
351//      Returns the number of triangles of the lowest LOD.
352//-----------------------------------------------------------------------------
353uint32  LodStripsLibrary::MinFaces()
354{
355/*      uint32  current_lod;
356        uint32  number_of_faces;
357
358        current_lod     =       GoToLod(MinLod());
359
360        //      Initialize number of faces count.
361        number_of_faces =       0;
362
363        //      For each strip.
364        for (unsigned int strip =       0; strip < mTotalStrips; strip++)
365        {
366                number_of_faces +=      int(mStrips[strip].size() - 2);
367        }
368
369        GoToLod(current_lod);
370
371        return  number_of_faces;*/
372
373        return minFaces;
374}
375
376//-----------------------------------------------------------------------------
377//      Establishes the new LOD range.
378//      Only the LODs in that range are stored and used.
379//-----------------------------------------------------------------------------
380void            LodStripsLibrary::TrimByLod(uint32 minLod, uint32 maxLod)
381{
382        //      Refresh number of vercies of the max lod.
383        mMaxVerticesLOD +=      mMaxLod - maxLod;
384       
385        mMinLod =       minLod;
386        mMaxLod =       maxLod;
387}
388/*
389//-----------------------------------------------------------------------------
390//      Get strip count.
391//-----------------------------------------------------------------------------
392uint32  LodStripsLibrary::GetStripCount() const
393{
394        return  (uint32)        mTotalStrips;
395}
396
397//-----------------------------------------------------------------------------
398//      Get Index by strip.
399//-----------------------------------------------------------------------------
400uint32  LodStripsLibrary::GetIndexCountByStrip(uint32 istrip) const
401{
402        return (uint32) mStrips[istrip].size();
403}
404*/
405//-----------------------------------------------------------------------------
406//      Private.
407//-----------------------------------------------------------------------------
408
409//-----------------------------------------------------------------------------
410//      Copy a STL vector to a C array.
411//-----------------------------------------------------------------------------
412void LodStripsLibrary::CopyVectors2Arrays(void)
413{
414        SmallInt                                        max;
415        SmallInt                                        t;
416        SmallInt                                        *data_array;
417        SmallIntVector          tira;
418        LODRegisterType         *changes_array;
419        LODRegisterVector       list_changes;
420
421        mTotalStrips            =       int(mFileStrips.size());
422        mVertex                                 =       new SmallInt[mTotalVertices];
423        mStripsChanges  =       new SmallInt[mTotalChanges];
424        mStrips                                 =       new SmallIntVector[mTotalStrips];
425        data_array                      =       new SmallInt[mData.size()];
426       
427        max                                     =       0;
428        mTotalFaces     =       0;
429
430//      unsigned int * strip_sizes = new unsigned int[mFileStrips.size()];
431        unsigned int total_strip_size = 0;
432       
433        for (unsigned   int     i = 0; i < mFileStrips.size(); i++)
434        {
435                total_strip_size += t = int(mFileStrips[i].size());
436                if (t>max)
437                        max     =       t;
438                mTotalFaces     +=      t - 2;
439        }
440
441        changes_array   =       new LODRegisterType[mFileChangesLOD.size()];
442       
443        //      Fill up changes array.
444        for (unsigned   int     i = 0; i < mFileChangesLOD.size(); ++i)
445        {
446                changes_array[i]        =       mFileChangesLOD[i];
447        }
448
449        mCurrentRegLOD  =       changes_array;
450       
451        //      Copy strips.
452//      unsigned int numDegenerated = 2*mTotalStrips - 2;
453//      dataRetrievalInterface=create_index_data_func(total_strip_size,indexdata_user_data); // temporal!
454
455//      dataRetrievalInterface->Init(total_strip_size);
456/*      dataRetrievalInterface->numinds=total_strip_size;
457        dataRetrievalInterface->numvalidinds=total_strip_size;*/
458//      dataRetrievalInterface->Begin();
459
460        unsigned        int     ii = 0;
461
462        for (unsigned   int     i = 0; i < mFileStrips.size(); i++)
463        {
464                for (unsigned   int     j = 0; j < mFileStrips[i].size(); j++,ii++)
465                {
466                        mStrips[i].push_back(mFileStrips[i][j]);
467//                      dataRetrievalInterface->SetIndex(ii,mFileStrips[i][j]);
468                }
469               
470                //      Reset flags of strips changed.
471                mStripsChanges[i]       =       0;
472        }
473
474//      dataRetrievalInterface->End();
475
476        for (unsigned   int     i = 0; i < mData.size(); i++)
477        {
478                data_array[i]   =       mData[i];
479        }
480       
481        mCurrentData    =       data_array;
482
483        //      Fill up mVertex.
484        for(unsigned    int     i = 0; i < mFileVertices.size(); i++)
485        {
486                mVertex[i]      =       mFileVertices[i];
487        }
488
489//      delete[] strip_sizes;
490}
491
492//-----------------------------------------------------------------------------
493//      LoadStripMesh
494//-----------------------------------------------------------------------------
495void LodStripsLibrary::LoadStripMesh(const LodStripsLibraryData *lodstripsdata, Mesh *geomesh)
496{
497        //FILE                                                                                                                  *fp;
498        SmallIntVector                                                                          strip_aux;
499        //LODRegisterType                                                                               lod_register;
500        std::vector                     <LODRegisterType>       list_pos;
501        std::vector                     <unsigned int>          p_changes;
502        //int                                                                                                                           value;
503        int                                                                                                                             v                       =       0;
504        int                                                                                                                             t                       =       -1;
505        int                                                                                                                             s                       =       0;
506        int                                                                                                                             next    =       0;
507        int                                                                                                                             c                       =       -1;
508        //char                                                                                                                  buff[80];
509        Index                                                                                                                   *index;
510        Index                                                                                                                   *indexBegin;
511        Index                                                                                                                   *indexEnd;
512        SubMesh                                                                                                         *geoSubMesh;
513
514        //      For each one of the submeshes.
515        indices_x_submesh = new int[geomesh->mSubMeshCount];
516        offsets_x_submesh = new int[geomesh->mSubMeshCount];
517
518        int totaltiras = 0;
519        for (unsigned int submesh = 0; submesh < geomesh->mSubMeshCount; submesh++)
520                for (unsigned int strip = 0; strip < geomesh->mSubMesh[submesh].mStripCount; strip++)
521                        totaltiras++;
522
523        submesh_x_strip = new int[totaltiras];
524
525        int istrip = 0;
526        for (unsigned int submesh       =       0; submesh < geomesh->mSubMeshCount; submesh++)
527        {
528                geoSubMesh      =       &geomesh->mSubMesh[submesh];
529                indices_x_submesh[submesh] = 0;
530
531                //      For each one of the strips.
532                for (unsigned int strip = 0; strip < geoSubMesh->mStripCount; strip++, istrip++)
533                {
534                        // Insert an empty strip.
535                        submesh_x_strip[istrip] = submesh;
536                        t++;
537                        strip_aux.clear();
538                        mFileStrips.push_back(strip_aux);
539
540                        //      First index of the strip.
541                        indexBegin      =       geoSubMesh->mStrip[strip];
542
543                        //      If the strips is not the first. (DEG!)
544                        if (strip != 0)
545                                indexBegin++;
546
547                        //      If is the final strip
548                        if (strip       == (geoSubMesh->mStripCount - 1))
549                        {
550                                //      The end of the index array.
551                                indexEnd        = &geoSubMesh->mIndex[geoSubMesh->mIndexCount];
552                        }
553                        else
554                        {
555                                //      The beginning of the next strip.
556                                indexEnd        = geoSubMesh->mStrip[strip + 1];
557
558                                //      Remove degenerated (DEG!)
559                                indexEnd--;
560                        }
561                       
562                        int i;
563                        i       = 0;
564                       
565                        if (submesh==0)
566                                offsets_x_submesh[submesh] = 0;
567                        else
568                                offsets_x_submesh[submesh] = indices_x_submesh[submesh-1];
569
570                        //      For each index of the strip.
571                        for (index = indexBegin; index < indexEnd; index++)
572                        {
573                                mFileStrips[t].push_back(indexBegin[i]);
574                                indices_x_submesh[submesh]++;
575                                i++;
576                        }                       
577                }
578        }
579
580        //      TODO:   LOD file loaded in load file mesh process.
581        //      Open the LOD file.
582/*      if ((fp = fopen (name, "r")) == NULL)
583        {
584                //      Error in open.
585        }
586        else
587        {
588                mTotalChanges   =       0;
589               
590                while (!feof (fp))
591                {
592                        fgets (buff, 80, fp);
593                       
594                        if (*buff == 'v')
595                        {
596                                sscanf (buff+2,"%d",&value);
597                               
598                                mFileVertices.push_back(value);
599                                v++;
600                        }
601                        else if ( (*buff == 'c') || (*buff == 'd'))
602                        {
603                                if (*buff == 'c')
604                                {
605                                        c++;
606                                }
607                                else
608                                {
609                                        unsigned        int     a;
610                                        unsigned        int     b;
611                                        unsigned        int     c;
612                                        unsigned        int     d;
613                                       
614                                        sscanf (buff+2,"%u %u %u %u\n",&a,&b,&c,&d);
615                                        lod_register.strip                                              =       a;
616                                        lod_register.position                                   =       b;
617                                        lod_register.vertexRepetition   =       c;
618                                        lod_register.edgeRepetition             =       d;
619                                       
620                                        mFileChangesLOD.push_back(lod_register);
621                                }
622                        }
623                        else if (*buff=='b')
624                        {
625                                sscanf(buff+2,"%u",&value);
626                                mData.push_back(value);
627                        }
628                        else if (*buff=='p')
629                        {
630                                sscanf (buff+2,"%u",&value);
631                                p_changes.push_back(value);
632                        }
633                }
634               
635                fclose(fp);*/
636
637        mFileVertices = lodstripsdata->mFileVertices;
638        mFileChangesLOD = lodstripsdata->mFileChangesLOD;
639        mData = lodstripsdata->mData;
640        p_changes = lodstripsdata->p_changes;
641
642        mStripsSubmesh = new int [geomesh->mSubMeshCount];
643        for (size_t     submesh = 0; submesh < geomesh->mSubMeshCount; submesh++)
644        {       
645                mStripsSubmesh[submesh]=0;
646        }
647
648                       
649        //      Max / Min values for LOD.
650        mLods                                                                                   =       int(p_changes.size());
651        mMaxLod                                                                         =       0;
652        mMinLod                                                                         =       mLods;
653
654        mPChanges                       =       new SmallInt[mLods];
655       
656        for (unsigned int i = 0; i < mLods; i++)
657                mPChanges[i] = p_changes[i];
658
659        mTotalVertices          =       int(mFileVertices.size());
660        mMaxVerticesLOD         =       mTotalVertices;
661        mTotalStrips                    =       int(mFileStrips.size());
662        mTotalChanges                   =       int(mFileChangesLOD.size());
663
664        //Copy the data to the structure we will use
665        CopyVectors2Arrays();
666}
667
668void LodStripsLibrary::UpdateDataRetrievalInterface(void)
669{
670        int     target_submesh  = 0;
671        size_t  strip_count     = 0;
672        unsigned int ii_submesh = 0;   
673        current_triangle_count = 0;
674
675        // indices_x_submesh is calculated without degenerates,
676        // we must add the degenerate indices added here
677        uint32 numdeg = mGeoMesh->mSubMesh[target_submesh].mStripCount*2 - 2;
678
679        dataRetrievalInterface->Begin(target_submesh, indices_x_submesh[target_submesh] + numdeg);
680        current_triangle_count += indices_x_submesh[target_submesh] + numdeg;
681
682        for (unsigned int i = 0; i < mTotalStrips; i++, strip_count++)
683        {
684                if (strip_count >= mGeoMesh->mSubMesh[target_submesh].mStripCount)
685                {
686                        if (target_submesh==0)
687                                offsets_x_submesh[target_submesh] = 0;
688                        else
689                                offsets_x_submesh[target_submesh] = indices_x_submesh[target_submesh-1] + offsets_x_submesh[target_submesh-1];
690
691                        mStripsSubmesh[target_submesh]  =       (int)strip_count;
692                        strip_count     =       0;
693
694                        target_submesh++;
695                        ii_submesh = 0;
696                        dataRetrievalInterface->End();
697                       
698                        numdeg = mGeoMesh->mSubMesh[target_submesh].mStripCount*2 - 2;
699                        dataRetrievalInterface->Begin(target_submesh, indices_x_submesh[target_submesh] + numdeg);
700                        current_triangle_count += indices_x_submesh[target_submesh] + numdeg;
701                }
702               
703                int lastindex = -1;
704                for (SmallIntVector::iterator it=mStrips[i].begin(); it!=mStrips[i].end(); it++, ii_submesh++)
705                {
706                        // repeat the first index of the strip: degenerate (DEG!)
707                        // except for the first strip in a mesh
708                        if (lastindex==-1 && strip_count>0)
709                        {
710                                lastindex=*it;
711                                dataRetrievalInterface->SetIndex(ii_submesh,*it);                               
712                                ii_submesh++;
713                        }
714                        lastindex=*it;
715                        dataRetrievalInterface->SetIndex(ii_submesh,*it);
716                }
717
718                // repeat last vertex of the strip: degenerate (DEG!)
719                // except for the last strip in a mesh
720                if (strip_count<mGeoMesh->mSubMesh[target_submesh].mStripCount-1)
721                {
722                        dataRetrievalInterface->SetIndex(ii_submesh,lastindex);
723                        ii_submesh++;
724                }
725        }
726
727        if (strip_count >= mGeoMesh->mSubMesh[target_submesh].mStripCount)
728        {
729                if (target_submesh==0)
730                        offsets_x_submesh[target_submesh] = 0;
731                else
732                        offsets_x_submesh[target_submesh] = indices_x_submesh[target_submesh-1] + offsets_x_submesh[target_submesh-1];
733
734                mStripsSubmesh[target_submesh] = (int)strip_count;
735                strip_count = 0;
736                target_submesh++;
737        }
738
739        dataRetrievalInterface->End();
740}
Note: See TracBrowser for help on using the repository browser.