summaryrefslogtreecommitdiff
path: root/src/game/GameModel.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-26 18:06:23 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-26 18:06:23 (GMT)
commite84f0fc6e5301265708a99b13ab898ce45422611 (patch)
tree2bbcf8aeb7e0b4177ccaa22a0bde2add3c696765 /src/game/GameModel.cpp
parent824d3c069bc409d268a2a15352e96868a7731a56 (diff)
downloadpowder-e84f0fc6e5301265708a99b13ab898ce45422611.zip
powder-e84f0fc6e5301265708a99b13ab898ce45422611.tar.gz
Ellipse cursor
Diffstat (limited to 'src/game/GameModel.cpp')
-rw-r--r--src/game/GameModel.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp
index 3085b09..5dfc521 100644
--- a/src/game/GameModel.cpp
+++ b/src/game/GameModel.cpp
@@ -5,13 +5,14 @@
#include "Renderer.h"
#include "interface/Point.h"
#include "Brush.h"
+#include "EllipseBrush.h"
GameModel::GameModel():
activeTool(NULL),
sim(NULL),
ren(NULL),
currentSave(NULL),
- currentBrush(new Brush(ui::Point(4, 4))),
+ currentBrush(0),
currentUser(0, "")
{
sim = new Simulation();
@@ -39,6 +40,9 @@ GameModel::GameModel():
//sim->wtypes[i]
}
+ brushList.push_back(new Brush(ui::Point(4, 4)));
+ brushList.push_back(new EllipseBrush(ui::Point(4, 4)));
+
activeTool = new ElementTool(1, "TURD", 0, 0, 0);
}
@@ -52,6 +56,10 @@ GameModel::~GameModel()
}
delete menuList[i];
}
+ for(int i = 0; i < brushList.size(); i++)
+ {
+ delete brushList[i];
+ }
delete sim;
delete ren;
if(activeTool)
@@ -60,9 +68,20 @@ GameModel::~GameModel()
Brush * GameModel::GetBrush()
{
+ return brushList[currentBrush];
+}
+
+int GameModel::GetBrushID()
+{
return currentBrush;
}
+void GameModel::SetBrush(int i)
+{
+ currentBrush = i%brushList.size();
+ notifyBrushChanged();
+}
+
void GameModel::AddObserver(GameView * observer){
observers.push_back(observer);