| 266 | } |
| 267 | |
| 268 | void GFXGLTextureObject::reloadFromCache() |
| 269 | { |
| 270 | if(!mZombieCache) |
| 271 | return; |
| 272 | |
| 273 | if(mBinding == GL_TEXTURE_3D) |
| 274 | { |
| 275 | static_cast<GFXGLTextureManager*>(TEXMGR)->_loadTexture(this, mZombieCache); |
| 276 | delete[] mZombieCache; |
| 277 | mZombieCache = NULL; |
| 278 | return; |
| 279 | } |
| 280 | |
| 281 | PRESERVE_TEXTURE(mBinding); |
| 282 | glBindTexture(mBinding, mHandle); |
| 283 | |
| 284 | if(mBinding == GL_TEXTURE_2D) |
| 285 | glTexSubImage2D(mBinding, 0, 0, 0, mTextureSize.x, mTextureSize.y, GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], mZombieCache); |
| 286 | else if(mBinding == GL_TEXTURE_1D) |
| 287 | glTexSubImage1D(mBinding, 0, 0, (mTextureSize.x > 1 ? mTextureSize.x : mTextureSize.y), GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], mZombieCache); |
| 288 | |
| 289 | if(mMipLevels != 1) |
| 290 | glGenerateMipmap(mBinding); |
| 291 | |
| 292 | delete[] mZombieCache; |
| 293 | mZombieCache = NULL; |
| 294 | mIsZombie = false; |
| 295 | } |
| 296 | |
| 297 | void GFXGLTextureObject::zombify() |
| 298 | { |
no test coverage detected