summaryrefslogtreecommitdiff
path: root/src/simulation/elements
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-04 14:26:55 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-04 14:26:55 (GMT)
commit055832270979cdb027c0c30a74cf82c23df13689 (patch)
treeb2ee525f713764c020b8668fe5776f4aa3d60643 /src/simulation/elements
parentf32cd872ca2214b670b1ed4efa0b5b12a9c1ed30 (diff)
downloadpowder-055832270979cdb027c0c30a74cf82c23df13689.zip
powder-055832270979cdb027c0c30a74cf82c23df13689.tar.gz
Add icons for erase, improve icons for certain walls, fix issue #45
Diffstat (limited to 'src/simulation/elements')
-rw-r--r--src/simulation/elements/Element.cpp3
-rw-r--r--src/simulation/elements/Element.h1
-rw-r--r--src/simulation/elements/NONE.cpp19
3 files changed, 21 insertions, 2 deletions
diff --git a/src/simulation/elements/Element.cpp b/src/simulation/elements/Element.cpp
index 44e7251..83f8c76 100644
--- a/src/simulation/elements/Element.cpp
+++ b/src/simulation/elements/Element.cpp
@@ -42,7 +42,8 @@ Element::Element():
HighTemperatureTransition(NT),
Update(NULL),
- Graphics(&Element::defaultGraphics)
+ Graphics(&Element::defaultGraphics),
+ IconGenerator(NULL)
{
}
diff --git a/src/simulation/elements/Element.h b/src/simulation/elements/Element.h
index 29c7fa0..7fca108 100644
--- a/src/simulation/elements/Element.h
+++ b/src/simulation/elements/Element.h
@@ -38,6 +38,7 @@ public:
unsigned int Properties;
int (*Update) (UPDATE_FUNC_ARGS);
int (*Graphics) (GRAPHICS_FUNC_ARGS);
+ VideoBuffer * (*IconGenerator)(int, int, int);
float HighPressure;
int HighPressureTransition;
diff --git a/src/simulation/elements/NONE.cpp b/src/simulation/elements/NONE.cpp
index d271c90..95d9d3e 100644
--- a/src/simulation/elements/NONE.cpp
+++ b/src/simulation/elements/NONE.cpp
@@ -43,7 +43,24 @@ Element_NONE::Element_NONE()
HighTemperatureTransition = NT;
Update = NULL;
-
+ IconGenerator = &Element_NONE::iconGen;
}
+//#TPT-Directive ElementHeader Element_NONE static VideoBuffer * iconGen(int, int, int)
+VideoBuffer * Element_NONE::iconGen(int wallID, int width, int height)
+{
+ VideoBuffer * newTexture = new VideoBuffer(width, height);
+
+ for (int j=3; j<(width-4)/2; j++)
+ {
+ newTexture->SetPixel(j+6, j, 0xFF, 0, 0, 255);
+ newTexture->SetPixel(j+7, j, 0xFF, 0, 0, 255);
+ newTexture->SetPixel(-j+19, j, 0xFF, 0, 0, 255);
+ newTexture->SetPixel(-j+20, j, 0xFF, 0, 0, 255);
+ }
+
+ return newTexture;
+}
+
+
Element_NONE::~Element_NONE() {} \ No newline at end of file