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:
parent
478171b8db
commit
60eee7722d
1 changed files with 6 additions and 5 deletions
|
@ -71,14 +71,15 @@ FGODGauge::~FGODGauge()
|
|||
*/
|
||||
typedef struct {
|
||||
osg::ref_ptr<osg::Group> parent;
|
||||
osg::ref_ptr<osg::Node> node;
|
||||
int unit;
|
||||
osg::ref_ptr<osg::Geode> node;
|
||||
unsigned int unit;
|
||||
} GroupListItem;
|
||||
|
||||
/**
|
||||
* Replace a texture in the airplane model with the gauge texture.
|
||||
*/
|
||||
class ReplaceStaticTextureVisitor:
|
||||
|
||||
public osg::NodeVisitor
|
||||
{
|
||||
public:
|
||||
|
@ -174,7 +175,7 @@ class ReplaceStaticTextureVisitor:
|
|||
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*>
|
||||
(
|
||||
|
@ -194,8 +195,8 @@ class ReplaceStaticTextureVisitor:
|
|||
/*
|
||||
* remember this group for modification once the scenegraph has been traversed
|
||||
*/
|
||||
groups_to_modify.push_back({parent, effectGeode->asNode(), unit});
|
||||
return;
|
||||
groups_to_modify.push_back({ parent, &node, unit });
|
||||
return;
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue