MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / reloadFromCache

Method reloadFromCache

Engine/source/gfx/gl/gfxGLTextureObject.cpp:268–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268void 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
297void GFXGLTextureObject::zombify()
298{

Callers 1

_refreshTextureMethod · 0.80

Calls 1

_loadTextureMethod · 0.45

Tested by

no test coverage detected