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

Method _onFileChanged

Engine/source/gfx/gfxTextureManager.cpp:1547–1573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1545}
1546
1547void GFXTextureManager::_onFileChanged( const Torque::Path &path )
1548{
1549 String pathNoExt = Torque::Path::Join( path.getRoot(), ':', path.getPath() );
1550 pathNoExt = Torque::Path::Join( pathNoExt, '/', path.getFileName() );
1551
1552 // See if we've got it loaded.
1553 GFXTextureObject *obj = hashFind( pathNoExt );
1554 if ( !obj || path != obj->getPath() )
1555 return;
1556
1557 Con::errorf( "[GFXTextureManager::_onFileChanged] : File changed [%s]", path.getFullPath().c_str() );
1558
1559 const U32 scalePower = getTextureDownscalePower( obj->mProfile );
1560
1561 if ( sDDSExt.equal( path.getExtension(), String::NoCase) )
1562 {
1563 Resource<DDSFile> dds = DDSFile::load( path, scalePower );
1564 if ( dds )
1565 _createTexture( dds, obj->mProfile, false, obj );
1566 }
1567 else
1568 {
1569 Resource<GBitmap> bmp = GBitmap::load( path );
1570 if( bmp )
1571 _createTexture( bmp, obj->mTextureLookupName, obj->mProfile, false, obj );
1572 }
1573}
1574
1575void GFXTextureManager::reloadTextures()
1576{

Callers

nothing calls this directly

Calls 8

loadFunction · 0.85
getFileNameMethod · 0.80
errorfFunction · 0.50
getRootMethod · 0.45
getPathMethod · 0.45
c_strMethod · 0.45
equalMethod · 0.45
getExtensionMethod · 0.45

Tested by

no test coverage detected