fix brush when CELL is changed to 1

This commit is contained in:
jacob1
2017-07-28 19:40:50 -04:00
parent 8064d3b467
commit cbad202ac2
3 changed files with 5 additions and 9 deletions

View File

@@ -720,11 +720,7 @@ void GameView::NotifyLastToolChanged(GameModel * sender)
{ {
if (sender->GetLastTool()) if (sender->GetLastTool())
{ {
if (sender->GetLastTool()->GetResolution() == CELL) wallBrush = sender->GetLastTool()->GetBlocky();
wallBrush = true;
else
wallBrush = false;
if (sender->GetLastTool()->GetIdentifier().find("DEFAULT_TOOL_") != sender->GetLastTool()->GetIdentifier().npos) if (sender->GetLastTool()->GetIdentifier().find("DEFAULT_TOOL_") != sender->GetLastTool()->GetIdentifier().npos)
toolBrush = true; toolBrush = true;
else else

View File

@@ -12,7 +12,7 @@ Tool::Tool(int id, string name, string description, int r, int g, int b, std::st
toolName(name), toolName(name),
toolDescription(description), toolDescription(description),
strength(1.0f), strength(1.0f),
resolution(1), blocky(false),
identifier(identifier), identifier(identifier),
colRed(r), colRed(r),
colGreen(g), colGreen(g),
@@ -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)): 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) Tool(id, name, description, r, g, b, identifier, textureGen)
{ {
resolution = CELL; blocky = true;
} }
WallTool::~WallTool() {} WallTool::~WallTool() {}
void WallTool::Draw(Simulation * sim, Brush * brush, ui::Point position) { void WallTool::Draw(Simulation * sim, Brush * brush, ui::Point position) {

View File

@@ -20,7 +20,7 @@ protected:
string toolName; string toolName;
string toolDescription; string toolDescription;
float strength; float strength;
int resolution; bool blocky;
std::string identifier; std::string identifier;
public: public:
int colRed, colGreen, colBlue; int colRed, colGreen, colBlue;
@@ -30,7 +30,7 @@ public:
string GetName(); string GetName();
string GetDescription(); string GetDescription();
std::string GetIdentifier(); std::string GetIdentifier();
int GetResolution() { return resolution; } int GetBlocky() { return blocky; }
void SetStrength(float value) { strength = value; } void SetStrength(float value) { strength = value; }
float GetStrength() { return strength; } float GetStrength() { return strength; }
VideoBuffer * GetTexture(int width, int height); VideoBuffer * GetTexture(int width, int height);