----------------------------------------------------------------------------- kill - this function clears out the data in texture object. It's done like this because the texture object needs to release its pointers to textures before the GFXDevice is shut down. The texture objects themselves get deleted by the refcount structure - which may be after the GFXDevice has been destroyed. ------------
| 155 | // been destroyed. |
| 156 | //----------------------------------------------------------------------------- |
| 157 | void GFXTextureObject::kill() |
| 158 | { |
| 159 | if( mDead ) |
| 160 | return; |
| 161 | |
| 162 | #ifdef TORQUE_DEBUG |
| 163 | // This makes sure that nobody is forgetting to call kill from the derived |
| 164 | // destructor. If they are, then we should get a pure virtual function |
| 165 | // call here. |
| 166 | pureVirtualCrash(); |
| 167 | #endif |
| 168 | |
| 169 | // If we're a dummy, don't do anything... |
| 170 | if( !mDevice || !mDevice->mTextureManager ) |
| 171 | { |
| 172 | mDead = true; |
| 173 | return; |
| 174 | } |
| 175 | |
| 176 | // Remove ourselves from the texture list and hash |
| 177 | mDevice->mTextureManager->deleteTexture(this); |
| 178 | |
| 179 | // Delete the stored bitmap. |
| 180 | SAFE_DELETE(mBitmap) |
| 181 | SAFE_DELETE(mDDS); |
| 182 | |
| 183 | // Clean up linked list |
| 184 | if(mNext) |
| 185 | mNext->mPrev = mPrev; |
| 186 | if(mPrev) |
| 187 | mPrev->mNext = mNext; |
| 188 | |
| 189 | mDead = true; |
| 190 | } |
| 191 | |
| 192 | const String GFXTextureObject::describeSelf() const |
| 193 | { |
no test coverage detected