Changeset 7075
- Timestamp:
- 07/06/07 15:33:40 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/Pools.cpp
r5375 r7075 21 21 bool fixedIntensity = (indexIntensity & 0x1000) ? true : false; 22 22 unsigned int index = (fixedIntensity) ? (indexIntensity & 0x0fff)+(4096>>7) : indexIntensity >> 7; 23 assert(index<size()); 24 osg::Vec4 col = at(index); 23 24 if (index>=size()) 25 { 26 // color index not available. 27 return osg::Vec4(1,1,1,1); 28 } 29 30 osg::Vec4 col = operator[](index); 25 31 if (!fixedIntensity) 26 32 { … … 36 42 // bit 0-6: intensity 37 43 // bit 7-15 color index 38 int index = indexIntensity >> 7;44 unsigned int index = indexIntensity >> 7; 39 45 40 if (index <0 || index>=(int)size())46 if (index>=size()) 41 47 { 42 48 // color index not available. … … 44 50 } 45 51 46 osg::Vec4 col = at(index);52 osg::Vec4 col = operator[](index); 47 53 float intensity = (float)(indexIntensity & 0x7f)/127.f; 48 54 col[0] *= intensity;
