Applied changes in texture reading io classes to OpenSpace

This commit is contained in:
Alexander Bock
2015-11-24 18:15:23 -05:00
parent 31db5c1603
commit 383c7028a8
20 changed files with 50 additions and 92 deletions
+2 -8
View File
@@ -138,10 +138,6 @@ bool RenderablePlanet::deinitialize() {
_geometry->deinitialize();
delete _geometry;
}
if (_texture)
delete _texture;
if (_nightTexture)
delete _nightTexture;
_geometry = nullptr;
_texture = nullptr;
@@ -222,10 +218,9 @@ void RenderablePlanet::update(const UpdateData& data){
}
void RenderablePlanet::loadTexture() {
delete _texture;
_texture = nullptr;
if (_colorTexturePath.value() != "") {
_texture = ghoul::io::TextureReader::ref().loadTexture(absPath(_colorTexturePath));
_texture = std::move(ghoul::io::TextureReader::ref().loadTexture(absPath(_colorTexturePath)));
if (_texture) {
LDEBUG("Loaded texture from '" << _colorTexturePath << "'");
_texture->uploadTexture();
@@ -237,10 +232,9 @@ void RenderablePlanet::loadTexture() {
}
}
if (_hasNightTexture) {
delete _nightTexture;
_nightTexture = nullptr;
if (_nightTexturePath != "") {
_nightTexture = ghoul::io::TextureReader::ref().loadTexture(absPath(_nightTexturePath));
_nightTexture = std::move(ghoul::io::TextureReader::ref().loadTexture(absPath(_nightTexturePath)));
if (_nightTexture) {
LDEBUG("Loaded texture from '" << _nightTexturePath << "'");
_nightTexture->uploadTexture();