summaryrefslogtreecommitdiff
path: root/src/simulation
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-06 15:14:08 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-06 15:14:08 (GMT)
commit662640c96c86ba83132f0683c35bfba24b43783c (patch)
tree5f0b5270d9410a683d45909e789c478c01d6d6e0 /src/simulation
parent0e43f2e83118897bc916db69a012f4686429d930 (diff)
downloadpowder-662640c96c86ba83132f0683c35bfba24b43783c.zip
powder-662640c96c86ba83132f0683c35bfba24b43783c.tar.gz
Fix previous merge with SOAP.cpp that created a bug in SOAP. add debug lines for PRTI, PRTO, WIFI and lines for SOAP.
Diffstat (limited to 'src/simulation')
-rw-r--r--src/simulation/ElementGraphics.h2
-rw-r--r--src/simulation/elements/PRTI.cpp1
-rw-r--r--src/simulation/elements/PRTO.cpp1
-rw-r--r--src/simulation/elements/SOAP.cpp10
-rw-r--r--src/simulation/elements/WIFI.cpp1
5 files changed, 14 insertions, 1 deletions
diff --git a/src/simulation/ElementGraphics.h b/src/simulation/ElementGraphics.h
index e84db94..0f3723c 100644
--- a/src/simulation/ElementGraphics.h
+++ b/src/simulation/ElementGraphics.h
@@ -25,6 +25,8 @@
#define EFFECT 0xFF000000
#define EFFECT_GRAVIN 0x01000000
#define EFFECT_GRAVOUT 0x02000000
+#define EFFECT_LINES 0x04000000
+#define EFFECT_DBGLINES 0x08000000
#define RENDER_EFFE OPTIONS | PSPEC_STICKMAN | EFFECT | PMODE_SPARK | PMODE_FLARE | PMODE_LFLARE
#define RENDER_FIRE OPTIONS | PSPEC_STICKMAN | /*PMODE_FLAT |*/ PMODE_ADD | PMODE_BLEND | FIREMODE
diff --git a/src/simulation/elements/PRTI.cpp b/src/simulation/elements/PRTI.cpp
index 451c54b..8383d90 100644
--- a/src/simulation/elements/PRTI.cpp
+++ b/src/simulation/elements/PRTI.cpp
@@ -129,6 +129,7 @@ int Element_PRTI::graphics(GRAPHICS_FUNC_ARGS)
*firer = 255;
*fireg = 0;
*fireb = 0;
+ *pixel_mode |= EFFECT_DBGLINES;
*pixel_mode |= EFFECT_GRAVIN;
*pixel_mode &= ~PMODE;
*pixel_mode |= PMODE_ADD;
diff --git a/src/simulation/elements/PRTO.cpp b/src/simulation/elements/PRTO.cpp
index 788e7d1..b4554ec 100644
--- a/src/simulation/elements/PRTO.cpp
+++ b/src/simulation/elements/PRTO.cpp
@@ -166,6 +166,7 @@ int Element_PRTO::graphics(GRAPHICS_FUNC_ARGS)
*firer = 0;
*fireg = 0;
*fireb = 255;
+ *pixel_mode |= EFFECT_DBGLINES;
*pixel_mode |= EFFECT_GRAVOUT;
*pixel_mode &= ~PMODE;
*pixel_mode |= PMODE_ADD;
diff --git a/src/simulation/elements/SOAP.cpp b/src/simulation/elements/SOAP.cpp
index d4ed39d..1d3a55b 100644
--- a/src/simulation/elements/SOAP.cpp
+++ b/src/simulation/elements/SOAP.cpp
@@ -43,6 +43,7 @@ Element_SOAP::Element_SOAP()
HighTemperatureTransition = NT;
Update = &Element_SOAP::update;
+ Graphics = &Element_SOAP::graphics;
}
@@ -120,7 +121,7 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS)
parts[i].vx *= 0.5f;
}
- if(parts[i].ctype&2)
+ if(!(parts[i].ctype&2))
{
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
@@ -279,5 +280,12 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS)
return 0;
}
+//#TPT-Directive ElementHeader Element_SOAP static int graphics(GRAPHICS_FUNC_ARGS)
+int Element_SOAP::graphics(GRAPHICS_FUNC_ARGS)
+
+{
+ *pixel_mode |= EFFECT_LINES;
+ return 1;
+}
Element_SOAP::~Element_SOAP() {}
diff --git a/src/simulation/elements/WIFI.cpp b/src/simulation/elements/WIFI.cpp
index a108c91..0dc08e0 100644
--- a/src/simulation/elements/WIFI.cpp
+++ b/src/simulation/elements/WIFI.cpp
@@ -93,6 +93,7 @@ int Element_WIFI::graphics(GRAPHICS_FUNC_ARGS)
*colr = sin(frequency*q + 0) * 127 + 128;
*colg = sin(frequency*q + 2) * 127 + 128;
*colb = sin(frequency*q + 4) * 127 + 128;
+ *pixel_mode |= EFFECT_DBGLINES;
return 0;
}