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

Method reloadFromCache

Engine/source/gfx/gl/gfxGLTextureObject.cpp:285–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285void 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
314void GFXGLTextureObject::zombify()
315{

Callers 1

_refreshTextureMethod · 0.80

Calls 1

_loadTextureMethod · 0.45

Tested by

no test coverage detected