1
0
Fork 0

Another different fix for the pointer conversion issue.

Based on the comments in the list I think it is better to keep the type that was originally provided as a reference, take the address of it, and store that in a ref_ptr.

Possibly the problem was never compiler related rather OSG related; I'm using 3.5.x and it appears that there are better built in type conversions compared to the target version of 3.2 that we are currently using.
This commit is contained in:
Richard Harrison 2017-02-17 17:56:32 +01:00
parent 478171b8db
commit 60eee7722d

View file

@ -71,14 +71,15 @@ FGODGauge::~FGODGauge()
*/ */
typedef struct { typedef struct {
osg::ref_ptr<osg::Group> parent; osg::ref_ptr<osg::Group> parent;
osg::ref_ptr<osg::Node> node; osg::ref_ptr<osg::Geode> node;
int unit; unsigned int unit;
} GroupListItem; } GroupListItem;
/** /**
* Replace a texture in the airplane model with the gauge texture. * Replace a texture in the airplane model with the gauge texture.
*/ */
class ReplaceStaticTextureVisitor: class ReplaceStaticTextureVisitor:
public osg::NodeVisitor public osg::NodeVisitor
{ {
public: public:
@ -174,7 +175,7 @@ class ReplaceStaticTextureVisitor:
return; return;
} }
for( int unit = 0; unit < ss->getNumTextureAttributeLists(); ++unit ) for( unsigned int unit = 0; unit < ss->getNumTextureAttributeLists(); ++unit )
{ {
osg::Texture2D* tex = dynamic_cast<osg::Texture2D*> osg::Texture2D* tex = dynamic_cast<osg::Texture2D*>
( (
@ -194,7 +195,7 @@ class ReplaceStaticTextureVisitor:
/* /*
* remember this group for modification once the scenegraph has been traversed * remember this group for modification once the scenegraph has been traversed
*/ */
groups_to_modify.push_back({parent, effectGeode->asNode(), unit}); groups_to_modify.push_back({ parent, &node, unit });
return; return;
} }
} }