summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/Client.cpp119
-rw-r--r--src/client/Client.h4
-rw-r--r--src/game/DecorationTool.h6
-rw-r--r--src/game/GameModel.cpp18
-rw-r--r--src/game/GameView.cpp30
-rw-r--r--src/game/GameView.h4
-rw-r--r--src/interface/Engine.cpp2
-rw-r--r--src/interface/Engine.h1
-rw-r--r--src/simulation/Sample.h25
-rw-r--r--src/simulation/Simulation.cpp78
-rw-r--r--src/simulation/Simulation.h7
-rw-r--r--src/simulation/SimulationData.h1
12 files changed, 248 insertions, 47 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp
index de37a6c..2e74c48 100644
--- a/src/client/Client.cpp
+++ b/src/client/Client.cpp
@@ -1438,6 +1438,34 @@ double Client::GetPrefNumber(std::string property, double defaultValue)
return defaultValue;
}
+int Client::GetPrefInteger(std::string property, int defaultValue)
+{
+ try
+ {
+ std::stringstream defHexInt;
+ defHexInt << std::hex << defaultValue;
+
+ std::string hexString = GetPrefString(property, defHexInt.str());
+ int finalValue = defaultValue;
+
+ std::stringstream hexInt;
+ hexInt << hexString;
+
+ hexInt >> std::hex >> finalValue;
+
+ return finalValue;
+ }
+ catch (json::Exception & e)
+ {
+
+ }
+ catch(exception & e)
+ {
+
+ }
+ return defaultValue;
+}
+
vector<string> Client::GetPrefStringArray(std::string property)
{
try
@@ -1446,8 +1474,15 @@ vector<string> Client::GetPrefStringArray(std::string property)
vector<string> strArray;
for(json::Array::iterator iter = value.Begin(); iter != value.End(); ++iter)
{
- json::String cValue = *iter;
- strArray.push_back(cValue.Value());
+ try
+ {
+ json::String cValue = *iter;
+ strArray.push_back(cValue.Value());
+ }
+ catch (json::Exception & e)
+ {
+
+ }
}
return strArray;
}
@@ -1466,8 +1501,15 @@ vector<double> Client::GetPrefNumberArray(std::string property)
vector<double> strArray;
for(json::Array::iterator iter = value.Begin(); iter != value.End(); ++iter)
{
- json::Number cValue = *iter;
- strArray.push_back(cValue.Value());
+ try
+ {
+ json::Number cValue = *iter;
+ strArray.push_back(cValue.Value());
+ }
+ catch (json::Exception & e)
+ {
+
+ }
}
return strArray;
}
@@ -1478,6 +1520,40 @@ vector<double> Client::GetPrefNumberArray(std::string property)
return vector<double>();
}
+vector<int> Client::GetPrefIntegerArray(std::string property)
+{
+ try
+ {
+ json::Array value = GetPref(property);
+ vector<int> intArray;
+ for(json::Array::iterator iter = value.Begin(); iter != value.End(); ++iter)
+ {
+ try
+ {
+ json::String cValue = *iter;
+ int finalValue = 0;
+
+ std::string hexString = cValue.Value();
+ std::stringstream hexInt;
+ hexInt << std::hex << hexString;
+ hexInt >> finalValue;
+
+ intArray.push_back(finalValue);
+ }
+ catch (json::Exception & e)
+ {
+
+ }
+ }
+ return intArray;
+ }
+ catch (json::Exception & e)
+ {
+
+ }
+ return vector<int>();
+}
+
vector<bool> Client::GetPrefBoolArray(std::string property)
{
try
@@ -1486,8 +1562,15 @@ vector<bool> Client::GetPrefBoolArray(std::string property)
vector<bool> strArray;
for(json::Array::iterator iter = value.Begin(); iter != value.End(); ++iter)
{
- json::Boolean cValue = *iter;
- strArray.push_back(cValue.Value());
+ try
+ {
+ json::Boolean cValue = *iter;
+ strArray.push_back(cValue.Value());
+ }
+ catch (json::Exception & e)
+ {
+
+ }
}
return strArray;
}
@@ -1524,6 +1607,14 @@ void Client::SetPref(std::string property, double value)
SetPref(property, numberValue);
}
+void Client::SetPref(std::string property, int value)
+{
+ std::stringstream hexInt;
+ hexInt << std::hex << value;
+ json::UnknownElement intValue = json::String(hexInt.str());
+ SetPref(property, intValue);
+}
+
void Client::SetPref(std::string property, vector<string> value)
{
json::Array newArray;
@@ -1557,6 +1648,20 @@ void Client::SetPref(std::string property, vector<bool> value)
SetPref(property, newArrayValue);
}
+void Client::SetPref(std::string property, vector<int> value)
+{
+ json::Array newArray;
+ for(vector<int>::iterator iter = value.begin(); iter != value.end(); ++iter)
+ {
+ std::stringstream hexInt;
+ hexInt << std::hex << *iter;
+
+ newArray.Insert(json::String(hexInt.str()));
+ }
+ json::UnknownElement newArrayValue = newArray;
+ SetPref(property, newArrayValue);
+}
+
void Client::SetPref(std::string property, bool value)
{
json::UnknownElement boolValue = json::Boolean(value);
@@ -1570,7 +1675,7 @@ json::UnknownElement Client::GetPref(std::string property)
json::UnknownElement currentRef = configDocumentCopy;
for(vector<string>::iterator iter = pTokens.begin(); iter != pTokens.end(); ++iter)
{
- currentRef = currentRef[*iter];
+ currentRef = ((const json::UnknownElement &)currentRef)[*iter];
}
return currentRef;
}
diff --git a/src/client/Client.h b/src/client/Client.h
index cb39f2e..7b94393 100644
--- a/src/client/Client.h
+++ b/src/client/Client.h
@@ -120,15 +120,19 @@ public:
std::string GetPrefString(std::string property, std::string defaultValue);
double GetPrefNumber(std::string property, double defaultValue);
+ int GetPrefInteger(std::string property, int defaultValue);
vector<string> GetPrefStringArray(std::string property);
vector<double> GetPrefNumberArray(std::string property);
+ vector<int> GetPrefIntegerArray(std::string property);
vector<bool> GetPrefBoolArray(std::string property);
bool GetPrefBool(std::string property, bool defaultValue);
void SetPref(std::string property, std::string value);
void SetPref(std::string property, double value);
+ void SetPref(std::string property, int value);
void SetPref(std::string property, vector<string> value);
void SetPref(std::string property, vector<double> value);
+ void SetPref(std::string property, vector<int> value);
void SetPref(std::string property, vector<bool> value);
void SetPref(std::string property, bool value);
diff --git a/src/game/DecorationTool.h b/src/game/DecorationTool.h
index be79e6b..e2e4758 100644
--- a/src/game/DecorationTool.h
+++ b/src/game/DecorationTool.h
@@ -7,7 +7,7 @@
class DecorationTool: public Tool
{
public:
- enum ToolType { BlendAdd = DECO_ADD, BlendRemove = DECO_SUBTRACT, BlendMultiply = DECO_MULTIPLY, BlendDivide = DECO_DIVIDE, BlendSet = DECO_DRAW, BlendSmudge = DECO_SMUDGE };
+ enum ToolType { BlendAdd = DECO_ADD, BlendRemove = DECO_SUBTRACT, BlendMultiply = DECO_MULTIPLY, BlendDivide = DECO_DIVIDE, BlendSet = DECO_DRAW, BlendSmudge = DECO_SMUDGE, Remove = DECO_CLEAR };
ToolType decoMode;
@@ -27,10 +27,10 @@ public:
}
virtual ~DecorationTool() {}
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position){
- sim->ApplyDecorationPoint(position.X, position.Y, 1, 1, Red, Green, Blue, Alpha, decoMode, brush);
+ sim->ApplyDecorationPoint(position.X, position.Y, Red, Green, Blue, Alpha, decoMode, brush);
}
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {
- sim->ApplyDecorationLine(position1.X, position1.Y, position2.X, position2.Y, 1, 1, Red, Green, Blue, Alpha, decoMode, brush);
+ sim->ApplyDecorationLine(position1.X, position1.Y, position2.X, position2.Y, Red, Green, Blue, Alpha, decoMode, brush);
}
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {
sim->ApplyDecorationBox(position1.X, position1.Y, position2.X, position2.Y, Red, Green, Blue, Alpha, decoMode);
diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp
index 29d13ce..f3ce1bc 100644
--- a/src/game/GameModel.cpp
+++ b/src/game/GameModel.cpp
@@ -20,7 +20,8 @@ GameModel::GameModel():
colourSelector(false),
clipboard(NULL),
stamp(NULL),
- placeSave(NULL)
+ placeSave(NULL),
+ colour(255, 0, 0, 255)
{
sim = new Simulation();
ren = new Renderer(ui::Engine::Ref().g, sim);
@@ -108,6 +109,7 @@ GameModel::GameModel():
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendDivide, "DIV", "Colour blending: Divide" , 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendSmudge, "SMDG", "Smudge colour", 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendSet, "SET", "Set colour (No blending)", 0, 0, 0));
+ menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::Remove, "CLR", "Clear any set decoration", 0, 0, 0));
//Set default brush palette
brushList.push_back(new EllipseBrush(ui::Point(4, 4)));
@@ -135,6 +137,15 @@ GameModel::GameModel():
if(stampFile && stampFile->GetGameSave())
stamp = stampFile->GetGameSave();
}
+
+
+ //Set default decoration colour
+ unsigned char colourR = min(Client::Ref().GetPrefInteger("Decoration.Red", 200), 255);
+ unsigned char colourG = min(Client::Ref().GetPrefInteger("Decoration.Green", 100), 255);
+ unsigned char colourB = min(Client::Ref().GetPrefInteger("Decoration.Blue", 50), 255);
+ unsigned char colourA = min(Client::Ref().GetPrefInteger("Decoration.Alpha", 255), 255);
+
+ SetColourSelectorColour(ui::Colour(colourR, colourG, colourB, colourA));
}
GameModel::~GameModel()
@@ -148,6 +159,11 @@ GameModel::~GameModel()
std::vector<unsigned int> renderModes = ren->GetRenderMode();
Client::Ref().SetPref("Renderer.RenderModes", std::vector<double>(renderModes.begin(), renderModes.end()));
+ Client::Ref().SetPref("Decoration.Red", (int)colour.Red);
+ Client::Ref().SetPref("Decoration.Green", (int)colour.Green);
+ Client::Ref().SetPref("Decoration.Blue", (int)colour.Blue);
+ Client::Ref().SetPref("Decoration.Alpha", (int)colour.Alpha);
+
for(int i = 0; i < menuList.size(); i++)
{
delete menuList[i];
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp
index ac718c3..6b50d31 100644
--- a/src/game/GameView.cpp
+++ b/src/game/GameView.cpp
@@ -375,7 +375,7 @@ void GameView::NotifyMenuListChanged(GameModel * sender)
}
}
-void GameView::SetSample(Particle sample)
+void GameView::SetSample(SimulationSample sample)
{
this->sample = sample;
}
@@ -1251,18 +1251,36 @@ void GameView::OnDraw()
}
}
+ //Draw info about simulation under cursor
std::stringstream sampleInfo;
sampleInfo.precision(2);
- if(sample.type)
- sampleInfo << c->ElementResolve(sample.type) << ", Temp: " << std::fixed << sample.temp -273.15f;
+ if(sample.particle.type)
+ sampleInfo << c->ElementResolve(sample.particle.type) << ", Temp: " << std::fixed << sample.particle.temp -273.15f;
else
sampleInfo << "Empty";
- if(sample.ctype && sample.ctype>0 && sample.ctype<PT_NUM)
- sampleInfo << ", Ctype: " << c->ElementResolve(sample.ctype);
+ sampleInfo << ", Pressure: " << std::fixed << sample.AirPressure;
- g->drawtext(XRES+BARSIZE-(10+Graphics::textwidth((char*)sampleInfo.str().c_str())), 10, (const char*)sampleInfo.str().c_str(), 255, 255, 255, 255);
+ int textWidth = Graphics::textwidth((char*)sampleInfo.str().c_str());
+ g->fillrect(XRES-20-textWidth, 12, textWidth+8, 15, 0, 0, 0, 255*0.5);
+ g->drawtext(XRES-16-textWidth, 16, (const char*)sampleInfo.str().c_str(), 255, 255, 255, 255*0.75);
+
+ //FPS and some version info
+#ifndef DEBUG //In debug mode, the Engine will draw FPS and other info instead
+ std::stringstream fpsInfo;
+ fpsInfo.precision(2);
+#ifdef SNAPSHOT
+ fpsInfo << "Snapshot " << SNAPSHOT_ID << ". ";
+#endif
+ fpsInfo << "FPS: " << std::fixed << ui::Engine::Ref().GetFps();
+#endif
+
+ textWidth = Graphics::textwidth((char*)fpsInfo.str().c_str());
+ g->fillrect(12, 12, textWidth+8, 15, 0, 0, 0, 255*0.5);
+ g->drawtext(16, 16, (const char*)fpsInfo.str().c_str(), 32, 216, 255, 255*0.75);
+
+ //Tooltips
if(infoTipPresence)
{
int infoTipAlpha = (infoTipPresence>50?50:infoTipPresence)*5;
diff --git a/src/game/GameView.h b/src/game/GameView.h
index 4a841c1..ad9e095 100644
--- a/src/game/GameView.h
+++ b/src/game/GameView.h
@@ -87,7 +87,7 @@ private:
Thumbnail * placeSaveThumb;
- Particle sample;
+ SimulationSample sample;
int lastOffset;
void setToolButtonOffset(int offset);
@@ -99,7 +99,7 @@ public:
//Breaks MVC, but any other way is going to be more of a mess.
ui::Point GetMousePosition();
- void SetSample(Particle sample);
+ void SetSample(SimulationSample sample);
void AttachController(GameController * _c){ c = _c; }
void NotifyRendererChanged(GameModel * sender);
diff --git a/src/interface/Engine.cpp b/src/interface/Engine.cpp
index 5f237a9..07c4203 100644
--- a/src/interface/Engine.cpp
+++ b/src/interface/Engine.cpp
@@ -182,9 +182,11 @@ void Engine::Draw()
if(state_)
state_->DoDraw();
+#ifdef DEBUG
char fpsText[512];
sprintf(fpsText, "FPS: %.2f, Delta: %.3f", fps, dt);
ui::Engine::Ref().g->drawtext(10, 10, fpsText, 255, 255, 255, 255);
+#endif
g->Finalise();
FrameIndex++;
FrameIndex %= 7200;
diff --git a/src/interface/Engine.h b/src/interface/Engine.h
index 9acba62..824f968 100644
--- a/src/interface/Engine.h
+++ b/src/interface/Engine.h
@@ -41,6 +41,7 @@ namespace ui
void Draw();
void SetFps(float fps);
+ inline float GetFps() { return fps; };
inline int GetMouseX() { return mousex_; }
inline int GetMouseY() { return mousey_; }
diff --git a/src/simulation/Sample.h b/src/simulation/Sample.h
new file mode 100644
index 0000000..bd91d02
--- /dev/null
+++ b/src/simulation/Sample.h
@@ -0,0 +1,25 @@
+
+
+#ifndef The_Powder_Toy_Sample_h
+#define The_Powder_Toy_Sample_h
+
+#include "Particle.h"
+
+class SimulationSample
+{
+public:
+ Particle particle;
+ float AirPressure;
+ float AirTemperature;
+ float AirVelocityX;
+ float AirVelocityY;
+
+ int WallType;
+ float Gravity;
+ float GravityVelocityX;
+ float GravityVelocityY;
+
+ SimulationSample() : particle(), AirPressure(0), AirVelocityX(0), AirVelocityY(0), WallType(0), Gravity(0), GravityVelocityX(0), GravityVelocityY(0), AirTemperature(0) {}
+};
+
+#endif \ No newline at end of file
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index 7c82419..9aece76 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -340,13 +340,25 @@ int Simulation::flood_prop(int x, int y, size_t propoffset, void * propvalue, St
return 0;
}
-Particle Simulation::Get(int x, int y)
+SimulationSample Simulation::Get(int x, int y)
{
+ SimulationSample sample;
if(pmap[y][x])
- return parts[pmap[y][x]>>8];
+ sample.particle = parts[pmap[y][x]>>8];
if(photons[y][x])
- return parts[photons[y][x]>>8];
- return Particle();
+ sample.particle = parts[photons[y][x]>>8];
+ sample.AirPressure = pv[y/CELL][x/CELL];
+ sample.AirTemperature = hv[y/CELL][x/CELL];
+ sample.AirVelocityX = vx[y/CELL][x/CELL];
+ sample.AirVelocityY = vy[y/CELL][x/CELL];
+
+ if(grav->ngrav_enable)
+ {
+ sample.Gravity = gravp[(y/CELL)*(XRES/CELL)+(x/CELL)];
+ sample.GravityVelocityX = gravx[(y/CELL)*(XRES/CELL)+(x/CELL)];
+ sample.GravityVelocityY = gravy[(y/CELL)*(XRES/CELL)+(x/CELL)];
+ }
+ return sample;
}
#define PMAP_CMP_CONDUCTIVE(pmap, t) (((pmap)&0xFF)==(t) || (((pmap)&0xFF)==PT_SPRK && parts[(pmap)>>8].ctype==(t)))
@@ -700,6 +712,10 @@ void Simulation::ApplyDecoration(int x, int y, int colR_, int colG_, int colB_,
tg = colG;
tb = colB;
}
+ else if (mode == DECO_CLEAR)
+ {
+ ta = tr = tg = tb = 0.0f;
+ }
else if (mode == DECO_ADD)
{
ta += (colA*0.1f)*colA;
@@ -773,27 +789,32 @@ void Simulation::ApplyDecoration(int x, int y, int colR_, int colG_, int colB_,
parts[rp>>8].dcolour = ((colA_<<24)|(colR_<<16)|(colG_<<8)|colB_);
}
-void Simulation::ApplyDecorationPoint(int x, int y, int rx, int ry, int colR, int colG, int colB, int colA, int mode, Brush * cBrush)
+void Simulation::ApplyDecorationPoint(int positionX, int positionY, int colR, int colG, int colB, int colA, int mode, Brush * cBrush)
{
int i, j;
if(cBrush)
{
- rx = cBrush->GetRadius().X;
- ry = cBrush->GetRadius().Y;
- }
+ int radiusX, radiusY, sizeX, sizeY;
+
+ radiusX = cBrush->GetRadius().X;
+ radiusY = cBrush->GetRadius().Y;
+
+ sizeX = cBrush->GetSize().X;
+ sizeY = cBrush->GetSize().Y;
- if (rx == 0 && ry == 0)
- {
- ApplyDecoration(x, y, colR, colG, colB, colA, mode);
- return;
+ unsigned char *bitmap = cBrush->GetBitmap();
+ for(int y = 0; y < sizeY; y++)
+ {
+ for(int x = 0; x < sizeX; x++)
+ {
+ if(bitmap[(y*sizeX)+x] && (positionX+(x-radiusX) >= 0 && positionY+(y-radiusY) >= 0 && positionX+(x-radiusX) < XRES && positionY+(y-radiusY) < YRES))
+ {
+ ApplyDecoration(positionX+(x-radiusX), positionY+(y-radiusY), colR, colG, colB, colA, mode);
+ }
+ }
+ }
}
-
- unsigned char *bitmap = cBrush->GetBitmap();
- for (j=-ry; j<=ry; j++)
- for (i=-rx; i<=rx; i++)
- if(bitmap[(j+ry)*(rx*2)+(i+rx)])
- ApplyDecoration(x+i, y+j, colR, colG, colB, colA, mode);
}
void Simulation::ApplyDecorationBox(int x1, int y1, int x2, int y2, int colR, int colG, int colB, int colA, int mode)
@@ -814,13 +835,20 @@ void Simulation::ApplyDecorationBox(int x1, int y1, int x2, int y2, int colR, in
}
for (j=y1; j<=y2; j++)
for (i=x1; i<=x2; i++)
- ApplyDecorationPoint(i, j, 0, 0, colR, colG, colB, colA, mode);
+ ApplyDecoration(i, j, colR, colG, colB, colA, mode);
}
-void Simulation::ApplyDecorationLine(int x1, int y1, int x2, int y2, int rx, int ry, int colR, int colG, int colB, int colA, int mode, Brush * cBrush)
+void Simulation::ApplyDecorationLine(int x1, int y1, int x2, int y2, int colR, int colG, int colB, int colA, int mode, Brush * cBrush)
{
- int cp=abs(y2-y1)>abs(x2-x1), x, y, dx, dy, sy;
+ int cp=abs(y2-y1)>abs(x2-x1), x, y, dx, dy, sy, rx, ry;
float e, de;
+
+ if(cBrush)
+ {
+ rx = cBrush->GetRadius().X;
+ ry = cBrush->GetRadius().Y;
+ }
+
if (cp)
{
y = x1;
@@ -851,9 +879,9 @@ void Simulation::ApplyDecorationLine(int x1, int y1, int x2, int y2, int rx, int
for (x=x1; x<=x2; x++)
{
if (cp)
- ApplyDecorationPoint(y, x, rx, ry, colR, colG, colB, colA, mode, cBrush);
+ ApplyDecorationPoint(y, x, colR, colG, colB, colA, mode, cBrush);
else
- ApplyDecorationPoint(x, y, rx, ry, colR, colG, colB, colA, mode, cBrush);
+ ApplyDecorationPoint(x, y, colR, colG, colB, colA, mode, cBrush);
e += de;
if (e >= 0.5f)
{
@@ -861,9 +889,9 @@ void Simulation::ApplyDecorationLine(int x1, int y1, int x2, int y2, int rx, int
if (!(rx+ry))
{
if (cp)
- ApplyDecorationPoint(y, x, rx, ry, colR, colG, colB, colA, mode, cBrush);
+ ApplyDecorationPoint(y, x, colR, colG, colB, colA, mode, cBrush);
else
- ApplyDecorationPoint(x, y, rx, ry, colR, colG, colB, colA, mode, cBrush);
+ ApplyDecorationPoint(x, y, colR, colG, colB, colA, mode, cBrush);
}
e -= 1.0f;
}
diff --git a/src/simulation/Simulation.h b/src/simulation/Simulation.h
index e4e4120..0e6c66f 100644
--- a/src/simulation/Simulation.h
+++ b/src/simulation/Simulation.h
@@ -26,6 +26,7 @@
#include "GOLMenu.h"
#include "MenuSection.h"
#include "client/GameSave.h"
+#include "Sample.h"
#define CHANNELS ((int)(MAX_TEMP-73)/100+2)
@@ -117,7 +118,7 @@ public:
int Load(int x, int y, GameSave * save);
GameSave * Save();
GameSave * Save(int x1, int y1, int x2, int y2);
- Particle Get(int x, int y);
+ SimulationSample Get(int x, int y);
inline int is_blocking(int t, int x, int y);
inline int is_boundary(int pt, int x, int y);
inline int find_next_boundary(int pt, int *x, int *y, int dm, int *em);
@@ -173,8 +174,8 @@ public:
void CreateWallLine(int x1, int y1, int x2, int y2, int rx, int ry, int c, int flags, Brush * cBrush = NULL);
void ApplyDecoration(int x, int y, int colR, int colG, int colB, int colA, int mode);
- void ApplyDecorationPoint(int x, int y, int rx, int ry, int colR, int colG, int colB, int colA, int mode, Brush * cBrush = NULL);
- void ApplyDecorationLine(int x1, int y1, int x2, int y2, int rx, int ry, int colR, int colG, int colB, int colA, int mode, Brush * cBrush = NULL);
+ void ApplyDecorationPoint(int x, int y, int colR, int colG, int colB, int colA, int mode, Brush * cBrush = NULL);
+ void ApplyDecorationLine(int x1, int y1, int x2, int y2, int colR, int colG, int colB, int colA, int mode, Brush * cBrush = NULL);
void ApplyDecorationBox(int x1, int y1, int x2, int y2, int colR, int colG, int colB, int colA, int mode);
void *transform_save(void *odata, int *size, matrix2d transform, vector2d translate);
diff --git a/src/simulation/SimulationData.h b/src/simulation/SimulationData.h
index 72a8e58..ee64ce2 100644
--- a/src/simulation/SimulationData.h
+++ b/src/simulation/SimulationData.h
@@ -81,6 +81,7 @@
#define DECO_MULTIPLY 3
#define DECO_DIVIDE 4
#define DECO_SMUDGE 5
+#define DECO_CLEAR 6
//Old IDs for GOL types
#define GT_GOL 78