| 2471 | } |
| 2472 | |
| 2473 | bool 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 | |
| 2514 | void PruneJoints(NxActorWrapper *actor) |
| 2515 | { |
no test coverage detected