From: James Turner Date: Sat, 26 Mar 2016 19:55:37 +0000 (+0000) Subject: Use ref-ptr in canvas adapter getImage X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2e1f01a86a971132b0e80f2ad87545feceb8616c;p=simgear.git Use ref-ptr in canvas adapter getImage Adjusted while investigating missing tooltip texture with recent OSG versions. --- diff --git a/simgear/canvas/CanvasSystemAdapter.hxx b/simgear/canvas/CanvasSystemAdapter.hxx index 2492bb91..43b3f780 100644 --- a/simgear/canvas/CanvasSystemAdapter.hxx +++ b/simgear/canvas/CanvasSystemAdapter.hxx @@ -37,7 +37,7 @@ namespace canvas virtual FontPtr getFont(const std::string& name) const = 0; virtual void addCamera(osg::Camera* camera) const = 0; virtual void removeCamera(osg::Camera* camera) const = 0; - virtual osg::Image* getImage(const std::string& path) const = 0; + virtual osg::ref_ptr getImage(const std::string& path) const = 0; virtual SGSubsystem* getSubsystem(const std::string& name) const = 0; virtual HTTP::Client* getHTTPClient() const = 0; }; diff --git a/simgear/canvas/elements/CanvasImage.cxx b/simgear/canvas/elements/CanvasImage.cxx index 6c037d70..99d332c4 100644 --- a/simgear/canvas/elements/CanvasImage.cxx +++ b/simgear/canvas/elements/CanvasImage.cxx @@ -463,7 +463,7 @@ namespace canvas } //---------------------------------------------------------------------------- - void Image::setImage(osg::Image *img) + void Image::setImage(osg::ref_ptr img) { // remove canvas... setSrcCanvas( CanvasPtr() ); diff --git a/simgear/canvas/elements/CanvasImage.hxx b/simgear/canvas/elements/CanvasImage.hxx index 2ac255cf..3e6c7e9d 100644 --- a/simgear/canvas/elements/CanvasImage.hxx +++ b/simgear/canvas/elements/CanvasImage.hxx @@ -59,7 +59,7 @@ namespace canvas void setSrcCanvas(CanvasPtr canvas); CanvasWeakPtr getSrcCanvas() const; - void setImage(osg::Image *img); + void setImage(osg::ref_ptr img); void setFill(const std::string& fill); /**