1
0
Fork 0

Updated Canvas adaptor getImage API

Return the Image by ref ptr instead of raw pointer.
This commit is contained in:
James Turner 2016-03-26 20:25:31 +00:00
parent e8398d5cee
commit c29fa35840
2 changed files with 3 additions and 3 deletions

View file

@ -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 << "'");
}

View file

@ -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;
};