* A connection may not be finalized. This means, the connection should exist, * but the controller does not yet exist. This happens when loading. Even * loading connections last won't help, since there can be connections BETWEEN * controllers. So, we remember the controller-ID and use a dummyController * instead. Once the song is loaded, finalizeConnections() connects to the proper control
| 152 | * instead. Once the song is loaded, finalizeConnections() connects to the proper controllers |
| 153 | */ |
| 154 | void ControllerConnection::finalizeConnections() |
| 155 | { |
| 156 | for( int i = 0; i < s_connections.size(); ++i ) |
| 157 | { |
| 158 | ControllerConnection * c = s_connections[i]; |
| 159 | if ( !c->isFinalized() && c->m_controllerId < |
| 160 | Engine::getSong()->controllers().size() ) |
| 161 | { |
| 162 | c->setController( Engine::getSong()-> |
| 163 | controllers().at( c->m_controllerId ) ); |
| 164 | } |
| 165 | else if (c->getController()->type() == Controller::DummyController) |
| 166 | { |
| 167 | delete c; |
| 168 | --i; |
| 169 | } |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | |
| 174 |
nothing calls this directly
no test coverage detected