History

remove some unecessary null pointer checks

Stephen Birarda committed 12 years ago

Commit 60eb5881 parent a2a90aa23 files · +49 −49Browse files

Showing the changes to interface/src/renderer/TextureCache.cpp (1 of 23 files). Show all

Unified · Split

interface/src/renderer/TextureCache.cpp+10−10
@@ -40,14 +40,14 @@ TextureCache::~TextureCache() { · 39 unmodified lines
4040 foreach (GLuint id, _fileTextureIDs) {
4141 glDeleteTextures(1, &id);
4242 }
43− if (_primaryFramebufferObject != NULL) {
43+ if (_primaryFramebufferObject) {
4444 delete _primaryFramebufferObject;
4545 glDeleteTextures(1, &_primaryDepthTextureID);
4646 }
47− if (_secondaryFramebufferObject != NULL) {
47+ if (_secondaryFramebufferObject) {
4848 delete _secondaryFramebufferObject;
4949 }
50− if (_tertiaryFramebufferObject != NULL) {
50+ if (_tertiaryFramebufferObject) {
5151 delete _tertiaryFramebufferObject;
5252 }
5353 }
@@ -138,7 +138,7 @@ QSharedPointer<NetworkTexture> TextureCache::getTexture(const QUrl& url, bool no · 84 unmodified lines
138138 }
139139
140140 QOpenGLFramebufferObject* TextureCache::getPrimaryFramebufferObject() {
141− if (_primaryFramebufferObject == NULL) {
141+ if (!_primaryFramebufferObject) {
142142 _primaryFramebufferObject = createFramebufferObject();
143143
144144 glGenTextures(1, &_primaryDepthTextureID);
@@ -164,21 +164,21 @@ GLuint TextureCache::getPrimaryDepthTextureID() { · 19 unmodified lines
164164 }
165165
166166 QOpenGLFramebufferObject* TextureCache::getSecondaryFramebufferObject() {
167− if (_secondaryFramebufferObject == NULL) {
167+ if (!_secondaryFramebufferObject) {
168168 _secondaryFramebufferObject = createFramebufferObject();
169169 }
170170 return _secondaryFramebufferObject;
171171 }
172172
173173 QOpenGLFramebufferObject* TextureCache::getTertiaryFramebufferObject() {
174− if (_tertiaryFramebufferObject == NULL) {
174+ if (!_tertiaryFramebufferObject) {
175175 _tertiaryFramebufferObject = createFramebufferObject();
176176 }
177177 return _tertiaryFramebufferObject;
178178 }
179179
180180 QOpenGLFramebufferObject* TextureCache::getShadowFramebufferObject() {
181− if (_shadowFramebufferObject == NULL) {
181+ if (!_shadowFramebufferObject) {
182182 const int SHADOW_MAP_SIZE = 2048;
183183 _shadowFramebufferObject = new QOpenGLFramebufferObject(SHADOW_MAP_SIZE, SHADOW_MAP_SIZE,
184184 QOpenGLFramebufferObject::NoAttachment, GL_TEXTURE_2D, GL_RGB);
@@ -212,16 +212,16 @@ GLuint TextureCache::getShadowDepthTextureID() { · 27 unmodified lines
212212 bool TextureCache::eventFilter(QObject* watched, QEvent* event) {
213213 if (event->type() == QEvent::Resize) {
214214 QSize size = static_cast<QResizeEvent*>(event)->size();
215− if (_primaryFramebufferObject != NULL && _primaryFramebufferObject->size() != size) {
215+ if (_primaryFramebufferObject && _primaryFramebufferObject->size() != size) {
216216 delete _primaryFramebufferObject;
217217 _primaryFramebufferObject = NULL;
218218 glDeleteTextures(1, &_primaryDepthTextureID);
219219 }
220− if (_secondaryFramebufferObject != NULL && _secondaryFramebufferObject->size() != size) {
220+ if (_secondaryFramebufferObject && _secondaryFramebufferObject->size() != size) {
221221 delete _secondaryFramebufferObject;
222222 _secondaryFramebufferObject = NULL;
223223 }
224− if (_tertiaryFramebufferObject != NULL && _tertiaryFramebufferObject->size() != size) {
224+ if (_tertiaryFramebufferObject && _tertiaryFramebufferObject->size() != size) {
225225 delete _tertiaryFramebufferObject;
226226 _tertiaryFramebufferObject = NULL;
227227 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t