Add OpenMW 0.47 commits up to 23 Sep 2021
commit
a01c874613
@ -1,19 +1,44 @@
|
|||||||
#include "commands.hpp"
|
#include "commands.hpp"
|
||||||
|
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
|
#include <components/debug/debuglog.hpp>
|
||||||
#include <components/esm/loadland.hpp>
|
#include <components/esm/loadland.hpp>
|
||||||
|
|
||||||
|
#include "editmode.hpp"
|
||||||
#include "terrainselection.hpp"
|
#include "terrainselection.hpp"
|
||||||
|
#include "terrainshapemode.hpp"
|
||||||
|
#include "terraintexturemode.hpp"
|
||||||
|
#include "worldspacewidget.hpp"
|
||||||
|
|
||||||
CSVRender::DrawTerrainSelectionCommand::DrawTerrainSelectionCommand(TerrainSelection& terrainSelection, QUndoCommand* parent)
|
CSVRender::DrawTerrainSelectionCommand::DrawTerrainSelectionCommand(WorldspaceWidget* worldspaceWidget, QUndoCommand* parent)
|
||||||
: mTerrainSelection(terrainSelection)
|
: mWorldspaceWidget(worldspaceWidget)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
void CSVRender::DrawTerrainSelectionCommand::redo()
|
void CSVRender::DrawTerrainSelectionCommand::redo()
|
||||||
{
|
{
|
||||||
mTerrainSelection.update();
|
tryUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVRender::DrawTerrainSelectionCommand::undo()
|
void CSVRender::DrawTerrainSelectionCommand::undo()
|
||||||
{
|
{
|
||||||
mTerrainSelection.update();
|
tryUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSVRender::DrawTerrainSelectionCommand::tryUpdate()
|
||||||
|
{
|
||||||
|
if (!mWorldspaceWidget)
|
||||||
|
{
|
||||||
|
Log(Debug::Verbose) << "Can't update terrain selection, no WorldspaceWidget found!";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto terrainMode = dynamic_cast<CSVRender::TerrainShapeMode*>(mWorldspaceWidget->getEditMode());
|
||||||
|
if (!terrainMode)
|
||||||
|
{
|
||||||
|
Log(Debug::Verbose) << "Can't update terrain selection in current EditMode";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
terrainMode->getTerrainSelection()->update();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue