summaryrefslogtreecommitdiff
path: root/src/game
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
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')
-rw-r--r--src/game/GameController.cpp7
-rw-r--r--src/game/GameController.h1
2 files changed, 8 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()
diff --git a/src/game/GameController.h b/src/game/GameController.h
index 2388c5d..441aeeb 100644
--- a/src/game/GameController.h
+++ b/src/game/GameController.h
@@ -55,6 +55,7 @@ public:
~GameController();
GameView * GetView();
+ bool BrushChanged(int brushType, int rx, int ry);
bool MouseMove(int x, int y, int dx, int dy);
bool MouseDown(int x, int y, unsigned button);
bool MouseUp(int x, int y, unsigned button);