summaryrefslogtreecommitdiff
path: root/src/gui/game/GameController.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-06-09 02:23:53 (GMT)
committer jacob1 <jfu614@gmail.com>2013-06-09 02:23:53 (GMT)
commit16cb95de641e2a28a40599f4b6c21336b78f7287 (patch)
treedca340f6f751aa49770759699045dad046e29c37 /src/gui/game/GameController.cpp
parent0f5d0859b451f7cd716422a8b389129eb135ed60 (diff)
downloadpowder-16cb95de641e2a28a40599f4b6c21336b78f7287.zip
powder-16cb95de641e2a28a40599f4b6c21336b78f7287.tar.gz
fix problems with point queue, where it would draw a Point at A, a line from A to B, and a line from B to B every frame
Diffstat (limited to 'src/gui/game/GameController.cpp')
-rw-r--r--src/gui/game/GameController.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp
index b873360..9dd949f 100644
--- a/src/gui/game/GameController.cpp
+++ b/src/gui/game/GameController.cpp
@@ -444,7 +444,6 @@ void GameController::DrawPoints(int toolSelection, queue<ui::Point> & pointQueue
{
while(!pointQueue.empty())
{
- //delete pointQueue.front();
pointQueue.pop();
}
}
@@ -455,20 +454,25 @@ void GameController::DrawPoints(int toolSelection, queue<ui::Point> & pointQueue
if(!pointQueue.empty())
{
ui::Point sPoint(0, 0);
+ int size = pointQueue.size();
bool first = true;
while(!pointQueue.empty())
{
ui::Point fPoint = pointQueue.front();
- //delete pointQueue.front();
pointQueue.pop();
- if(!first)
+ if(size > 1)
{
- activeTool->DrawLine(sim, cBrush, sPoint, fPoint, true);
+ if (!first)
+ {
+ activeTool->DrawLine(sim, cBrush, sPoint, fPoint, true);
+ printf("From (%d, %d) To (%d, %d)\n", sPoint.X, sPoint.Y, fPoint.X, fPoint.Y);
+ }
+ first = false;
}
else
{
- first = false;
activeTool->Draw(sim, cBrush, fPoint);
+ printf("(%d, %d)\n", fPoint.X, fPoint.Y);
}
sPoint = fPoint;
}