diff --git a/src/osgPlugins/flt/LightPointRecord.cpp b/src/osgPlugins/flt/LightPointRecord.cpp index c50b890a1..0383d0420 100644 --- a/src/osgPlugins/flt/LightPointRecord.cpp +++ b/src/osgPlugins/flt/LightPointRecord.cpp @@ -80,6 +80,7 @@ void LightPointRecord::endian() ENDIAN( pSLightPoint->sfSignificance ); ENDIAN( pSLightPoint->sfDrawOrder ); ENDIAN( pSLightPoint->sfFlags ); + ENDIAN( pSLightPoint->dwBackColor ); pSLightPoint->animRot.endian(); } diff --git a/src/osgPlugins/flt/LightPointRecord.h b/src/osgPlugins/flt/LightPointRecord.h index 4f5b42890..7fa75d125 100644 --- a/src/osgPlugins/flt/LightPointRecord.h +++ b/src/osgPlugins/flt/LightPointRecord.h @@ -17,7 +17,7 @@ struct SLightPoint char szIdent[8]; // 7 char ASCII ID; 0 terminates int16 iMaterial; // Surface material code (for DFAD) int16 iFeature; // Feature ID (for DFAD) - color32 dwBackColor; // Back color for all bidirectional points + int32 dwBackColor; // Back color for all bidirectional points int32 diMode; // Display mode // 0 = RASTER // 1 = CALLIGRAPHIC @@ -134,7 +134,7 @@ struct SLightPointIndex int32 iAppearanceIndex; // Index into lt pt appearance palette int32 iAnimationIndex; // Index into lt pt animation palette int32 iDrawOrder; // Calligraphic draw order - int32 iReserved_0; // Reserved + int32 iReserved_0; // Reserved }; class LightPointIndexRecord : public PrimNodeRecord diff --git a/src/osgPlugins/flt/flt2osg.cpp b/src/osgPlugins/flt/flt2osg.cpp index 867d077b2..25692d9f0 100644 --- a/src/osgPlugins/flt/flt2osg.cpp +++ b/src/osgPlugins/flt/flt2osg.cpp @@ -184,6 +184,7 @@ osg::Group* ConvertFromFLT::visitAncillary(osg::Group& osgParent, osg::Group& os // ancillary records. We need just one of these to put into the scenegraph // Nick. bool mxFound = false; + static int numVerts = 0; osg::Group* parent = &osgParent; // Visit ancillary records @@ -255,18 +256,22 @@ osg::Group* ConvertFromFLT::visitAncillary(osg::Group& osgParent, osg::Group& os case VERTEX_C_OP: visitVertex(osgPrimary, (VertexRecord*)child); + numVerts++; break; case VERTEX_CN_OP: visitNormalVertex(osgPrimary, (NormalVertexRecord*)child); + numVerts++; break; case VERTEX_CNT_OP: visitNormalTextureVertex(osgPrimary, (NormalTextureVertexRecord*)child); + numVerts++; break; case VERTEX_CT_OP: visitTextureVertex(osgPrimary, (TextureVertexRecord*)child); + numVerts++; break; default: @@ -2879,7 +2884,13 @@ void ConvertFromFLT::visitLightPoint(osg::Group& osgParent, LightPointRecord* re { DPRINT(stderr, " ** LP is BIdirectional...\n") ; - osg::Vec4 backcolor = pSLightPoint->dwBackColor.get() ; + // pSLightPoint->dwBackColor is not a color, it is handle + // Get the color from the ColorPool + // Nick + // osg::Vec4 backcolor = pSLightPoint->dwBackColor.get() ; + ColorPool* pColorPool = rec->getFltFile()->getColorPool(); + osg::Vec4 backcolor = pColorPool->getColor(pSLightPoint->dwBackColor); + if ( backcolor.w() == 0.0 ) backcolor[3] = 1.0 ; osgSim::LightPoint lp2( true, coords[ nl], backcolor, 1.0f, pointRadius); DPRINT(stderr, " Backface Color = %f, %f, %f, %f\n", backcolor.x(), backcolor.y(), backcolor.z(), backcolor.w()) ;