- Timestamp:
- 09/29/06 11:19:25 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsLibrary.cpp
r1530 r1541 13 13 14 14 using namespace Geometry; 15 using namespace std; 15 16 16 17 //----------------------------------------------------------------------------- … … 82 83 void LodStripsLibrary::GoToLod(float lodfactor) 83 84 { 84 register int 85 register int 85 register int j; 86 register int offset; 86 87 long int i; 87 88 long int k; 88 89 long int b_change_ok = 1; 89 unsigned long int 90 unsigned long int lod; 90 91 long int t; 91 92 long int r; … … 95 96 long int total_changes; 96 97 long int totalR; 97 SmallIntVector *strip;98 SmallIntVector *strip; 98 99 SmallIntVector::iterator start; 99 100 … … 104 105 105 106 lodFactor=lodfactor; 106 // LODRegisterType * lastLOD = mCurrentRegLOD;107 107 108 108 if (newLOD != mCurrentLod) … … 112 112 // Forwards. 113 113 // Increments LOD (decreases level of detail) 114 for (lod = mCurrentLod; lod < newLOD || (mCurrentRegLOD->obligatory==1 && mCurrentLod<mLods-1); lod++) 115 { 116 next = mVertex[lod]; 114 for ( lod = mCurrentLod; 115 (lod < newLOD) 116 || 117 ((mCurrentRegLOD->obligatory == 1) && (lod < (mLods - 1))); 118 lod++) 119 { 120 next = mVertex[lod]; 117 121 total_changes = mPChanges[lod]; 118 122 … … 120 124 { 121 125 // Strip change. 122 t = mCurrentRegLOD->strip;126 t = mCurrentRegLOD->strip; 123 127 strip = &(mStrips[t]); 124 start = strip->begin(); 128 start = strip->begin(); 129 125 130 int stripsize_ini = strip->size(); 126 131 … … 188 193 mCurrentRegLOD--; 189 194 mCurrentData--; 190 195 196 191 197 // Decrements LOD. 192 for (lod = mCurrentLod; lod > newLOD || (mCurrentRegLOD->obligatory==1 && mCurrentLod>0); lod--) 193 { 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 194 207 total_changes = mPChanges[lod - 1]; 195 208 … … 252 265 int stripsize_end = strip->size(); 253 266 indices_x_submesh[submesh_x_strip[t]] += (stripsize_end - stripsize_ini); 254 255 267 } 256 268 257 // Update LOD. 269 // Update LOD. 258 270 mCurrentLod = lod - 1; 271 272 // Debug. 273 cout << "Obligatory: " 274 << (int)mCurrentRegLOD->obligatory 275 << endl; 259 276 } 260 277
Note: See TracChangeset
for help on using the changeset viewer.