* Starts a new dogfight. */
| 2071 | * Starts a new dogfight. |
| 2072 | */ |
| 2073 | void GeoscapeState::startDogfight() |
| 2074 | { |
| 2075 | if (_globe->getZoom() < 3) |
| 2076 | { |
| 2077 | if (!_zoomInEffectTimer->isRunning()) |
| 2078 | { |
| 2079 | _globe->saveZoomDogfight(); |
| 2080 | _globe->rotateStop(); |
| 2081 | _zoomInEffectTimer->start(); |
| 2082 | } |
| 2083 | } |
| 2084 | else |
| 2085 | { |
| 2086 | _dogfightStartTimer->stop(); |
| 2087 | _zoomInEffectTimer->stop(); |
| 2088 | timerReset(); |
| 2089 | while(!_dogfightsToBeStarted.empty()) |
| 2090 | { |
| 2091 | _dogfights.push_back(_dogfightsToBeStarted.back()); |
| 2092 | _dogfightsToBeStarted.pop_back(); |
| 2093 | _dogfights.back()->setInterceptionNumber(getFirstFreeDogfightSlot()); |
| 2094 | _dogfights.back()->setInterceptionsCount(_dogfights.size() + _dogfightsToBeStarted.size()); |
| 2095 | } |
| 2096 | // Set correct number of interceptions for every dogfight. |
| 2097 | for(std::list<DogfightState*>::iterator d = _dogfights.begin(); d != _dogfights.end(); ++d) |
| 2098 | { |
| 2099 | (*d)->setInterceptionsCount(_dogfights.size()); |
| 2100 | } |
| 2101 | } |
| 2102 | } |
| 2103 | |
| 2104 | /** |
| 2105 | * Returns the first free dogfight slot. |
nothing calls this directly
no test coverage detected