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

Method _onFileChanged

Engine/source/gfx/gfxTextureManager.cpp:1148–1174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1146}
1147
1148void GFXTextureManager::_onFileChanged( const Torque::Path &path )
1149{
1150 String pathNoExt = Torque::Path::Join( path.getRoot(), ':', path.getPath() );
1151 pathNoExt = Torque::Path::Join( pathNoExt, '/', path.getFileName() );
1152
1153 // See if we've got it loaded.
1154 GFXTextureObject *obj = hashFind( pathNoExt );
1155 if ( !obj || path != obj->getPath() )
1156 return;
1157
1158 Con::errorf( "[GFXTextureManager::_onFileChanged] : File changed [%s]", path.getFullPath().c_str() );
1159
1160 const U32 scalePower = getTextureDownscalePower( obj->mProfile );
1161
1162 if ( sDDSExt.equal( path.getExtension(), String::NoCase) )
1163 {
1164 Resource<DDSFile> dds = DDSFile::load( path, scalePower );
1165 if ( dds )
1166 _createTexture( dds, obj->mProfile, false, obj );
1167 }
1168 else
1169 {
1170 Resource<GBitmap> bmp = GBitmap::load( path );
1171 if( bmp )
1172 _createTexture( bmp, obj->mTextureLookupName, obj->mProfile, false, obj );
1173 }
1174}
1175
1176void GFXTextureManager::reloadTextures()
1177{

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected