leaks fix (valgrind full leak check) in world
This commit is contained in:
@@ -22,7 +22,7 @@ Atlas::~Atlas() {
|
||||
}
|
||||
|
||||
void Atlas::prepare() {
|
||||
texture.reset(Texture::from(image.get()));
|
||||
texture = Texture::from(image.get());
|
||||
}
|
||||
|
||||
bool Atlas::has(const std::string& name) const {
|
||||
|
||||
@@ -64,11 +64,11 @@ void Texture::setNearestFilter() {
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
Texture* Texture::from(const ImageData* image) {
|
||||
std::unique_ptr<Texture> Texture::from(const ImageData* image) {
|
||||
uint width = image->getWidth();
|
||||
uint height = image->getHeight();
|
||||
const void* data = image->getData();
|
||||
return new Texture((ubyte*)data, width, height, image->getFormat());
|
||||
return std::make_unique<Texture>((ubyte*)data, width, height, image->getFormat());
|
||||
}
|
||||
|
||||
uint Texture::getWidth() const {
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
|
||||
virtual uint getId() const;
|
||||
|
||||
static Texture* from(const ImageData* image);
|
||||
static std::unique_ptr<Texture> from(const ImageData* image);
|
||||
};
|
||||
|
||||
#endif // GRAPHICS_CORE_TEXTURE_HPP_
|
||||
|
||||
Reference in New Issue
Block a user