Showing the changes to interface/src/renderer/TextureCache.cpp (1 of 23 files). Show all
Unified · Split
| @@ -40,14 +40,14 @@ TextureCache::~TextureCache() { · 39 unmodified lines | |||
| 40 | foreach (GLuint id, _fileTextureIDs) { | 40 | foreach (GLuint id, _fileTextureIDs) { |
| 41 | glDeleteTextures(1, &id); | 41 | glDeleteTextures(1, &id); |
| 42 | } | 42 | } |
| 43 | if (_primaryFramebufferObject != NULL) { | 43 | if (_primaryFramebufferObject) { |
| 44 | delete _primaryFramebufferObject; | 44 | delete _primaryFramebufferObject; |
| 45 | glDeleteTextures(1, &_primaryDepthTextureID); | 45 | glDeleteTextures(1, &_primaryDepthTextureID); |
| 46 | } | 46 | } |
| 47 | if (_secondaryFramebufferObject != NULL) { | 47 | if (_secondaryFramebufferObject) { |
| 48 | delete _secondaryFramebufferObject; | 48 | delete _secondaryFramebufferObject; |
| 49 | } | 49 | } |
| 50 | if (_tertiaryFramebufferObject != NULL) { | 50 | if (_tertiaryFramebufferObject) { |
| 51 | delete _tertiaryFramebufferObject; | 51 | delete _tertiaryFramebufferObject; |
| 52 | } | 52 | } |
| 53 | } | 53 | } |
| @@ -138,7 +138,7 @@ QSharedPointer<NetworkTexture> TextureCache::getTexture(const QUrl& url, bool no · 84 unmodified lines | |||
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | QOpenGLFramebufferObject* TextureCache::getPrimaryFramebufferObject() { | 140 | QOpenGLFramebufferObject* TextureCache::getPrimaryFramebufferObject() { |
| 141 | if (_primaryFramebufferObject == NULL) { | 141 | if (!_primaryFramebufferObject) { |
| 142 | _primaryFramebufferObject = createFramebufferObject(); | 142 | _primaryFramebufferObject = createFramebufferObject(); |
| 143 | 143 | ||
| 144 | glGenTextures(1, &_primaryDepthTextureID); | 144 | glGenTextures(1, &_primaryDepthTextureID); |
| @@ -164,21 +164,21 @@ GLuint TextureCache::getPrimaryDepthTextureID() { · 19 unmodified lines | |||
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | QOpenGLFramebufferObject* TextureCache::getSecondaryFramebufferObject() { | 166 | QOpenGLFramebufferObject* TextureCache::getSecondaryFramebufferObject() { |
| 167 | if (_secondaryFramebufferObject == NULL) { | 167 | if (!_secondaryFramebufferObject) { |
| 168 | _secondaryFramebufferObject = createFramebufferObject(); | 168 | _secondaryFramebufferObject = createFramebufferObject(); |
| 169 | } | 169 | } |
| 170 | return _secondaryFramebufferObject; | 170 | return _secondaryFramebufferObject; |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | QOpenGLFramebufferObject* TextureCache::getTertiaryFramebufferObject() { | 173 | QOpenGLFramebufferObject* TextureCache::getTertiaryFramebufferObject() { |
| 174 | if (_tertiaryFramebufferObject == NULL) { | 174 | if (!_tertiaryFramebufferObject) { |
| 175 | _tertiaryFramebufferObject = createFramebufferObject(); | 175 | _tertiaryFramebufferObject = createFramebufferObject(); |
| 176 | } | 176 | } |
| 177 | return _tertiaryFramebufferObject; | 177 | return _tertiaryFramebufferObject; |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | QOpenGLFramebufferObject* TextureCache::getShadowFramebufferObject() { | 180 | QOpenGLFramebufferObject* TextureCache::getShadowFramebufferObject() { |
| 181 | if (_shadowFramebufferObject == NULL) { | 181 | if (!_shadowFramebufferObject) { |
| 182 | const int SHADOW_MAP_SIZE = 2048; | 182 | const int SHADOW_MAP_SIZE = 2048; |
| 183 | _shadowFramebufferObject = new QOpenGLFramebufferObject(SHADOW_MAP_SIZE, SHADOW_MAP_SIZE, | 183 | _shadowFramebufferObject = new QOpenGLFramebufferObject(SHADOW_MAP_SIZE, SHADOW_MAP_SIZE, |
| 184 | QOpenGLFramebufferObject::NoAttachment, GL_TEXTURE_2D, GL_RGB); | 184 | QOpenGLFramebufferObject::NoAttachment, GL_TEXTURE_2D, GL_RGB); |
| @@ -212,16 +212,16 @@ GLuint TextureCache::getShadowDepthTextureID() { · 27 unmodified lines | |||
| 212 | bool TextureCache::eventFilter(QObject* watched, QEvent* event) { | 212 | bool TextureCache::eventFilter(QObject* watched, QEvent* event) { |
| 213 | if (event->type() == QEvent::Resize) { | 213 | if (event->type() == QEvent::Resize) { |
| 214 | QSize size = static_cast<QResizeEvent*>(event)->size(); | 214 | QSize size = static_cast<QResizeEvent*>(event)->size(); |
| 215 | if (_primaryFramebufferObject != NULL && _primaryFramebufferObject->size() != size) { | 215 | if (_primaryFramebufferObject && _primaryFramebufferObject->size() != size) { |
| 216 | delete _primaryFramebufferObject; | 216 | delete _primaryFramebufferObject; |
| 217 | _primaryFramebufferObject = NULL; | 217 | _primaryFramebufferObject = NULL; |
| 218 | glDeleteTextures(1, &_primaryDepthTextureID); | 218 | glDeleteTextures(1, &_primaryDepthTextureID); |
| 219 | } | 219 | } |
| 220 | if (_secondaryFramebufferObject != NULL && _secondaryFramebufferObject->size() != size) { | 220 | if (_secondaryFramebufferObject && _secondaryFramebufferObject->size() != size) { |
| 221 | delete _secondaryFramebufferObject; | 221 | delete _secondaryFramebufferObject; |
| 222 | _secondaryFramebufferObject = NULL; | 222 | _secondaryFramebufferObject = NULL; |
| 223 | } | 223 | } |
| 224 | if (_tertiaryFramebufferObject != NULL && _tertiaryFramebufferObject->size() != size) { | 224 | if (_tertiaryFramebufferObject && _tertiaryFramebufferObject->size() != size) { |
| 225 | delete _tertiaryFramebufferObject; | 225 | delete _tertiaryFramebufferObject; |
| 226 | _tertiaryFramebufferObject = NULL; | 226 | _tertiaryFramebufferObject = NULL; |
| 227 | } | 227 | } |