- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/PaletteRecords.cpp
r11489 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 219 219 material->setEmission(osg::Material::FRONT_AND_BACK,osg::Vec4(emissive,alpha)); 220 220 material->setShininess(osg::Material::FRONT_AND_BACK,shininess); 221 221 222 222 MaterialPool* mp = document.getOrCreateMaterialPool(); 223 223 (*mp)[index] = material; … … 258 258 std::string name = in.readString(12); 259 259 in.forward(4*28); 260 260 261 261 osg::Material* material = new osg::Material; 262 262 material->setAmbient(osg::Material::FRONT_AND_BACK,osg::Vec4(ambient,alpha)); … … 265 265 material->setEmission(osg::Material::FRONT_AND_BACK,osg::Vec4(emissive,alpha)); 266 266 material->setShininess(osg::Material::FRONT_AND_BACK,shininess); 267 267 268 268 MaterialPool* mp = document.getOrCreateMaterialPool(); 269 269 (*mp)[i] = material; … … 284 284 285 285 META_Record(TexturePalette) 286 286 287 287 protected: 288 288 … … 558 558 META_Record(LightSourcePalette) 559 559 560 enum LightType 560 enum LightType 561 561 { 562 562 INFINITE_LIGHT = 0, … … 656 656 appearance->featureID = in.readInt16(); 657 657 658 int32 backColorIndex = in.readInt32(); 659 appearance->backColor = document.getColorPool() ? 660 document.getColorPool()->getColor(backColorIndex) : 658 int32 backColorIndex = in.readInt32(); 659 appearance->backColor = document.getColorPool() ? 660 document.getColorPool()->getColor(backColorIndex) : 661 661 osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f); 662 662 … … 694 694 appearance->LODRangeRatio = in.readFloat32(); 695 695 appearance->LODScale = in.readFloat32(); 696 696 697 697 if(document.version() > VERSION_15_8) 698 698 appearance->texturePatternIndex = in.readInt16(-1); 699 699 else 700 700 appearance->texturePatternIndex = -1; 701 701 702 702 // The final short is reserved; don't bother reading it. 703 703 704 704 // Add to pool 705 705 LightPointAppearancePool* lpaPool = document.getOrCreateLightPointAppearancePool();
