MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / store

Method store

radiantcore/map/MapPosition.cpp:105–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void 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
135void MapPosition::recall(const cmd::ArgumentList& args)
136{

Callers

nothing calls this directly

Calls 6

rErrorFunction · 0.85
rMessageFunction · 0.85
getActiveViewMethod · 0.80
setModifiedMethod · 0.80
whatMethod · 0.80
getRootMethod · 0.45

Tested by

no test coverage detected