summaryrefslogtreecommitdiff
path: root/src/game/GameController.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-22 14:45:37 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-22 14:45:37 (GMT)
commit19c1fa5dcb4c4a2ba9d692e136b17da316a2631b (patch)
tree8436e6674dc4375f0392a9142be1a06ddf888337 /src/game/GameController.cpp
parent91bb5a8b781fba33901c0a2804b86055ed588aa4 (diff)
downloadpowder-19c1fa5dcb4c4a2ba9d692e136b17da316a2631b.zip
powder-19c1fa5dcb4c4a2ba9d692e136b17da316a2631b.tar.gz
Brush class for drawing on simulation, more interface for game
Diffstat (limited to 'src/game/GameController.cpp')
-rw-r--r--src/game/GameController.cpp58
1 files changed, 56 insertions, 2 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index 571833a..b9c534c 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -37,10 +37,21 @@ GameView * GameController::GetView()
return gameView;
}
+void GameController::AdjustBrushSize(int direction)
+{
+ ui::Point newSize = gameModel->GetBrush()->GetRadius() + ui::Point(direction, direction);
+ if(newSize.X<0)
+ newSize.X = 0;
+ if(newSize.Y<0)
+ newSize.Y = 0;
+ gameModel->GetBrush()->SetRadius(newSize);
+}
+
void GameController::DrawPoints(queue<ui::Point*> & pointQueue)
{
Simulation * sim = gameModel->GetSimulation();
int activeElement = gameModel->GetActiveElement();
+ Brush * cBrush = gameModel->GetBrush();
if(!pointQueue.empty())
{
ui::Point * sPoint = NULL;
@@ -50,12 +61,12 @@ void GameController::DrawPoints(queue<ui::Point*> & pointQueue)
pointQueue.pop();
if(sPoint)
{
- sim->create_line(fPoint->X, fPoint->Y, sPoint->X, sPoint->Y, 1, 1, activeElement, 0);
+ sim->create_line(fPoint->X, fPoint->Y, sPoint->X, sPoint->Y, 1, 1, activeElement, 0, cBrush);
delete sPoint;
}
else
{
- sim->create_parts(fPoint->X, fPoint->Y, 1, 1, activeElement, 0);
+ sim->create_parts(fPoint->X, fPoint->Y, 1, 1, activeElement, 0, cBrush);
}
sPoint = fPoint;
}
@@ -79,3 +90,46 @@ void GameController::OpenSearch()
search = new SearchController();
ui::Engine::Ref().ShowWindow(search->GetView());
}
+
+void GameController::OpenLogin()
+{
+ //TODO: Implement
+}
+
+void GameController::OpenTags()
+{
+ //TODO: Implement
+}
+
+void GameController::OpenDisplayOptions()
+{
+ //TODO: Implement
+}
+
+void GameController::OpenRenderOptions()
+{
+ //TODO: Implement
+}
+
+void GameController::OpenSaveWindow()
+{
+ //TODO: Implement
+}
+
+void GameController::Vote(int direction)
+{
+ //TODO: Implement
+}
+
+
+void GameController::ClearSim()
+{
+ gameModel->ClearSimulation();
+}
+
+void GameController::ReloadSim()
+{
+ //TODO: Implement
+}
+
+