Skip to content

Commit

Permalink
fix brush when CELL is changed to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Jul 28, 2017
1 parent 8064d3b commit cbad202
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions src/gui/game/GameView.cpp
Expand Up @@ -720,11 +720,7 @@ void GameView::NotifyLastToolChanged(GameModel * sender)
{
if (sender->GetLastTool())
{
if (sender->GetLastTool()->GetResolution() == CELL)
wallBrush = true;
else
wallBrush = false;

wallBrush = sender->GetLastTool()->GetBlocky();
if (sender->GetLastTool()->GetIdentifier().find("DEFAULT_TOOL_") != sender->GetLastTool()->GetIdentifier().npos)
toolBrush = true;
else
Expand Down
4 changes: 2 additions & 2 deletions src/gui/game/Tool.cpp
Expand Up @@ -12,7 +12,7 @@ Tool::Tool(int id, string name, string description, int r, int g, int b, std::st
toolName(name),
toolDescription(description),
strength(1.0f),
resolution(1),
blocky(false),
identifier(identifier),
colRed(r),
colGreen(g),
Expand Down Expand Up @@ -72,7 +72,7 @@ void ElementTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position)
WallTool::WallTool(int id, string name, string description, int r, int g, int b, std::string identifier, VideoBuffer * (*textureGen)(int, int, int)):
Tool(id, name, description, r, g, b, identifier, textureGen)
{
resolution = CELL;
blocky = true;
}
WallTool::~WallTool() {}
void WallTool::Draw(Simulation * sim, Brush * brush, ui::Point position) {
Expand Down
4 changes: 2 additions & 2 deletions src/gui/game/Tool.h
Expand Up @@ -20,7 +20,7 @@ class Tool
string toolName;
string toolDescription;
float strength;
int resolution;
bool blocky;
std::string identifier;
public:
int colRed, colGreen, colBlue;
Expand All @@ -30,7 +30,7 @@ class Tool
string GetName();
string GetDescription();
std::string GetIdentifier();
int GetResolution() { return resolution; }
int GetBlocky() { return blocky; }
void SetStrength(float value) { strength = value; }
float GetStrength() { return strength; }
VideoBuffer * GetTexture(int width, int height);
Expand Down

0 comments on commit cbad202

Please sign in to comment.