Runtime switching of shadow systems. Requires correct world to be pushed at console.
| 55 | |
| 56 | // Runtime switching of shadow systems. Requires correct world to be pushed at console. |
| 57 | DefineEngineFunction( setShadowManager, bool, (const char* sShadowSystemName), (""), "string sShadowSystemName") |
| 58 | { |
| 59 | /* |
| 60 | // Make sure this new one exists |
| 61 | ShadowManager * newSM = dynamic_cast<ShadowManager*>(ConsoleObject::create(argv[1])); |
| 62 | if (!newSM) |
| 63 | return false; |
| 64 | |
| 65 | // Cleanup current |
| 66 | ShadowManager * currentSM = world->findWorldManager<ShadowManager>(); |
| 67 | if (currentSM) |
| 68 | { |
| 69 | currentSM->deactivate(); |
| 70 | world->removeWorldManager(currentSM); |
| 71 | delete currentSM; |
| 72 | } |
| 73 | |
| 74 | // Add to world and init. |
| 75 | world->addWorldManager(newSM); |
| 76 | newSM->activate(); |
| 77 | MaterialManager::get()->reInitInstances(); |
| 78 | */ |
| 79 | return true; |
| 80 | } |