summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-25 19:18:24 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-25 19:18:24 (GMT)
commitb2d3257ae944a3ea3b57dc8ee4171b1b2f85483e (patch)
tree38adf87af2bcf2bbc5d4578b3ab39e09aa064265 /src/game
parentc5cc1870f3ec0d9b6499b04b4ab2123bcf58db84 (diff)
downloadpowder-b2d3257ae944a3ea3b57dc8ee4171b1b2f85483e.zip
powder-b2d3257ae944a3ea3b57dc8ee4171b1b2f85483e.tar.gz
Better way of managing Controllers
Diffstat (limited to 'src/game')
-rw-r--r--src/game/GameController.cpp9
-rw-r--r--src/game/GameController.h2
-rw-r--r--src/game/GameView.cpp2
3 files changed, 8 insertions, 5 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index 85518f7..5399cf8 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -19,8 +19,6 @@ public:
virtual void ControllerExit()
{
cc->gameModel->SetUser(cc->loginWindow->GetUser());
- delete cc->loginWindow;
- cc->loginWindow = NULL;
}
};
@@ -116,9 +114,14 @@ void GameController::DrawPoints(queue<ui::Point*> & pointQueue)
}
}
-void GameController::Tick()
+void GameController::Update()
{
//gameModel->GetSimulation()->update_particles();
+ if(loginWindow && loginWindow->HasExited)
+ {
+ delete loginWindow;
+ loginWindow = NULL;
+ }
}
void GameController::SetPaused(bool pauseState)
diff --git a/src/game/GameController.h b/src/game/GameController.h
index 157df99..4f076fd 100644
--- a/src/game/GameController.h
+++ b/src/game/GameController.h
@@ -31,7 +31,7 @@ public:
GameView * GetView();
void AdjustBrushSize(int direction);
void DrawPoints(queue<ui::Point*> & pointQueue);
- void Tick();
+ void Update();
void SetPaused(bool pauseState);
void SetPaused();
void SetActiveMenu(Menu * menu);
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp
index 70f6663..4695227 100644
--- a/src/game/GameView.cpp
+++ b/src/game/GameView.cpp
@@ -414,7 +414,7 @@ void GameView::OnTick(float dt)
{
c->DrawPoints(pointQueue);
}
- c->Tick();
+ c->Update();
}
void GameView::OnDraw()