summaryrefslogtreecommitdiff
path: root/src/game/GameController.cpp
diff options
context:
space:
mode:
authorSimon 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)
commite9770d8ee7a44d5680c23749c786a03c0d5b41ff (patch)
treeb63b4bb60ab0262724a01cb5bc21b116b035748f /src/game/GameController.cpp
parent63af6abd29a161f6d1aa257aeb76f6891f512f74 (diff)
downloadpowder-e9770d8ee7a44d5680c23749c786a03c0d5b41ff.zip
powder-e9770d8ee7a44d5680c23749c786a03c0d5b41ff.tar.gz
Clipboard and Stamp from selection (no way to paste/place yet)
Diffstat (limited to 'src/game/GameController.cpp')
-rw-r--r--src/game/GameController.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index 80f45ff..a4a99c2 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -241,6 +241,25 @@ void GameController::DrawPoints(int toolSelection, queue<ui::Point*> & pointQueu
}
}
+void GameController::StampRegion(ui::Point point1, ui::Point point2)
+{
+ int saveSize;
+ unsigned char * saveData;
+ saveData = gameModel->GetSimulation()->Save(point1.X, point1.Y, point2.X, point2.Y, saveSize);
+ if(saveData && saveSize)
+ gameModel->AddStamp(saveData, saveSize);
+}
+
+void GameController::CopyRegion(ui::Point point1, ui::Point point2)
+{
+ int saveSize;
+ unsigned char * saveData;
+ saveData = gameModel->GetSimulation()->Save(point1.X, point1.Y, point2.X, point2.Y, saveSize);
+
+ if(saveData && saveSize)
+ gameModel->SetClipboard(saveData, saveSize);
+}
+
void GameController::Update()
{
gameModel->GetSimulation()->update_particles();