summaryrefslogtreecommitdiff
path: root/src/game/GameController.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-07-25 18:32:36 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-07-25 18:32:36 (GMT)
commitf8766201a688598633e41166225d5e77275a2d5a (patch)
treee90eaf8bf33373596fc39d1eee08fe8ee708be5e /src/game/GameController.cpp
parent76070f99e0e9e4817f17dc55489756276b7b58c3 (diff)
downloadpowder-f8766201a688598633e41166225d5e77275a2d5a.zip
powder-f8766201a688598633e41166225d5e77275a2d5a.tar.gz
TPT: Optimization for GoL, Added brush size and mouse wheel to lua! e7035233fd
Diffstat (limited to 'src/game/GameController.cpp')
-rw-r--r--src/game/GameController.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index 8fc1aca..4d13e52 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -196,6 +196,7 @@ void GameController::AdjustBrushSize(int direction, bool logarithmic)
if(newSize.Y<0)
newSize.Y = 0;
gameModel->GetBrush()->SetRadius(newSize);
+ BrushChanged(gameModel->GetBrushID(), gameModel->GetBrush()->GetRadius().X, gameModel->GetBrush()->GetRadius().Y);
}
void GameController::AdjustZoomSize(int direction, bool logarithmic)
@@ -365,6 +366,11 @@ bool GameController::MouseMove(int x, int y, int dx, int dy)
return commandInterface->OnMouseMove(x, y, dx, dy);
}
+bool GameController::BrushChanged(int brushType, int rx, int ry)
+{
+ return commandInterface->OnBrushChanged(brushType, rx, ry);
+}
+
bool GameController::MouseDown(int x, int y, unsigned button)
{
return commandInterface->OnMouseDown(x, y, button);
@@ -638,6 +644,7 @@ void GameController::Vote(int direction)
void GameController::ChangeBrush()
{
gameModel->SetBrush(gameModel->GetBrushID()+1);
+ BrushChanged(gameModel->GetBrushID(), gameModel->GetBrush()->GetRadius().X, gameModel->GetBrush()->GetRadius().Y);
}
void GameController::ClearSim()