| 59 | } |
| 60 | |
| 61 | void ForestCreateUndoAction::redo() |
| 62 | { |
| 63 | for ( U32 i = 0; i < mItems.size(); i++ ) |
| 64 | { |
| 65 | const ForestItem &item = mItems[i]; |
| 66 | |
| 67 | // Not 64bit safe! |
| 68 | // We store the datablock ID rather than the actual pointer |
| 69 | // since the pointer could go bad. |
| 70 | ForestItemData *data; |
| 71 | if ( !Sim::findObject( (SimObjectId)(uintptr_t)(item.getData()), data ) ) |
| 72 | { |
| 73 | Con::errorf( "ForestCreateUndoAction::redo() - ForestItemData for item to restore does not seem to exist. Undo stack may be hosed." ); |
| 74 | continue; |
| 75 | } |
| 76 | |
| 77 | mData->addItem( item.getKey(), |
| 78 | data, |
| 79 | item.getTransform(), |
| 80 | item.getScale() ); |
| 81 | } |
| 82 | |
| 83 | mEditor->onUndoAction(); |
| 84 | } |
| 85 | |
| 86 | void ForestCreateUndoAction::undo() |
| 87 | { |
nothing calls this directly
no test coverage detected