forked from TES3MP/TES3MP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OpenMW 0.47 commits up to 23 Sep 2021
- Loading branch information
Showing
12 changed files
with
81 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,44 @@ | ||
#include "commands.hpp" | ||
|
||
#include <QPointer> | ||
|
||
#include <components/debug/debuglog.hpp> | ||
#include <components/esm/loadland.hpp> | ||
|
||
#include "editmode.hpp" | ||
#include "terrainselection.hpp" | ||
#include "terrainshapemode.hpp" | ||
#include "terraintexturemode.hpp" | ||
#include "worldspacewidget.hpp" | ||
|
||
CSVRender::DrawTerrainSelectionCommand::DrawTerrainSelectionCommand(TerrainSelection& terrainSelection, QUndoCommand* parent) | ||
: mTerrainSelection(terrainSelection) | ||
CSVRender::DrawTerrainSelectionCommand::DrawTerrainSelectionCommand(WorldspaceWidget* worldspaceWidget, QUndoCommand* parent) | ||
: mWorldspaceWidget(worldspaceWidget) | ||
{ } | ||
|
||
void CSVRender::DrawTerrainSelectionCommand::redo() | ||
{ | ||
mTerrainSelection.update(); | ||
tryUpdate(); | ||
} | ||
|
||
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters