MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / undo

Method undo

Engine/source/gui/worldEditor/terrainEditor.cpp:1651–1678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1649}
1650
1651void TerrainEditor::TerrainEditorUndoAction::undo()
1652{
1653 // NOTE: This function also handles TerrainEditorUndoAction::redo().
1654
1655 bool materialChanged = false;
1656
1657 for (U32 i = 0; i < mSel->size(); i++)
1658 {
1659 // Grab the current grid info for this point.
1660 GridInfo info;
1661 mTerrainEditor->getGridInfo( (*mSel)[i].mGridPoint, info );
1662 info.mMaterialChanged = (*mSel)[i].mMaterialChanged;
1663
1664 materialChanged |= info.mMaterialChanged;
1665
1666 // Restore the previous grid info.
1667 mTerrainEditor->setGridInfo( (*mSel)[i] );
1668
1669 // Save the old grid info so we can
1670 // restore it later.
1671 (*mSel)[i] = info;
1672 }
1673
1674 // Mark the editor as dirty!
1675 mTerrainEditor->setDirty();
1676 mTerrainEditor->gridUpdateComplete( materialChanged );
1677 mTerrainEditor->mMouseBrush->update();
1678}
1679
1680void TerrainEditor::submitMaterialUndo( String actionName )
1681{

Callers

nothing calls this directly

Calls 10

getGridInfoMethod · 0.80
setGridInfoMethod · 0.80
gridUpdateCompleteMethod · 0.80
setMaterialsMethod · 0.80
setLayerMapMethod · 0.80
onMaterialUndoMethod · 0.80
sizeMethod · 0.45
setDirtyMethod · 0.45
updateMethod · 0.45
getMaterialsMethod · 0.45

Tested by

no test coverage detected