| 283 | } |
| 284 | |
| 285 | void GFXGLTextureObject::reloadFromCache() |
| 286 | { |
| 287 | if(!mZombieCache) |
| 288 | return; |
| 289 | |
| 290 | if(mBinding == GL_TEXTURE_3D) |
| 291 | { |
| 292 | static_cast<GFXGLTextureManager*>(TEXMGR)->_loadTexture(this, mZombieCache); |
| 293 | delete[] mZombieCache; |
| 294 | mZombieCache = NULL; |
| 295 | return; |
| 296 | } |
| 297 | |
| 298 | PRESERVE_TEXTURE(mBinding); |
| 299 | glBindTexture(mBinding, mHandle); |
| 300 | |
| 301 | if(mBinding == GL_TEXTURE_2D) |
| 302 | glTexSubImage2D(mBinding, 0, 0, 0, mTextureSize.x, mTextureSize.y, GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], mZombieCache); |
| 303 | else if(mBinding == GL_TEXTURE_1D) |
| 304 | glTexSubImage1D(mBinding, 0, 0, (mTextureSize.x > 1 ? mTextureSize.x : mTextureSize.y), GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], mZombieCache); |
| 305 | |
| 306 | if(mMipLevels != 1) |
| 307 | glGenerateMipmap(mBinding); |
| 308 | |
| 309 | delete[] mZombieCache; |
| 310 | mZombieCache = NULL; |
| 311 | mIsZombie = false; |
| 312 | } |
| 313 | |
| 314 | void GFXGLTextureObject::zombify() |
| 315 | { |
no test coverage detected