Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
#5338: Map::focusViews should now work in UI-less mode.
  • Loading branch information
codereader committed Sep 27, 2020
1 parent 6c6ed61 commit 65179d4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion radiantcore/map/Map.cpp
Expand Up @@ -245,7 +245,12 @@ void Map::focusViews(const Vector3& point, const Vector3& angles)
{
// Set the camera and the views to the given point
GlobalCameraManager().focusAllCameras(point, angles);
GlobalXYWndManager().setOrigin(point);

// ortho views might not be present in headless mode
if (module::GlobalModuleRegistry().moduleExists(MODULE_ORTHOVIEWMANAGER))
{
GlobalXYWndManager().setOrigin(point);
}
}

scene::INodePtr Map::findWorldspawn()
Expand Down
5 changes: 4 additions & 1 deletion radiantcore/map/PointFile.cpp
Expand Up @@ -133,7 +133,10 @@ void PointFile::advance(bool forward)

cam.setCameraOrigin(_points[_curPos].vertex);

GlobalXYWndManager().setOrigin(_points[_curPos].vertex);
if (module::GlobalModuleRegistry().moduleExists(MODULE_ORTHOVIEWMANAGER))
{
GlobalXYWndManager().setOrigin(_points[_curPos].vertex);
}

{
Vector3 dir((_points[_curPos + 1].vertex - cam.getCameraOrigin()).getNormalised());
Expand Down
5 changes: 5 additions & 0 deletions radiantcore/map/RegionManager.cpp
Expand Up @@ -267,6 +267,11 @@ void RegionManager::setRegionXY(const cmd::ArgumentList& args)
{
try
{
if (!module::GlobalModuleRegistry().moduleExists(MODULE_ORTHOVIEWMANAGER))
{
throw std::runtime_error("No ortho view module loaded.");
}

// Obtain the current XY orthoview, if there is one
auto& xyWnd = GlobalXYWndManager().getViewByType(XY);
const auto& origin = xyWnd.getOrigin();
Expand Down

0 comments on commit 65179d4

Please sign in to comment.