| 103 | } |
| 104 | |
| 105 | void MapPosition::store(const cmd::ArgumentList& args) |
| 106 | { |
| 107 | auto mapRoot = GlobalMapModule().getRoot(); |
| 108 | |
| 109 | if (!mapRoot) |
| 110 | { |
| 111 | rError() << "Cannot store map position, no map loaded." << std::endl; |
| 112 | return; |
| 113 | } |
| 114 | |
| 115 | rMessage() << "Storing map position #" << _index << std::endl; |
| 116 | |
| 117 | try |
| 118 | { |
| 119 | auto& cameraView = GlobalCameraManager().getActiveView(); |
| 120 | |
| 121 | _position = cameraView.getCameraOrigin(); |
| 122 | _angle = cameraView.getCameraAngles(); |
| 123 | |
| 124 | saveTo(mapRoot); |
| 125 | |
| 126 | // Tag the map as modified |
| 127 | GlobalMap().setModified(true); |
| 128 | } |
| 129 | catch (const std::runtime_error& ex) |
| 130 | { |
| 131 | rError() << "Exception saving camera position: " << ex.what() << std::endl; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | void MapPosition::recall(const cmd::ArgumentList& args) |
| 136 | { |
nothing calls this directly
no test coverage detected