| 1785 | */ |
| 1786 | |
| 1787 | void GeoscapeState::globeClick(Action *action) |
| 1788 | { |
| 1789 | int mouseX = (int)floor(action->getAbsoluteXMouse()), mouseY = (int)floor(action->getAbsoluteYMouse()); |
| 1790 | |
| 1791 | // Clicking markers on the globe |
| 1792 | if (action->getDetails()->button.button == SDL_BUTTON_LEFT) |
| 1793 | { |
| 1794 | std::vector<Target*> v = _globe->getTargets(mouseX, mouseY, false); |
| 1795 | if (!v.empty()) |
| 1796 | { |
| 1797 | _game->pushState(new MultipleTargetsState(_game, v, 0, this)); |
| 1798 | } |
| 1799 | } |
| 1800 | |
| 1801 | if (_game->getSavedGame()->getDebugMode()) |
| 1802 | { |
| 1803 | double lon, lat; |
| 1804 | _globe->cartToPolar(mouseX, mouseY, &lon, &lat); |
| 1805 | double lonDeg = lon / M_PI * 180, latDeg = lat / M_PI * 180; |
| 1806 | std::wostringstream ss; |
| 1807 | ss << "rad: " << lon << " , " << lat << std::endl; |
| 1808 | ss << "deg: " << lonDeg << " , " << latDeg << std::endl; |
| 1809 | _txtDebug->setText(ss.str()); |
| 1810 | } |
| 1811 | } |
| 1812 | |
| 1813 | /** |
| 1814 | * Opens the Intercept window. |
nothing calls this directly
no test coverage detected