summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-05-15 19:01:20 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-05-15 19:01:20 (GMT)
commitbbf7851596988467632e4d3497cc4df224fa53b1 (patch)
treef63a17c13c4aa28208723f0468785eac972c1025 /src/game
parentba5efb101e30c75e9d1a639a717f48767785982d (diff)
downloadpowder-bbf7851596988467632e4d3497cc4df224fa53b1.zip
powder-bbf7851596988467632e4d3497cc4df224fa53b1.tar.gz
Seperate new/old CreateParts functions
Diffstat (limited to 'src/game')
-rw-r--r--src/game/Brush.h14
-rw-r--r--src/game/Tool.h8
2 files changed, 17 insertions, 5 deletions
diff --git a/src/game/Brush.h b/src/game/Brush.h
index 656f9f3..bb6df74 100644
--- a/src/game/Brush.h
+++ b/src/game/Brush.h
@@ -47,14 +47,26 @@ public:
{
SetRadius(size_);
};
+
+ //Radius of the brush 0x0 - infxinf (Radius of 0x0 would be 1x1, radius of 1x1 would be 3x3)
ui::Point GetRadius()
{
return radius;
}
+
+ //Size of the brush bitmap mask, 1x1 - infxinf
+ ui::Point GetSize()
+ {
+ return size;
+ }
void SetRadius(ui::Point radius)
{
this->radius = radius;
this->size = radius+radius+ui::Point(1, 1);
+
+ std::cout << "Radius: " << radius.X << " " << radius.Y << std::endl;
+ std::cout << "Size: " << size.X << " " << size.Y << std::endl;
+
GenerateBitmap();
updateOutline();
}
@@ -95,7 +107,7 @@ public:
updateOutline();
if(!outline)
return;
- g->xor_bitmap(outline, position.X-radius.X, position.Y-radius.Y-1, size.X, size.Y);
+ g->xor_bitmap(outline, position.X-radius.X, position.Y-radius.Y, size.X, size.Y);
}
virtual void GenerateBitmap()
{
diff --git a/src/game/Tool.h b/src/game/Tool.h
index 81b6823..4a78be8 100644
--- a/src/game/Tool.h
+++ b/src/game/Tool.h
@@ -81,10 +81,10 @@ public:
}
virtual ~ElementTool() {}
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position){
- sim->CreateParts(position.X, position.Y, 1, 1, toolID, 0, brush);
+ sim->CreateParts(position.X, position.Y, toolID, brush);
}
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {
- sim->CreateLine(position1.X, position1.Y, position2.X, position2.Y, 1, 1, toolID, 0, brush);
+ sim->CreateLine(position1.X, position1.Y, position2.X, position2.Y, toolID, brush);
}
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {
sim->CreateBox(position1.X, position1.Y, position2.X, position2.Y, toolID, 0);
@@ -125,10 +125,10 @@ public:
}
virtual ~GolTool() {}
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position){
- sim->CreateParts(position.X, position.Y, 1, 1, PT_LIFE|(toolID<<8), 0, brush);
+ sim->CreateParts(position.X, position.Y, PT_LIFE|(toolID<<8), brush);
}
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {
- sim->CreateLine(position1.X, position1.Y, position2.X, position2.Y, 1, 1, PT_LIFE|(toolID<<8), 0, brush);
+ sim->CreateLine(position1.X, position1.Y, position2.X, position2.Y, PT_LIFE|(toolID<<8), brush);
}
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {
sim->CreateBox(position1.X, position1.Y, position2.X, position2.Y, PT_LIFE|(toolID<<8), 0);