diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-03-28 21:01:44 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-03-28 21:01:44 (GMT) |
| commit | e9770d8ee7a44d5680c23749c786a03c0d5b41ff (patch) | |
| tree | b63b4bb60ab0262724a01cb5bc21b116b035748f /src/game/GameModel.cpp | |
| parent | 63af6abd29a161f6d1aa257aeb76f6891f512f74 (diff) | |
| download | powder-e9770d8ee7a44d5680c23749c786a03c0d5b41ff.zip powder-e9770d8ee7a44d5680c23749c786a03c0d5b41ff.tar.gz | |
Clipboard and Stamp from selection (no way to paste/place yet)
Diffstat (limited to 'src/game/GameModel.cpp')
| -rw-r--r-- | src/game/GameModel.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp index bcc52c7..85f4249 100644 --- a/src/game/GameModel.cpp +++ b/src/game/GameModel.cpp @@ -16,7 +16,8 @@ GameModel::GameModel(): currentBrush(0), currentUser(0, ""), currentSave(NULL), - colourSelector(false) + colourSelector(false), + clipboardData(NULL) { sim = new Simulation(); ren = new Renderer(ui::Engine::Ref().g, sim); @@ -405,6 +406,27 @@ void GameModel::ClearSimulation() sim->clear_sim(); } +void GameModel::AddStamp(unsigned char * saveData, int saveSize) +{ + //Do nothing + + //die alone +} + +void GameModel::SetClipboard(unsigned char * saveData, int saveSize) +{ + if(clipboardData) + free(clipboardData); + clipboardData = saveData; + clipboardSize = saveSize; +} + +unsigned char * GameModel::GetClipboard(int & saveSize) +{ + saveSize = clipboardSize; + return clipboardData; +} + void GameModel::notifyColourSelectorColourChanged() { for(int i = 0; i < observers.size(); i++) @@ -508,3 +530,11 @@ void GameModel::notifyZoomChanged() observers[i]->NotifyZoomChanged(this); } } + +void GameModel::notifyClipboardChanged() +{ + for(int i = 0; i < observers.size(); i++) + { + observers[i]->NotifyClipboardChanged(this); + } +} |
