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

Method importState

radiantcore/patch/Patch.cpp:390–415  ·  view source on GitHub ↗

Revert the state of this patch to the one that has been saved in the UndoMemento

Source from the content-addressed store, hash-verified

388
389// Revert the state of this patch to the one that has been saved in the UndoMemento
390void Patch::importState(const IUndoMementoPtr& state)
391{
392 undoSave();
393
394 const SavedState& other = *(std::static_pointer_cast<SavedState>(state));
395
396 // begin duplicate of SavedState copy constructor, needs refactoring
397
398 // copy construct
399 {
400 _width = other.m_width;
401 _height = other.m_height;
402 _ctrl = other.m_ctrl;
403 _ctrlTransformed = _ctrl;
404 _node.updateSelectableControls();
405 _patchDef3 = other.m_patchDef3;
406 _subDivisions = Subdivisions(other.m_subdivisions_x, other.m_subdivisions_y);
407 _shader.setMaterialName(other._materialName);
408 }
409
410 // end duplicate code
411
412 // Notify that this patch has changed
413 textureChanged();
414 controlPointsChanged();
415}
416
417void Patch::check_shader()
418{

Callers

nothing calls this directly

Calls 2

setMaterialNameMethod · 0.45

Tested by

no test coverage detected