MCPcopy Create free account
hub / github.com/bumptop/BumpTop / LoadSceneFromFile

Function LoadSceneFromFile

trunk/win/Source/BT_Util.cpp:2473–2512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2471}
2472
2473bool LoadSceneFromFile()
2474{
2475 // try and load the old scene files
2476 QFileInfo file = scnManager->getSceneBumpBackupFile();
2477 QFileInfo backup = scnManager->getSceneBumpFile();
2478
2479 bool oldSceneFileLoaded =
2480 LegacyPersistenceManager::getInstance()->loadScene(native(file)) ||
2481 LegacyPersistenceManager::getInstance()->loadScene(native(backup));
2482
2483 // if an old scene file was loaded, then we need to save the new format,
2484 // then delete the old files
2485 if (oldSceneFileLoaded)
2486 {
2487 // save the current scene file
2488 SaveSceneToFile();
2489
2490 // rename the old scene files
2491 if (exists(native(file)))
2492 {
2493 QFileInfo legacyFilePath = make_file(parent(file), "scene.legacy.bump");
2494 QFile::rename(native(file), native(legacyFilePath));
2495 }
2496 if (exists(native(backup)))
2497 {
2498 QFileInfo legacyBackupPath = make_file(parent(backup), "scene.legacy.bump.bak");
2499 QFile::rename(native(backup), native(legacyBackupPath));
2500 }
2501
2502 return true;
2503 }
2504 else
2505 {
2506 // otherwise, just load the new scene file
2507 QFileInfo pbFile = scnManager->getScenePbBumpFile();
2508 QFileInfo pbBackup = scnManager->getBackupScenePbBumpFile();
2509 return PbPersistenceManager::getInstance()->loadScene(native(pbFile)) ||
2510 PbPersistenceManager::getInstance()->loadScene(native(pbBackup));
2511 }
2512}
2513
2514void PruneJoints(NxActorWrapper *actor)
2515{

Callers 3

InitNxFunction · 0.85
Key_ReloadSceneFunction · 0.85
SwitchToLibraryFunction · 0.85

Calls 9

SaveSceneToFileFunction · 0.85
make_fileFunction · 0.85
getSceneBumpFileMethod · 0.80
nativeFunction · 0.70
existsFunction · 0.70
parentFunction · 0.70
renameFunction · 0.50
loadSceneMethod · 0.45

Tested by

no test coverage detected