Updated Canvas adaptor getImage API
Return the Image by ref ptr instead of raw pointer.
This commit is contained in:
parent
e8398d5cee
commit
c29fa35840
2 changed files with 3 additions and 3 deletions
|
@ -77,7 +77,7 @@ namespace canvas
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
osg::Image* FGCanvasSystemAdapter::getImage(const std::string& path) const
|
||||
osg::ref_ptr<osg::Image> FGCanvasSystemAdapter::getImage(const std::string& path) const
|
||||
{
|
||||
if( SGPath(path).isAbsolute() )
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ namespace canvas
|
|||
{
|
||||
SGPath tpath = globals->resolve_resource_path(path);
|
||||
if( !tpath.isNull() )
|
||||
return osgDB::readImageFile(tpath.c_str());
|
||||
return osgDB::readRefImageFile(tpath.c_str());
|
||||
|
||||
SG_LOG(SG_IO, SG_ALERT, "canvas::Image: No such image: '" << path << "'");
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace canvas
|
|||
virtual simgear::canvas::FontPtr getFont(const std::string& name) const;
|
||||
virtual void addCamera(osg::Camera* camera) const;
|
||||
virtual void removeCamera(osg::Camera* camera) const;
|
||||
virtual osg::Image* getImage(const std::string& path) const;
|
||||
virtual osg::ref_ptr<osg::Image> getImage(const std::string& path) const;
|
||||
virtual SGSubsystem* getSubsystem(const std::string& name) const;
|
||||
virtual simgear::HTTP::Client* getHTTPClient() const;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue