summaryrefslogtreecommitdiff
path: root/src/simulation
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-03-13 19:54:34 (GMT)
committer jacob1 <jfu614@gmail.com>2013-03-13 19:54:34 (GMT)
commite493cf8a475baf2032f879b4c37a6b1ac1b51b54 (patch)
tree78d068526f3ea4ed6a2eb5be4c808349b906152e /src/simulation
parent7a055a9d90ea3464bbdc314df423e2aa768ce2be (diff)
downloadpowder-e493cf8a475baf2032f879b4c37a6b1ac1b51b54.zip
powder-e493cf8a475baf2032f879b4c37a6b1ac1b51b54.tar.gz
fix all tab spacing issues in all the element files
Diffstat (limited to 'src/simulation')
-rw-r--r--src/simulation/Elements.h2
-rw-r--r--src/simulation/elements/116.cpp84
-rw-r--r--src/simulation/elements/146.cpp84
-rw-r--r--src/simulation/elements/ACEL.cpp86
-rw-r--r--src/simulation/elements/ACID.cpp88
-rw-r--r--src/simulation/elements/AMTR.cpp86
-rw-r--r--src/simulation/elements/ANAR.cpp88
-rw-r--r--src/simulation/elements/ARAY.cpp86
-rw-r--r--src/simulation/elements/BANG.cpp86
-rw-r--r--src/simulation/elements/BCLN.cpp92
-rw-r--r--src/simulation/elements/BCOL.cpp90
-rw-r--r--src/simulation/elements/BGLA.cpp84
-rw-r--r--src/simulation/elements/BHOL.cpp84
-rw-r--r--src/simulation/elements/BIZR.cpp86
-rw-r--r--src/simulation/elements/BIZRG.cpp84
-rw-r--r--src/simulation/elements/BIZRS.cpp84
-rw-r--r--src/simulation/elements/BMTL.cpp86
-rw-r--r--src/simulation/elements/BOMB.cpp86
-rw-r--r--src/simulation/elements/BOYL.cpp87
-rw-r--r--src/simulation/elements/BRAY.cpp88
-rw-r--r--src/simulation/elements/BRCK.cpp104
-rw-r--r--src/simulation/elements/BREC.cpp84
-rw-r--r--src/simulation/elements/BRMT.cpp86
-rw-r--r--src/simulation/elements/BTRY.cpp86
-rw-r--r--src/simulation/elements/BVBR.cpp84
-rw-r--r--src/simulation/elements/C5.cpp86
-rw-r--r--src/simulation/elements/CAUS.cpp86
-rw-r--r--src/simulation/elements/CBNW.cpp86
-rw-r--r--src/simulation/elements/CLNE.cpp92
-rw-r--r--src/simulation/elements/CLST.cpp86
-rw-r--r--src/simulation/elements/CNCT.cpp84
-rw-r--r--src/simulation/elements/CO2.cpp86
-rw-r--r--src/simulation/elements/COAL.cpp88
-rw-r--r--src/simulation/elements/CONV.cpp92
-rw-r--r--src/simulation/elements/CRAY.cpp88
-rw-r--r--src/simulation/elements/DCEL.cpp86
-rw-r--r--src/simulation/elements/DESL.cpp84
-rw-r--r--src/simulation/elements/DEST.cpp86
-rw-r--r--src/simulation/elements/DEUT.cpp90
-rw-r--r--src/simulation/elements/DLAY.cpp86
-rw-r--r--src/simulation/elements/DMG.cpp86
-rw-r--r--src/simulation/elements/DMND.cpp84
-rw-r--r--src/simulation/elements/DRIC.cpp84
-rw-r--r--src/simulation/elements/DSTW.cpp86
-rw-r--r--src/simulation/elements/DTEC.cpp88
-rw-r--r--src/simulation/elements/DUST.cpp84
-rw-r--r--src/simulation/elements/DYST.cpp84
-rw-r--r--src/simulation/elements/ELEC.cpp86
-rw-r--r--src/simulation/elements/EMBR.cpp213
-rw-r--r--src/simulation/elements/EMP.cpp86
-rw-r--r--src/simulation/elements/ETRD.cpp84
-rw-r--r--src/simulation/elements/EXOT.cpp86
-rw-r--r--src/simulation/elements/FIGH.cpp90
-rw-r--r--src/simulation/elements/FILT.cpp84
-rw-r--r--src/simulation/elements/FIRE.cpp94
-rw-r--r--src/simulation/elements/FIRW.cpp86
-rw-r--r--src/simulation/elements/FOG.cpp86
-rw-r--r--src/simulation/elements/FRAY.cpp86
-rw-r--r--src/simulation/elements/FRME.cpp82
-rw-r--r--src/simulation/elements/FRZW.cpp86
-rw-r--r--src/simulation/elements/FRZZ.cpp86
-rw-r--r--src/simulation/elements/FSEP.cpp86
-rw-r--r--src/simulation/elements/FUSE.cpp86
-rw-r--r--src/simulation/elements/FWRK.cpp84
-rw-r--r--src/simulation/elements/GAS.cpp84
-rw-r--r--src/simulation/elements/GBMB.cpp103
-rw-r--r--src/simulation/elements/GEL.cpp88
-rw-r--r--src/simulation/elements/GLAS.cpp84
-rw-r--r--src/simulation/elements/GLOW.cpp86
-rw-r--r--src/simulation/elements/GOO.cpp84
-rw-r--r--src/simulation/elements/GPMP.cpp86
-rw-r--r--src/simulation/elements/GRAV.cpp84
-rw-r--r--src/simulation/elements/GUNP.cpp84
-rw-r--r--src/simulation/elements/H2.cpp86
-rw-r--r--src/simulation/elements/HFLM.cpp86
-rw-r--r--src/simulation/elements/HSWC.cpp86
-rw-r--r--src/simulation/elements/ICEI.cpp86
-rw-r--r--src/simulation/elements/IGNT.cpp86
-rw-r--r--src/simulation/elements/INSL.cpp84
-rw-r--r--src/simulation/elements/INST.cpp84
-rw-r--r--src/simulation/elements/INVIS.cpp84
-rw-r--r--src/simulation/elements/INWR.cpp84
-rw-r--r--src/simulation/elements/IRON.cpp86
-rw-r--r--src/simulation/elements/ISOZ.cpp84
-rw-r--r--src/simulation/elements/ISZS.cpp84
-rw-r--r--src/simulation/elements/LAVA.cpp84
-rw-r--r--src/simulation/elements/LCRY.cpp86
-rw-r--r--src/simulation/elements/LIFE.cpp93
-rw-r--r--src/simulation/elements/LIGH.cpp88
-rw-r--r--src/simulation/elements/LNTG.cpp84
-rw-r--r--src/simulation/elements/LO2.cpp84
-rw-r--r--src/simulation/elements/LOLZ.cpp98
-rw-r--r--src/simulation/elements/LOVE.cpp98
-rw-r--r--src/simulation/elements/LRBD.cpp84
-rw-r--r--src/simulation/elements/MERC.cpp90
-rw-r--r--src/simulation/elements/METL.cpp84
-rw-r--r--src/simulation/elements/MORT.cpp84
-rw-r--r--src/simulation/elements/MWAX.cpp84
-rw-r--r--src/simulation/elements/NBHL.cpp84
-rw-r--r--src/simulation/elements/NBLE.cpp84
-rw-r--r--src/simulation/elements/NEUT.cpp86
-rw-r--r--src/simulation/elements/NICE.cpp84
-rw-r--r--src/simulation/elements/NITR.cpp84
-rw-r--r--src/simulation/elements/NONE.cpp102
-rw-r--r--src/simulation/elements/NSCN.cpp84
-rw-r--r--src/simulation/elements/NTCT.cpp84
-rw-r--r--src/simulation/elements/NWHL.cpp84
-rw-r--r--src/simulation/elements/O2.cpp86
-rw-r--r--src/simulation/elements/OIL.cpp84
-rw-r--r--src/simulation/elements/PBCN.cpp96
-rw-r--r--src/simulation/elements/PCLN.cpp96
-rw-r--r--src/simulation/elements/PHOT.cpp86
-rw-r--r--src/simulation/elements/PIPE.cpp14
-rw-r--r--src/simulation/elements/PLEX.cpp84
-rw-r--r--src/simulation/elements/PLNT.cpp88
-rw-r--r--src/simulation/elements/PLSM.cpp84
-rw-r--r--src/simulation/elements/PLUT.cpp84
-rw-r--r--src/simulation/elements/PQRT.cpp88
-rw-r--r--src/simulation/elements/PRTI.cpp86
-rw-r--r--src/simulation/elements/PRTO.cpp86
-rw-r--r--src/simulation/elements/PSCN.cpp84
-rw-r--r--src/simulation/elements/PSTE.cpp84
-rw-r--r--src/simulation/elements/PSTN.cpp89
-rw-r--r--src/simulation/elements/PSTS.cpp84
-rw-r--r--src/simulation/elements/PTCT.cpp84
-rw-r--r--src/simulation/elements/PUMP.cpp86
-rw-r--r--src/simulation/elements/PVOD.cpp86
-rw-r--r--src/simulation/elements/QRTZ.cpp88
-rw-r--r--src/simulation/elements/RBDM.cpp84
-rw-r--r--src/simulation/elements/REPL.cpp86
-rw-r--r--src/simulation/elements/RIME.cpp86
-rw-r--r--src/simulation/elements/SALT.cpp84
-rw-r--r--src/simulation/elements/SAND.cpp84
-rw-r--r--src/simulation/elements/SHLD1.cpp86
-rw-r--r--src/simulation/elements/SHLD2.cpp86
-rw-r--r--src/simulation/elements/SHLD3.cpp86
-rw-r--r--src/simulation/elements/SHLD4.cpp86
-rw-r--r--src/simulation/elements/SING.cpp86
-rw-r--r--src/simulation/elements/SLTW.cpp86
-rw-r--r--src/simulation/elements/SMKE.cpp84
-rw-r--r--src/simulation/elements/SNOW.cpp86
-rw-r--r--src/simulation/elements/SOAP.cpp96
-rw-r--r--src/simulation/elements/SPAWN.cpp84
-rw-r--r--src/simulation/elements/SPAWN2.cpp84
-rw-r--r--src/simulation/elements/SPNG.cpp94
-rw-r--r--src/simulation/elements/SPRK.cpp90
-rw-r--r--src/simulation/elements/STKM.cpp86
-rw-r--r--src/simulation/elements/STKM2.cpp84
-rw-r--r--src/simulation/elements/STNE.cpp84
-rw-r--r--src/simulation/elements/STOR.cpp86
-rw-r--r--src/simulation/elements/SWCH.cpp86
-rw-r--r--src/simulation/elements/TESC.cpp84
-rw-r--r--src/simulation/elements/THDR.cpp86
-rw-r--r--src/simulation/elements/THRM.cpp86
-rw-r--r--src/simulation/elements/TRON.cpp86
-rw-r--r--src/simulation/elements/TSNS.cpp88
-rw-r--r--src/simulation/elements/TTAN.cpp80
-rw-r--r--src/simulation/elements/URAN.cpp84
-rw-r--r--src/simulation/elements/VIBR.cpp6
-rw-r--r--src/simulation/elements/VINE.cpp86
-rw-r--r--src/simulation/elements/VOID.cpp84
-rw-r--r--src/simulation/elements/WARP.cpp86
-rw-r--r--src/simulation/elements/WATR.cpp86
-rw-r--r--src/simulation/elements/WAX.cpp84
-rw-r--r--src/simulation/elements/WHOL.cpp84
-rw-r--r--src/simulation/elements/WIFI.cpp86
-rw-r--r--src/simulation/elements/WIRE.cpp91
-rw-r--r--src/simulation/elements/WTRV.cpp86
-rw-r--r--src/simulation/elements/YEST.cpp86
169 files changed, 7243 insertions, 7245 deletions
diff --git a/src/simulation/Elements.h b/src/simulation/Elements.h
index e0dfcee..73a7079 100644
--- a/src/simulation/Elements.h
+++ b/src/simulation/Elements.h
@@ -46,6 +46,8 @@
#define GRAPHICS_FUNC_ARGS Renderer * ren, Particle *cpart, int nx, int ny, int *pixel_mode, int* cola, int *colr, int *colg, int *colb, int *firea, int *firer, int *fireg, int *fireb
#define GRAPHICS_FUNC_SUBCALL_ARGS ren, cpart, nx, ny, pixel_mode, cola, colr, colg, colb, firea, firer, fireg, fireb
+#define BOUNDS_CHECK x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES
+
#define SPC_AIR 236
#define SPC_HEAT 237
#define SPC_COOL 238
diff --git a/src/simulation/elements/116.cpp b/src/simulation/elements/116.cpp
index 9697c97..bd359e8 100644
--- a/src/simulation/elements/116.cpp
+++ b/src/simulation/elements/116.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_116 PT_116 116
Element_116::Element_116()
{
- Identifier = "DEFAULT_PT_116";
- Name = "EQVE";
- Colour = PIXPACK(0xFFE0A0);
- MenuVisible = 0;
- MenuSection = SC_CRACKER2;
- Enabled = 1;
-
- Advection = 0.7f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.80f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 30;
-
- Weight = 85;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Shared velocity test";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_116";
+ Name = "EQVE";
+ Colour = PIXPACK(0xFFE0A0);
+ MenuVisible = 0;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 0.7f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.80f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 85;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Shared velocity test";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+
}
Element_116::~Element_116() {} \ No newline at end of file
diff --git a/src/simulation/elements/146.cpp b/src/simulation/elements/146.cpp
index 51f4d3b..173d435 100644
--- a/src/simulation/elements/146.cpp
+++ b/src/simulation/elements/146.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_146 PT_146 146
Element_146::Element_146()
{
- Identifier = "DEFAULT_PT_146";
- Name = "BRAN";
- Colour = PIXPACK(0xCCCC00);
- MenuVisible = 0;
- MenuSection = SC_LIFE;
- Enabled = 0;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = 9000.0f;
- HeatConduct = 40;
- Description = "Brian 6 S6/B246/3";
-
- State = ST_NONE;
- Properties = TYPE_SOLID|PROP_LIFE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_146";
+ Name = "BRAN";
+ Colour = PIXPACK(0xCCCC00);
+ MenuVisible = 0;
+ MenuSection = SC_LIFE;
+ Enabled = 0;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = 9000.0f;
+ HeatConduct = 40;
+ Description = "Brian 6 S6/B246/3";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID|PROP_LIFE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+
}
Element_146::~Element_146() {} \ No newline at end of file
diff --git a/src/simulation/elements/ACEL.cpp b/src/simulation/elements/ACEL.cpp
index 12f408c..c5d0f38 100644
--- a/src/simulation/elements/ACEL.cpp
+++ b/src/simulation/elements/ACEL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_ACEL PT_ACEL 137
Element_ACEL::Element_ACEL()
{
- Identifier = "DEFAULT_PT_ACEL";
- Name = "ACEL";
- Colour = PIXPACK(0x0099CC);
- MenuVisible = 1;
- MenuSection = SC_FORCE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Accelerator";
-
- State = ST_NONE;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_ACEL::update;
- Graphics = &Element_ACEL::graphics;
+ Identifier = "DEFAULT_PT_ACEL";
+ Name = "ACEL";
+ Colour = PIXPACK(0x0099CC);
+ MenuVisible = 1;
+ MenuSection = SC_FORCE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Accelerator";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_ACEL::update;
+ Graphics = &Element_ACEL::graphics;
}
//#TPT-Directive ElementHeader Element_ACEL static int update(UPDATE_FUNC_ARGS)
@@ -63,7 +63,7 @@ int Element_ACEL::update(UPDATE_FUNC_ARGS)
parts[i].tmp = 0;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry) && !(rx && ry))
+ if (BOUNDS_CHECK && (rx || ry) && !(rx && ry))
{
r = pmap[y+ry][x+rx];
if(!r)
diff --git a/src/simulation/elements/ACID.cpp b/src/simulation/elements/ACID.cpp
index 6501ba0..e078551 100644
--- a/src/simulation/elements/ACID.cpp
+++ b/src/simulation/elements/ACID.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_ACID PT_ACID 21
Element_ACID::Element_ACID()
{
- Identifier = "DEFAULT_PT_ACID";
- Name = "ACID";
- Colour = PIXPACK(0xED55FF);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 40;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 10;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 34;
- Description = "Dissolves almost everything.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_DEADLY;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_ACID::update;
- Graphics = &Element_ACID::graphics;
+ Identifier = "DEFAULT_PT_ACID";
+ Name = "ACID";
+ Colour = PIXPACK(0xED55FF);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 40;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 10;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 34;
+ Description = "Dissolves almost everything.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_DEADLY;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_ACID::update;
+ Graphics = &Element_ACID::graphics;
}
//#TPT-Directive ElementHeader Element_ACID static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_ACID::update(UPDATE_FUNC_ARGS)
int r, rx, ry, trade, np;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -99,7 +99,7 @@ int Element_ACID::update(UPDATE_FUNC_ARGS)
{
rx = rand()%5-2;
ry = rand()%5-2;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/AMTR.cpp b/src/simulation/elements/AMTR.cpp
index 6f12187..ccd166a 100644
--- a/src/simulation/elements/AMTR.cpp
+++ b/src/simulation/elements/AMTR.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_AMTR PT_AMTR 72
Element_AMTR::Element_AMTR()
{
- Identifier = "DEFAULT_PT_AMTR";
- Name = "AMTR";
- Colour = PIXPACK(0x808080);
- MenuVisible = 1;
- MenuSection = SC_NUCLEAR;
- Enabled = 1;
-
- Advection = 0.7f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.80f;
- Collision = 0.00f;
- Gravity = 0.10f;
- Diffusion = 1.00f;
- HotAir = 0.0000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Anti-Matter, Destroys a majority of particles";
-
- State = ST_NONE;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_AMTR::update;
-
+ Identifier = "DEFAULT_PT_AMTR";
+ Name = "AMTR";
+ Colour = PIXPACK(0x808080);
+ MenuVisible = 1;
+ MenuSection = SC_NUCLEAR;
+ Enabled = 1;
+
+ Advection = 0.7f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.80f;
+ Collision = 0.00f;
+ Gravity = 0.10f;
+ Diffusion = 1.00f;
+ HotAir = 0.0000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Anti-Matter, Destroys a majority of particles";
+
+ State = ST_NONE;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_AMTR::update;
+
}
//#TPT-Directive ElementHeader Element_AMTR static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_AMTR::update(UPDATE_FUNC_ARGS)
int r, rx, ry, rt;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/ANAR.cpp b/src/simulation/elements/ANAR.cpp
index aa88afb..a00cb66 100644
--- a/src/simulation/elements/ANAR.cpp
+++ b/src/simulation/elements/ANAR.cpp
@@ -2,60 +2,60 @@
//#TPT-Directive ElementClass Element_ANAR PT_ANAR 113
Element_ANAR::Element_ANAR()
{
- Identifier = "DEFAULT_PT_ANAR";
- Name = "ANAR";
- Colour = PIXPACK(0xFFFFEE);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = -0.7f;
- AirDrag = -0.02f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.80f;
- Collision = 0.1f;
- Gravity = -0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 30;
-
- Weight = 85;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Very light dust. Behaves opposite gravity";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_ANAR::update;
-
+ Identifier = "DEFAULT_PT_ANAR";
+ Name = "ANAR";
+ Colour = PIXPACK(0xFFFFEE);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = -0.7f;
+ AirDrag = -0.02f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.80f;
+ Collision = 0.1f;
+ Gravity = -0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 85;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Very light dust. Behaves opposite gravity";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_ANAR::update;
+
}
//#TPT-Directive ElementHeader Element_ANAR static int update(UPDATE_FUNC_ARGS)
int Element_ANAR::update(UPDATE_FUNC_ARGS)
{
int r, rx, ry;
-
+
//if (parts[i].temp >= 0.23)
// parts[i].temp --;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/ARAY.cpp b/src/simulation/elements/ARAY.cpp
index 85dfc52..7da2621 100644
--- a/src/simulation/elements/ARAY.cpp
+++ b/src/simulation/elements/ARAY.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_ARAY PT_ARAY 126
Element_ARAY::Element_ARAY()
{
- Identifier = "DEFAULT_PT_ARAY";
- Name = "ARAY";
- Colour = PIXPACK(0xFFBB00);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Ray Emitter. Rays create points when they collide";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_ARAY::update;
-
+ Identifier = "DEFAULT_PT_ARAY";
+ Name = "ARAY";
+ Colour = PIXPACK(0xFFBB00);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Ray Emitter. Rays create points when they collide";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_ARAY::update;
+
}
//#TPT-Directive ElementHeader Element_ARAY static int update(UPDATE_FUNC_ARGS)
@@ -53,7 +53,7 @@ int Element_ARAY::update(UPDATE_FUNC_ARGS)
if (parts[i].life==0) {
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/BANG.cpp b/src/simulation/elements/BANG.cpp
index 9d9bfbb..37ada4a 100644
--- a/src/simulation/elements/BANG.cpp
+++ b/src/simulation/elements/BANG.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BANG PT_BANG 139
Element_BANG::Element_BANG()
{
- Identifier = "DEFAULT_PT_BANG";
- Name = "TNT";
- Colour = PIXPACK(0xC05050);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 88;
- Description = "Explosive.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID | PROP_NEUTPENETRATE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_BANG::update;
-
+ Identifier = "DEFAULT_PT_BANG";
+ Name = "TNT";
+ Colour = PIXPACK(0xC05050);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 88;
+ Description = "Explosive.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID | PROP_NEUTPENETRATE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_BANG::update;
+
}
//#TPT-Directive ElementHeader Element_BANG static int update(UPDATE_FUNC_ARGS)
@@ -57,7 +57,7 @@ int Element_BANG::update(UPDATE_FUNC_ARGS)
else
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/BCLN.cpp b/src/simulation/elements/BCLN.cpp
index de10464..ecec766 100644
--- a/src/simulation/elements/BCLN.cpp
+++ b/src/simulation/elements/BCLN.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BCLN PT_BCLN 93
Element_BCLN::Element_BCLN()
{
- Identifier = "DEFAULT_PT_BCLN";
- Name = "BCLN";
- Colour = PIXPACK(0xFFD040);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.97f;
- Loss = 0.50f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 12;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Breakable Clone.";
-
- State = ST_NONE;
- Properties = TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_BCLN::update;
-
+ Identifier = "DEFAULT_PT_BCLN";
+ Name = "BCLN";
+ Colour = PIXPACK(0xFFD040);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.97f;
+ Loss = 0.50f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 12;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Breakable Clone.";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_BCLN::update;
+
}
//#TPT-Directive ElementHeader Element_BCLN static int update(UPDATE_FUNC_ARGS)
@@ -62,7 +62,7 @@ int Element_BCLN::update(UPDATE_FUNC_ARGS)
int r, rx, ry, rt;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
+ if (BOUNDS_CHECK)
{
r = sim->photons[y+ry][x+rx];
if (!r)
@@ -71,9 +71,9 @@ int Element_BCLN::update(UPDATE_FUNC_ARGS)
continue;
rt = r&0xFF;
if (rt!=PT_CLNE && rt!=PT_PCLN &&
- rt!=PT_BCLN && rt!=PT_STKM &&
- rt!=PT_PBCN && rt!=PT_STKM2 &&
- rt<PT_NUM)
+ rt!=PT_BCLN && rt!=PT_STKM &&
+ rt!=PT_PBCN && rt!=PT_STKM2 &&
+ rt<PT_NUM)
{
parts[i].ctype = rt;
if (rt==PT_LIFE || rt==PT_LAVA)
diff --git a/src/simulation/elements/BCOL.cpp b/src/simulation/elements/BCOL.cpp
index ff92f8f..3088dcf 100644
--- a/src/simulation/elements/BCOL.cpp
+++ b/src/simulation/elements/BCOL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BCOL PT_BCOL 73
Element_BCOL::Element_BCOL()
{
- Identifier = "DEFAULT_PT_BCOL";
- Name = "BCOL";
- Colour = PIXPACK(0x333333);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.95f;
- Collision = -0.1f;
- Gravity = 0.3f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 5;
- Hardness = 2;
-
- Weight = 90;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 150;
- Description = "Broken Coal. Heavy particles. See COAL";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_BCOL::update;
- Graphics = &Element_BCOL::graphics;
+ Identifier = "DEFAULT_PT_BCOL";
+ Name = "BCOL";
+ Colour = PIXPACK(0x333333);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.95f;
+ Collision = -0.1f;
+ Gravity = 0.3f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 5;
+ Hardness = 2;
+
+ Weight = 90;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 150;
+ Description = "Broken Coal. Heavy particles. See COAL";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_BCOL::update;
+ Graphics = &Element_BCOL::graphics;
}
//#TPT-Directive ElementHeader Element_BCOL static int update(UPDATE_FUNC_ARGS)
@@ -60,7 +60,7 @@ int Element_BCOL::update(UPDATE_FUNC_ARGS)
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -76,7 +76,7 @@ int Element_BCOL::update(UPDATE_FUNC_ARGS)
if (parts[r>>8].ctype == PT_IRON && !(rand()%500)) {
parts[r>>8].ctype = PT_METL;
sim->kill_part(i);
- return 1;
+ return 1;
}
}
}
@@ -87,7 +87,7 @@ int Element_BCOL::update(UPDATE_FUNC_ARGS)
{
rx = rand()%5-2;
ry = rand()%5-2;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/BGLA.cpp b/src/simulation/elements/BGLA.cpp
index 79e7fe2..12c779a 100644
--- a/src/simulation/elements/BGLA.cpp
+++ b/src/simulation/elements/BGLA.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BGLA PT_BGLA 47
Element_BGLA::Element_BGLA()
{
- Identifier = "DEFAULT_PT_BGLA";
- Name = "BGLA";
- Colour = PIXPACK(0x606060);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.95f;
- Collision = -0.1f;
- Gravity = 0.3f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 5;
- Hardness = 0;
-
- Weight = 90;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 150;
- Description = "Broken Glass, Heavy particles. Meltable. Bagels.";
-
- State = ST_SOLID;
- Properties = TYPE_PART | PROP_HOT_GLOW;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1973.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_BGLA";
+ Name = "BGLA";
+ Colour = PIXPACK(0x606060);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.95f;
+ Collision = -0.1f;
+ Gravity = 0.3f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 5;
+ Hardness = 0;
+
+ Weight = 90;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 150;
+ Description = "Broken Glass, Heavy particles. Meltable. Bagels.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART | PROP_HOT_GLOW;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1973.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = NULL;
+
}
Element_BGLA::~Element_BGLA() {} \ No newline at end of file
diff --git a/src/simulation/elements/BHOL.cpp b/src/simulation/elements/BHOL.cpp
index 35eda8c..8139e7d 100644
--- a/src/simulation/elements/BHOL.cpp
+++ b/src/simulation/elements/BHOL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BHOL PT_BHOL 39
Element_BHOL::Element_BHOL()
{
- Identifier = "DEFAULT_PT_BHOL";
- Name = "VACU";
- Colour = PIXPACK(0x303030);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.95f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = -0.01f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+70.0f+273.15f;
- HeatConduct = 255;
- Description = "Vacuum, sucks in other particles and heats up.";
-
- State = ST_NONE;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_BHOL";
+ Name = "VACU";
+ Colour = PIXPACK(0x303030);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.95f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = -0.01f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+70.0f+273.15f;
+ HeatConduct = 255;
+ Description = "Vacuum, sucks in other particles and heats up.";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+
}
Element_BHOL::~Element_BHOL() {} \ No newline at end of file
diff --git a/src/simulation/elements/BIZR.cpp b/src/simulation/elements/BIZR.cpp
index 1df678b..d821190 100644
--- a/src/simulation/elements/BIZR.cpp
+++ b/src/simulation/elements/BIZR.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BIZR PT_BIZR 103
Element_BIZR::Element_BIZR()
{
- Identifier = "DEFAULT_PT_BIZR";
- Name = "BIZR";
- Colour = PIXPACK(0x00FF77);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 30;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 29;
- Description = "Bizarre... contradicts the normal state changes.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 100.0f;
- LowTemperatureTransition = PT_BIZRG;
- HighTemperature = 400.0f;
- HighTemperatureTransition = PT_BIZRS;
-
- Update = &Element_BIZR::update;
- Graphics = &Element_BIZR::graphics;
+ Identifier = "DEFAULT_PT_BIZR";
+ Name = "BIZR";
+ Colour = PIXPACK(0x00FF77);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 30;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 29;
+ Description = "Bizarre... contradicts the normal state changes.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 100.0f;
+ LowTemperatureTransition = PT_BIZRG;
+ HighTemperature = 400.0f;
+ HighTemperatureTransition = PT_BIZRS;
+
+ Update = &Element_BIZR::update;
+ Graphics = &Element_BIZR::graphics;
}
//#TPT-Directive ElementHeader Element_BIZR static int update(UPDATE_FUNC_ARGS)
@@ -55,7 +55,7 @@ int Element_BIZR::update(UPDATE_FUNC_ARGS)
if(parts[i].dcolour){
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/BIZRG.cpp b/src/simulation/elements/BIZRG.cpp
index 48856bd..04b9bbb 100644
--- a/src/simulation/elements/BIZRG.cpp
+++ b/src/simulation/elements/BIZRG.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BIZRG PT_BIZRG 104
Element_BIZRG::Element_BIZRG()
{
- Identifier = "DEFAULT_PT_BIZRG";
- Name = "BIZG";
- Colour = PIXPACK(0x00FFBB);
- MenuVisible = 1;
- MenuSection = SC_CRACKER2;
- Enabled = 1;
-
- Advection = 1.0f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.30f;
- Collision = -0.1f;
- Gravity = 0.0f;
- Diffusion = 2.75f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 1;
-
- Temperature = R_TEMP-200.0f+273.15f;
- HeatConduct = 42;
- Description = "Bizarre gas";
-
- State = ST_GAS;
- Properties = TYPE_GAS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 100.0f;
- HighTemperatureTransition = PT_BIZR;
-
- Update = &Element_BIZR::update;
- Graphics = &Element_BIZR::graphics;
+ Identifier = "DEFAULT_PT_BIZRG";
+ Name = "BIZG";
+ Colour = PIXPACK(0x00FFBB);
+ MenuVisible = 1;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 1.0f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.30f;
+ Collision = -0.1f;
+ Gravity = 0.0f;
+ Diffusion = 2.75f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 1;
+
+ Temperature = R_TEMP-200.0f+273.15f;
+ HeatConduct = 42;
+ Description = "Bizarre gas";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 100.0f;
+ HighTemperatureTransition = PT_BIZR;
+
+ Update = &Element_BIZR::update;
+ Graphics = &Element_BIZR::graphics;
}
//BIZRG update is in BIZR.cpp
Element_BIZRG::~Element_BIZRG() {}
diff --git a/src/simulation/elements/BIZRS.cpp b/src/simulation/elements/BIZRS.cpp
index fe2a8cf..7ef6ebf 100644
--- a/src/simulation/elements/BIZRS.cpp
+++ b/src/simulation/elements/BIZRS.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BIZRS PT_BIZRS 105
Element_BIZRS::Element_BIZRS()
{
- Identifier = "DEFAULT_PT_BIZRS";
- Name = "BIZS";
- Colour = PIXPACK(0x00E455);
- MenuVisible = 1;
- MenuSection = SC_CRACKER2;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 1;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+300.0f+273.15f;
- HeatConduct = 251;
- Description = "Bizarre solid";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 400.0f;
- LowTemperatureTransition = PT_BIZR;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_BIZR::update;
- Graphics = &Element_BIZR::graphics;
+ Identifier = "DEFAULT_PT_BIZRS";
+ Name = "BIZS";
+ Colour = PIXPACK(0x00E455);
+ MenuVisible = 1;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 1;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+300.0f+273.15f;
+ HeatConduct = 251;
+ Description = "Bizarre solid";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 400.0f;
+ LowTemperatureTransition = PT_BIZR;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_BIZR::update;
+ Graphics = &Element_BIZR::graphics;
}
//BIZRS update is in BIZR.cpp
Element_BIZRS::~Element_BIZRS() {}
diff --git a/src/simulation/elements/BMTL.cpp b/src/simulation/elements/BMTL.cpp
index 9f15c5e..65a76b7 100644
--- a/src/simulation/elements/BMTL.cpp
+++ b/src/simulation/elements/BMTL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BMTL PT_BMTL 29
Element_BMTL::Element_BMTL()
{
- Identifier = "DEFAULT_PT_BMTL";
- Name = "BMTL";
- Colour = PIXPACK(0x505070);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 1;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Breakable metal.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = 1.0f;
- HighPressureTransition = ST;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1273.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = &Element_BMTL::update;
-
+ Identifier = "DEFAULT_PT_BMTL";
+ Name = "BMTL";
+ Colour = PIXPACK(0x505070);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 1;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Breakable metal.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = 1.0f;
+ HighPressureTransition = ST;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1273.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = &Element_BMTL::update;
+
}
//#TPT-Directive ElementHeader Element_BMTL static int update(UPDATE_FUNC_ARGS)
@@ -55,7 +55,7 @@ int Element_BMTL::update(UPDATE_FUNC_ARGS)
parts[i].tmp--;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/BOMB.cpp b/src/simulation/elements/BOMB.cpp
index 0335e59..61902ee 100644
--- a/src/simulation/elements/BOMB.cpp
+++ b/src/simulation/elements/BOMB.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BOMB PT_BOMB 129
Element_BOMB::Element_BOMB()
{
- Identifier = "DEFAULT_PT_BOMB";
- Name = "BOMB";
- Colour = PIXPACK(0xFFF288);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 30;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 29;
- Description = "Bomb.";
-
- State = ST_NONE;
- Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC|PROP_SPARKSETTLE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_BOMB::update;
- Graphics = &Element_BOMB::graphics;
+ Identifier = "DEFAULT_PT_BOMB";
+ Name = "BOMB";
+ Colour = PIXPACK(0xFFF288);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 30;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 29;
+ Description = "Bomb.";
+
+ State = ST_NONE;
+ Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC|PROP_SPARKSETTLE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_BOMB::update;
+ Graphics = &Element_BOMB::graphics;
}
//#TPT-Directive ElementHeader Element_BOMB static int update(UPDATE_FUNC_ARGS)
@@ -53,7 +53,7 @@ int Element_BOMB::update(UPDATE_FUNC_ARGS)
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/BOYL.cpp b/src/simulation/elements/BOYL.cpp
index 3a02d65..c4775ab 100644
--- a/src/simulation/elements/BOYL.cpp
+++ b/src/simulation/elements/BOYL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BOYL PT_BOYL 141
Element_BOYL::Element_BOYL()
{
- Identifier = "DEFAULT_PT_BOYL";
- Name = "BOYL";
- Colour = PIXPACK(0x0A3200);
- MenuVisible = 1;
- MenuSection = SC_GAS;
- Enabled = 1;
-
- Advection = 1.0f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.30f;
- Collision = -0.1f;
- Gravity = 0.0f;
- Diffusion = 0.18f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 1;
-
- Temperature = R_TEMP+2.0f +273.15f;
- HeatConduct = 42;
- Description = "Boyle, variable pressure gas. Expands when heated.";
-
- State = ST_GAS;
- Properties = TYPE_GAS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_BOYL::update;
-
+ Identifier = "DEFAULT_PT_BOYL";
+ Name = "BOYL";
+ Colour = PIXPACK(0x0A3200);
+ MenuVisible = 1;
+ MenuSection = SC_GAS;
+ Enabled = 1;
+
+ Advection = 1.0f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.30f;
+ Collision = -0.1f;
+ Gravity = 0.0f;
+ Diffusion = 0.18f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 1;
+
+ Temperature = R_TEMP+2.0f +273.15f;
+ HeatConduct = 42;
+ Description = "Boyle, variable pressure gas. Expands when heated.";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_BOYL::update;
+
}
//#TPT-Directive ElementHeader Element_BOYL static int update(UPDATE_FUNC_ARGS)
@@ -70,8 +70,7 @@ int Element_BOYL::update(UPDATE_FUNC_ARGS)
}
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 &&
- x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/BRAY.cpp b/src/simulation/elements/BRAY.cpp
index dfcd080..7c43d42 100644
--- a/src/simulation/elements/BRAY.cpp
+++ b/src/simulation/elements/BRAY.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BRAY PT_BRAY 127
Element_BRAY::Element_BRAY()
{
- Identifier = "DEFAULT_PT_BRAY";
- Name = "BRAY";
- Colour = PIXPACK(0xFFFFFF);
- MenuVisible = 0;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Ray Point. Rays create points when they collide";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
- Graphics = &Element_BRAY::graphics;
+ Identifier = "DEFAULT_PT_BRAY";
+ Name = "BRAY";
+ Colour = PIXPACK(0xFFFFFF);
+ MenuVisible = 0;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Ray Point. Rays create points when they collide";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+ Graphics = &Element_BRAY::graphics;
}
//#TPT-Directive ElementHeader Element_BRAY static int graphics(GRAPHICS_FUNC_ARGS)
@@ -61,7 +61,7 @@ int Element_BRAY::graphics(GRAPHICS_FUNC_ARGS)
*colr = 0;
for (x=0; x<12; x++) {
*colr += (cpart->ctype >> (x+18)) & 1;
- *colb += (cpart->ctype >> x) & 1;
+ *colb += (cpart->ctype >> x) & 1;
}
for (x=0; x<12; x++)
*colg += (cpart->ctype >> (x+9)) & 1;
@@ -81,7 +81,7 @@ int Element_BRAY::graphics(GRAPHICS_FUNC_ARGS)
*colr = 0;
for (x=0; x<12; x++) {
*colr += (cpart->ctype >> (x+18)) & 1;
- *colb += (cpart->ctype >> x) & 1;
+ *colb += (cpart->ctype >> x) & 1;
}
for (x=0; x<12; x++)
*colg += (cpart->ctype >> (x+9)) & 1;
diff --git a/src/simulation/elements/BRCK.cpp b/src/simulation/elements/BRCK.cpp
index 6769aa3..da96b87 100644
--- a/src/simulation/elements/BRCK.cpp
+++ b/src/simulation/elements/BRCK.cpp
@@ -2,64 +2,64 @@
//#TPT-Directive ElementClass Element_BRCK PT_BRCK 67
Element_BRCK::Element_BRCK()
{
- Identifier = "DEFAULT_PT_BRCK";
- Name = "BRCK";
- Colour = PIXPACK(0x808080);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Brick, breakable building material.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_HOT_GLOW;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = 8.8f;
- HighPressureTransition = PT_STNE;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1223.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = NULL;
- Graphics = &Element_BRCK::graphics;
+ Identifier = "DEFAULT_PT_BRCK";
+ Name = "BRCK";
+ Colour = PIXPACK(0x808080);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Brick, breakable building material.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_HOT_GLOW;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = 8.8f;
+ HighPressureTransition = PT_STNE;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1223.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = NULL;
+ Graphics = &Element_BRCK::graphics;
}
//#TPT-Directive ElementHeader Element_BRCK static int graphics(GRAPHICS_FUNC_ARGS)
int Element_BRCK::graphics(GRAPHICS_FUNC_ARGS)
{
- if (cpart->tmp == 1)
- {
- *pixel_mode |= FIRE_ADD;
- *colb += 100;
+ if (cpart->tmp == 1)
+ {
+ *pixel_mode |= FIRE_ADD;
+ *colb += 100;
- *firea = 40;
- *firer = *colr;
- *fireg = *colg;
- *fireb = *colb;
- }
- return 0;
+ *firea = 40;
+ *firer = *colr;
+ *fireg = *colg;
+ *fireb = *colb;
+ }
+ return 0;
}
Element_BRCK::~Element_BRCK() {} \ No newline at end of file
diff --git a/src/simulation/elements/BREC.cpp b/src/simulation/elements/BREC.cpp
index d1de90e..1c09c64 100644
--- a/src/simulation/elements/BREC.cpp
+++ b/src/simulation/elements/BREC.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BREC PT_BREC 135
Element_BREC::Element_BREC()
{
- Identifier = "DEFAULT_PT_BREC";
- Name = "BREL";
- Colour = PIXPACK(0x707060);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.95f;
- Collision = -0.1f;
- Gravity = 0.18f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 2;
- Hardness = 2;
-
- Weight = 90;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 211;
- Description = "Broken electronics";
-
- State = ST_SOLID;
- Properties = TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_BREC::update;
-
+ Identifier = "DEFAULT_PT_BREC";
+ Name = "BREL";
+ Colour = PIXPACK(0x707060);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.95f;
+ Collision = -0.1f;
+ Gravity = 0.18f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 2;
+ Hardness = 2;
+
+ Weight = 90;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 211;
+ Description = "Broken electronics";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_BREC::update;
+
}
//#TPT-Directive ElementHeader Element_BREC static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/BRMT.cpp b/src/simulation/elements/BRMT.cpp
index 5ac2315..cf4f99d 100644
--- a/src/simulation/elements/BRMT.cpp
+++ b/src/simulation/elements/BRMT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BRMT PT_BRMT 30
Element_BRMT::Element_BRMT()
{
- Identifier = "DEFAULT_PT_BRMT";
- Name = "BRMT";
- Colour = PIXPACK(0x705060);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.95f;
- Collision = -0.1f;
- Gravity = 0.3f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 2;
- Hardness = 2;
-
- Weight = 90;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 211;
- Description = "Broken metal.";
-
- State = ST_SOLID;
- Properties = TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1273.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = &Element_BRMT::update;
-
+ Identifier = "DEFAULT_PT_BRMT";
+ Name = "BRMT";
+ Colour = PIXPACK(0x705060);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.95f;
+ Collision = -0.1f;
+ Gravity = 0.3f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 2;
+ Hardness = 2;
+
+ Weight = 90;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 211;
+ Description = "Broken metal.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1273.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = &Element_BRMT::update;
+
}
//#TPT-Directive ElementHeader Element_BRMT static int update(UPDATE_FUNC_ARGS)
@@ -57,7 +57,7 @@ int Element_BRMT::update(UPDATE_FUNC_ARGS)
tempFactor = 2;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/BTRY.cpp b/src/simulation/elements/BTRY.cpp
index 4f1e810..2458313 100644
--- a/src/simulation/elements/BTRY.cpp
+++ b/src/simulation/elements/BTRY.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_BTRY PT_BTRY 53
Element_BTRY::Element_BTRY()
{
- Identifier = "DEFAULT_PT_BTRY";
- Name = "BTRY";
- Colour = PIXPACK(0x858505);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Solid. Generates Electricity.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 2273.0f;
- HighTemperatureTransition = PT_PLSM;
-
- Update = &Element_BTRY::update;
-
+ Identifier = "DEFAULT_PT_BTRY";
+ Name = "BTRY";
+ Colour = PIXPACK(0x858505);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Solid. Generates Electricity.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 2273.0f;
+ HighTemperatureTransition = PT_PLSM;
+
+ Update = &Element_BTRY::update;
+
}
//#TPT-Directive ElementHeader Element_BTRY static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_BTRY::update(UPDATE_FUNC_ARGS)
int r, rx, ry, rt;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry) && abs(rx)+abs(ry)<4)
+ if (BOUNDS_CHECK && (rx || ry) && abs(rx)+abs(ry)<4)
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/BVBR.cpp b/src/simulation/elements/BVBR.cpp
index dfff186..6cb551c 100644
--- a/src/simulation/elements/BVBR.cpp
+++ b/src/simulation/elements/BVBR.cpp
@@ -2,49 +2,49 @@
//#TPT-Directive ElementClass Element_BVBR PT_BVBR 166
Element_BVBR::Element_BVBR()
{
- Identifier = "DEFAULT_PT_BVBR";
- Name = "BVBR";
- Colour = PIXPACK(0x005000);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.3f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.95f;
- Loss = 0.80f;
- Collision = 0.0f;
- Gravity = 0.15f;
- Diffusion = 0.00f;
- HotAir = 0.0000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 67;
-
- Temperature = 273.15f;
- HeatConduct = 164;
- Description = "Broken vibranium.";
-
- State = ST_SOLID;
- Properties = TYPE_PART|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_VIBR::update;
+ Identifier = "DEFAULT_PT_BVBR";
+ Name = "BVBR";
+ Colour = PIXPACK(0x005000);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.3f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.95f;
+ Loss = 0.80f;
+ Collision = 0.0f;
+ Gravity = 0.15f;
+ Diffusion = 0.00f;
+ HotAir = 0.0000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 67;
+
+ Temperature = 273.15f;
+ HeatConduct = 164;
+ Description = "Broken vibranium.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_VIBR::update;
Graphics = &Element_VIBR::graphics;
-
+
}
Element_BVBR::~Element_BVBR() {} \ No newline at end of file
diff --git a/src/simulation/elements/C5.cpp b/src/simulation/elements/C5.cpp
index c971ce0..0141991 100644
--- a/src/simulation/elements/C5.cpp
+++ b/src/simulation/elements/C5.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_C5 PT_C5 130
Element_C5::Element_C5()
{
- Identifier = "DEFAULT_PT_C5";
- Name = "C-5";
- Colour = PIXPACK(0x2050E0);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 88;
- Description = "Cold explosive";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID | PROP_NEUTPENETRATE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_C5::update;
-
+ Identifier = "DEFAULT_PT_C5";
+ Name = "C-5";
+ Colour = PIXPACK(0x2050E0);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 88;
+ Description = "Cold explosive";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID | PROP_NEUTPENETRATE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_C5::update;
+
}
//#TPT-Directive ElementHeader Element_C5 static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_C5::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/CAUS.cpp b/src/simulation/elements/CAUS.cpp
index a8fc0da..2a97fd2 100644
--- a/src/simulation/elements/CAUS.cpp
+++ b/src/simulation/elements/CAUS.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_CAUS PT_CAUS 86
Element_CAUS::Element_CAUS()
{
- Identifier = "DEFAULT_PT_CAUS";
- Name = "CAUS";
- Colour = PIXPACK(0x80FFA0);
- MenuVisible = 1;
- MenuSection = SC_GAS;
- Enabled = 1;
-
- Advection = 2.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.30f;
- Collision = -0.1f;
- Gravity = 0.0f;
- Diffusion = 1.50f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 1;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Caustic Gas, acts like Acid";
-
- State = ST_GAS;
- Properties = TYPE_GAS|PROP_DEADLY;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_CAUS::update;
-
+ Identifier = "DEFAULT_PT_CAUS";
+ Name = "CAUS";
+ Colour = PIXPACK(0x80FFA0);
+ MenuVisible = 1;
+ MenuSection = SC_GAS;
+ Enabled = 1;
+
+ Advection = 2.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.30f;
+ Collision = -0.1f;
+ Gravity = 0.0f;
+ Diffusion = 1.50f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 1;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Caustic Gas, acts like Acid";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS|PROP_DEADLY;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_CAUS::update;
+
}
//#TPT-Directive ElementHeader Element_CAUS static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_CAUS::update(UPDATE_FUNC_ARGS)
int r, rx, ry, trade, np;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/CBNW.cpp b/src/simulation/elements/CBNW.cpp
index 59c6d66..2fd257a 100644
--- a/src/simulation/elements/CBNW.cpp
+++ b/src/simulation/elements/CBNW.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_CBNW PT_CBNW 82
Element_CBNW::Element_CBNW()
{
- Identifier = "DEFAULT_PT_CBNW";
- Name = "BUBW";
- Colour = PIXPACK(0x2030D0);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 30;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 29;
- Description = "Carbonated water. Conducts electricity. Freezes. Extinguishes fires.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 273.15f;
- LowTemperatureTransition = PT_ICEI;
- HighTemperature = 373.0f;
- HighTemperatureTransition = PT_WTRV;
-
- Update = &Element_CBNW::update;
- Graphics = &Element_CBNW::graphics;
+ Identifier = "DEFAULT_PT_CBNW";
+ Name = "BUBW";
+ Colour = PIXPACK(0x2030D0);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 30;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 29;
+ Description = "Carbonated water. Conducts electricity. Freezes. Extinguishes fires.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 273.15f;
+ LowTemperatureTransition = PT_ICEI;
+ HighTemperature = 373.0f;
+ HighTemperatureTransition = PT_WTRV;
+
+ Update = &Element_CBNW::update;
+ Graphics = &Element_CBNW::graphics;
}
//#TPT-Directive ElementHeader Element_CBNW static int update(UPDATE_FUNC_ARGS)
@@ -86,7 +86,7 @@ int Element_CBNW::update(UPDATE_FUNC_ARGS)
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/CLNE.cpp b/src/simulation/elements/CLNE.cpp
index 482d2c9..f0dffc2 100644
--- a/src/simulation/elements/CLNE.cpp
+++ b/src/simulation/elements/CLNE.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_CLNE PT_CLNE 9
Element_CLNE::Element_CLNE()
{
- Identifier = "DEFAULT_PT_CLNE";
- Name = "CLNE";
- Colour = PIXPACK(0xFFD010);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Solid. Duplicates any particles it touches.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_CLNE::update;
-
+ Identifier = "DEFAULT_PT_CLNE";
+ Name = "CLNE";
+ Colour = PIXPACK(0xFFD010);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Solid. Duplicates any particles it touches.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_CLNE::update;
+
}
//#TPT-Directive ElementHeader Element_CLNE static int update(UPDATE_FUNC_ARGS)
@@ -54,7 +54,7 @@ int Element_CLNE::update(UPDATE_FUNC_ARGS)
int r, rx, ry, rt;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
+ if (BOUNDS_CHECK)
{
r = sim->photons[y+ry][x+rx];
if (!r)
@@ -63,9 +63,9 @@ int Element_CLNE::update(UPDATE_FUNC_ARGS)
continue;
rt = r&0xFF;
if (rt!=PT_CLNE && rt!=PT_PCLN &&
- rt!=PT_BCLN && rt!=PT_STKM &&
- rt!=PT_PBCN && rt!=PT_STKM2 &&
- rt<PT_NUM)
+ rt!=PT_BCLN && rt!=PT_STKM &&
+ rt!=PT_PBCN && rt!=PT_STKM2 &&
+ rt<PT_NUM)
{
parts[i].ctype = rt;
if (rt==PT_LIFE || rt==PT_LAVA)
diff --git a/src/simulation/elements/CLST.cpp b/src/simulation/elements/CLST.cpp
index c7b5627..b8edcf3 100644
--- a/src/simulation/elements/CLST.cpp
+++ b/src/simulation/elements/CLST.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_CLST PT_CLST 155
Element_CLST::Element_CLST()
{
- Identifier = "DEFAULT_PT_CLST";
- Name = "CLST";
- Colour = PIXPACK(0xE4A4A4);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.7f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.2f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 2;
- Hardness = 2;
-
- Weight = 55;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Clay dust. Produces paste when mixed with water.";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1256.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = &Element_CLST::update;
- Graphics = &Element_CLST::graphics;
+ Identifier = "DEFAULT_PT_CLST";
+ Name = "CLST";
+ Colour = PIXPACK(0xE4A4A4);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.7f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.2f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 2;
+ Hardness = 2;
+
+ Weight = 55;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Clay dust. Produces paste when mixed with water.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1256.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = &Element_CLST::update;
+ Graphics = &Element_CLST::graphics;
}
//#TPT-Directive ElementHeader Element_CLST static int update(UPDATE_FUNC_ARGS)
@@ -53,7 +53,7 @@ int Element_CLST::update(UPDATE_FUNC_ARGS)
float cxy = 0;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/CNCT.cpp b/src/simulation/elements/CNCT.cpp
index 77f70be..4fa0808 100644
--- a/src/simulation/elements/CNCT.cpp
+++ b/src/simulation/elements/CNCT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_CNCT PT_CNCT 24
Element_CNCT::Element_CNCT()
{
- Identifier = "DEFAULT_PT_CNCT";
- Name = "CNCT";
- Colour = PIXPACK(0xC0C0C0);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.95f;
- Collision = -0.1f;
- Gravity = 0.3f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 2;
- Hardness = 2;
-
- Weight = 55;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 100;
- Description = "Concrete, stronger than stone.";
-
- State = ST_SOLID;
- Properties = TYPE_PART|PROP_HOT_GLOW;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1123.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_CNCT";
+ Name = "CNCT";
+ Colour = PIXPACK(0xC0C0C0);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.95f;
+ Collision = -0.1f;
+ Gravity = 0.3f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 2;
+ Hardness = 2;
+
+ Weight = 55;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 100;
+ Description = "Concrete, stronger than stone.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART|PROP_HOT_GLOW;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1123.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = NULL;
+
}
Element_CNCT::~Element_CNCT() {} \ No newline at end of file
diff --git a/src/simulation/elements/CO2.cpp b/src/simulation/elements/CO2.cpp
index 9eade3d..f30273c 100644
--- a/src/simulation/elements/CO2.cpp
+++ b/src/simulation/elements/CO2.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_CO2 PT_CO2 80
Element_CO2::Element_CO2()
{
- Identifier = "DEFAULT_PT_CO2";
- Name = "CO2";
- Colour = PIXPACK(0x666666);
- MenuVisible = 1;
- MenuSection = SC_GAS;
- Enabled = 1;
-
- Advection = 2.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.30f;
- Collision = -0.1f;
- Gravity = 0.1f;
- Diffusion = 1.0f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 1;
-
- Temperature = R_TEMP+273.15f;
- HeatConduct = 88;
- Description = "Carbon Dioxide";
-
- State = ST_GAS;
- Properties = TYPE_GAS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 194.65f;
- LowTemperatureTransition = PT_DRIC;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_CO2::update;
-
+ Identifier = "DEFAULT_PT_CO2";
+ Name = "CO2";
+ Colour = PIXPACK(0x666666);
+ MenuVisible = 1;
+ MenuSection = SC_GAS;
+ Enabled = 1;
+
+ Advection = 2.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.30f;
+ Collision = -0.1f;
+ Gravity = 0.1f;
+ Diffusion = 1.0f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 1;
+
+ Temperature = R_TEMP+273.15f;
+ HeatConduct = 88;
+ Description = "Carbon Dioxide";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 194.65f;
+ LowTemperatureTransition = PT_DRIC;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_CO2::update;
+
}
//#TPT-Directive ElementHeader Element_CO2 static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_CO2::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/COAL.cpp b/src/simulation/elements/COAL.cpp
index a418971..991d553 100644
--- a/src/simulation/elements/COAL.cpp
+++ b/src/simulation/elements/COAL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_COAL PT_COAL 59
Element_COAL::Element_COAL()
{
- Identifier = "DEFAULT_PT_COAL";
- Name = "COAL";
- Colour = PIXPACK(0x222222);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.0f;
- HotAir = 0.0f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 200;
- Description = "Solid. Burns slowly.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_COAL::update;
- Graphics = &Element_COAL::graphics;
+ Identifier = "DEFAULT_PT_COAL";
+ Name = "COAL";
+ Colour = PIXPACK(0x222222);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.0f;
+ HotAir = 0.0f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 200;
+ Description = "Solid. Burns slowly.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_COAL::update;
+ Graphics = &Element_COAL::graphics;
}
//#TPT-Directive ElementHeader Element_COAL static int update(UPDATE_FUNC_ARGS)
@@ -67,7 +67,7 @@ int Element_COAL::update(UPDATE_FUNC_ARGS)
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -94,7 +94,7 @@ int Element_COAL::update(UPDATE_FUNC_ARGS)
{
rx = rand()%5-2;
ry = rand()%5-2;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/CONV.cpp b/src/simulation/elements/CONV.cpp
index bb313ac..59c7b1c 100644
--- a/src/simulation/elements/CONV.cpp
+++ b/src/simulation/elements/CONV.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_CONV PT_CONV 85
Element_CONV::Element_CONV()
{
- Identifier = "DEFAULT_PT_CONV";
- Name = "CONV";
- Colour = PIXPACK(0x0AAB0A);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Solid. Converts everything into whatever it first touches.";
-
- State = ST_NONE;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_CONV::update;
-
+ Identifier = "DEFAULT_PT_CONV";
+ Name = "CONV";
+ Colour = PIXPACK(0x0AAB0A);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Solid. Converts everything into whatever it first touches.";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_CONV::update;
+
}
//#TPT-Directive ElementHeader Element_CONV static int update(UPDATE_FUNC_ARGS)
@@ -54,7 +54,7 @@ int Element_CONV::update(UPDATE_FUNC_ARGS)
{
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
+ if (BOUNDS_CHECK)
{
r = sim->photons[y+ry][x+rx];
if (!r)
@@ -62,9 +62,9 @@ int Element_CONV::update(UPDATE_FUNC_ARGS)
if (!r)
continue;
if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN &&
- (r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM &&
- (r&0xFF)!=PT_PBCN && (r&0xFF)!=PT_STKM2 &&
- (r&0xFF)!=PT_CONV && (r&0xFF)<PT_NUM)
+ (r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM &&
+ (r&0xFF)!=PT_PBCN && (r&0xFF)!=PT_STKM2 &&
+ (r&0xFF)!=PT_CONV && (r&0xFF)<PT_NUM)
{
parts[i].ctype = r&0xFF;
if ((r&0xFF)==PT_LIFE)
diff --git a/src/simulation/elements/CRAY.cpp b/src/simulation/elements/CRAY.cpp
index 7b56a09..38c3b9f 100644
--- a/src/simulation/elements/CRAY.cpp
+++ b/src/simulation/elements/CRAY.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_CRAY PT_CRAY 167
Element_CRAY::Element_CRAY()
{
- Identifier = "DEFAULT_PT_CRAY";
- Name = "CRAY";
- Colour = PIXPACK(0xBBFF00);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Particle Ray Emitter. Creates a beam of particles set by ctype, range is set by tmp";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_CRAY::update;
-
+ Identifier = "DEFAULT_PT_CRAY";
+ Name = "CRAY";
+ Colour = PIXPACK(0xBBFF00);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Particle Ray Emitter. Creates a beam of particles set by ctype, range is set by tmp";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_CRAY::update;
+
}
//#TPT-Directive ElementHeader Element_CRAY static int update(UPDATE_FUNC_ARGS)
@@ -55,7 +55,7 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
+ if (BOUNDS_CHECK)
{
r = sim->photons[y+ry][x+rx];
if (!r)
@@ -71,7 +71,7 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS)
} else if (parts[i].life==0) { // only fire when life is 0, but nothing sets the life right now
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/DCEL.cpp b/src/simulation/elements/DCEL.cpp
index e6bf79d..6e3a411 100644
--- a/src/simulation/elements/DCEL.cpp
+++ b/src/simulation/elements/DCEL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_DCEL PT_DCEL 138
Element_DCEL::Element_DCEL()
{
- Identifier = "DEFAULT_PT_DCEL";
- Name = "DCEL";
- Colour = PIXPACK(0x99CC00);
- MenuVisible = 1;
- MenuSection = SC_FORCE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Decelerator";
-
- State = ST_NONE;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_DCEL::update;
- Graphics = &Element_DCEL::graphics;
+ Identifier = "DEFAULT_PT_DCEL";
+ Name = "DCEL";
+ Colour = PIXPACK(0x99CC00);
+ MenuVisible = 1;
+ MenuSection = SC_FORCE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Decelerator";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_DCEL::update;
+ Graphics = &Element_DCEL::graphics;
}
//#TPT-Directive ElementHeader Element_DCEL static int update(UPDATE_FUNC_ARGS)
@@ -63,7 +63,7 @@ int Element_DCEL::update(UPDATE_FUNC_ARGS)
parts[i].tmp = 0;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry) && !(rx && ry))
+ if (BOUNDS_CHECK && (rx || ry) && !(rx && ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/DESL.cpp b/src/simulation/elements/DESL.cpp
index a79086d..7427363 100644
--- a/src/simulation/elements/DESL.cpp
+++ b/src/simulation/elements/DESL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_DESL PT_DESL 58
Element_DESL::Element_DESL()
{
- Identifier = "DEFAULT_PT_DESL";
- Name = "DESL";
- Colour = PIXPACK(0x440000);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 1.0f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.0f;
- HotAir = 0.0f * CFDS;
- Falldown = 2;
-
- Flammable = 2;
- Explosive = 0;
- Meltable = 0;
- Hardness = 5;
-
- Weight = 15;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 42;
- Description = "Liquid. Explodes under high pressure and temperatures";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = 5.0f;
- HighPressureTransition = PT_FIRE;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 335.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_DESL";
+ Name = "DESL";
+ Colour = PIXPACK(0x440000);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 1.0f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.0f;
+ HotAir = 0.0f * CFDS;
+ Falldown = 2;
+
+ Flammable = 2;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 5;
+
+ Weight = 15;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 42;
+ Description = "Liquid. Explodes under high pressure and temperatures";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = 5.0f;
+ HighPressureTransition = PT_FIRE;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 335.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = NULL;
+
}
Element_DESL::~Element_DESL() {} \ No newline at end of file
diff --git a/src/simulation/elements/DEST.cpp b/src/simulation/elements/DEST.cpp
index 73bc5cd..6dcca59 100644
--- a/src/simulation/elements/DEST.cpp
+++ b/src/simulation/elements/DEST.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_DEST PT_DEST 89
Element_DEST::Element_DEST()
{
- Identifier = "DEFAULT_PT_DEST";
- Name = "DEST";
- Colour = PIXPACK(0xFF3311);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = -0.05f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.95f;
- Loss = 0.95f;
- Collision = -0.1f;
- Gravity = 0.4f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 101;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 150;
- Description = "More destructive Bomb.";
-
- State = ST_SOLID;
- Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_DEST::update;
- Graphics = &Element_DEST::graphics;
+ Identifier = "DEFAULT_PT_DEST";
+ Name = "DEST";
+ Colour = PIXPACK(0xFF3311);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = -0.05f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.95f;
+ Loss = 0.95f;
+ Collision = -0.1f;
+ Gravity = 0.4f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 101;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 150;
+ Description = "More destructive Bomb.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_DEST::update;
+ Graphics = &Element_DEST::graphics;
}
//#TPT-Directive ElementHeader Element_DEST static int update(UPDATE_FUNC_ARGS)
@@ -52,6 +52,8 @@ int Element_DEST::update(UPDATE_FUNC_ARGS)
int r,rx,ry,topv;
rx=rand()%5-2;
ry=rand()%5-2;
+ if (!BOUNDS_CHECK)
+ return 1;
r = pmap[y+ry][x+rx];
if (!r || (r&0xFF)==PT_DEST || (r&0xFF)==PT_DMND || (r&0xFF)==PT_BCLN || (r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN || (r&0xFF)==PT_PBCN)
diff --git a/src/simulation/elements/DEUT.cpp b/src/simulation/elements/DEUT.cpp
index fb58700..8fb80bd 100644
--- a/src/simulation/elements/DEUT.cpp
+++ b/src/simulation/elements/DEUT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_DEUT PT_DEUT 95
Element_DEUT::Element_DEUT()
{
- Identifier = "DEFAULT_PT_DEUT";
- Name = "DEUT";
- Colour = PIXPACK(0x00153F);
- MenuVisible = 1;
- MenuSection = SC_NUCLEAR;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 31;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 251;
- Description = "Deuterium oxide. Volume changes with temp, radioactive with neutrons.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_NEUTPASS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_DEUT::update;
- Graphics = &Element_DEUT::graphics;
+ Identifier = "DEFAULT_PT_DEUT";
+ Name = "DEUT";
+ Colour = PIXPACK(0x00153F);
+ MenuVisible = 1;
+ MenuSection = SC_NUCLEAR;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 31;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Deuterium oxide. Volume changes with temp, radioactive with neutrons.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_NEUTPASS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_DEUT::update;
+ Graphics = &Element_DEUT::graphics;
}
//#TPT-Directive ElementHeader Element_DEUT static int update(UPDATE_FUNC_ARGS)
@@ -61,7 +61,7 @@ int Element_DEUT::update(UPDATE_FUNC_ARGS)
{
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r || (parts[i].life >=maxlife))
@@ -79,7 +79,7 @@ int Element_DEUT::update(UPDATE_FUNC_ARGS)
else
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (parts[i].life<=maxlife)
@@ -97,7 +97,7 @@ int Element_DEUT::update(UPDATE_FUNC_ARGS)
{
rx = rand()%5-2;
ry = rand()%5-2;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/DLAY.cpp b/src/simulation/elements/DLAY.cpp
index d0dd4c1..548ce6c 100644
--- a/src/simulation/elements/DLAY.cpp
+++ b/src/simulation/elements/DLAY.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_DLAY PT_DLAY 79
Element_DLAY::Element_DLAY()
{
- Identifier = "DEFAULT_PT_DLAY";
- Name = "DLAY";
- Colour = PIXPACK(0x753590);
- MenuVisible = 1;
- MenuSection = SC_POWERED;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = 4.0f+273.15f;
- HeatConduct = 0;
- Description = "Conducts with temperature-dependent delay. (use HEAT/COOL).";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_DLAY::update;
- Graphics = &Element_DLAY::graphics;
+ Identifier = "DEFAULT_PT_DLAY";
+ Name = "DLAY";
+ Colour = PIXPACK(0x753590);
+ MenuVisible = 1;
+ MenuSection = SC_POWERED;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = 4.0f+273.15f;
+ HeatConduct = 0;
+ Description = "Conducts with temperature-dependent delay. (use HEAT/COOL).";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_DLAY::update;
+ Graphics = &Element_DLAY::graphics;
}
//#TPT-Directive ElementHeader Element_DLAY static int update(UPDATE_FUNC_ARGS)
@@ -57,7 +57,7 @@ int Element_DLAY::update(UPDATE_FUNC_ARGS)
parts[i].temp = 1.0f+273.15f;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r || sim->parts_avg(r>>8, i,PT_INSL)==PT_INSL)
diff --git a/src/simulation/elements/DMG.cpp b/src/simulation/elements/DMG.cpp
index 75ad494..8b0be40 100644
--- a/src/simulation/elements/DMG.cpp
+++ b/src/simulation/elements/DMG.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_DMG PT_DMG 163
Element_DMG::Element_DMG()
{
- Identifier = "DEFAULT_PT_DMG";
- Name = "DMG";
- Colour = PIXPACK(0x88FF88);
- MenuVisible = 1;
- MenuSection = SC_FORCE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 30;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 29;
- Description = "DMG.";
-
- State = ST_NONE;
- Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC|PROP_SPARKSETTLE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_DMG::update;
- Graphics = &Element_DMG::graphics;
+ Identifier = "DEFAULT_PT_DMG";
+ Name = "DMG";
+ Colour = PIXPACK(0x88FF88);
+ MenuVisible = 1;
+ MenuSection = SC_FORCE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 30;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 29;
+ Description = "DMG.";
+
+ State = ST_NONE;
+ Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC|PROP_SPARKSETTLE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_DMG::update;
+ Graphics = &Element_DMG::graphics;
}
//#TPT-Directive ElementHeader Element_DMG static int update(UPDATE_FUNC_ARGS)
@@ -55,7 +55,7 @@ int Element_DMG::update(UPDATE_FUNC_ARGS)
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/DMND.cpp b/src/simulation/elements/DMND.cpp
index 3c6d24a..68c1d20 100644
--- a/src/simulation/elements/DMND.cpp
+++ b/src/simulation/elements/DMND.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_DMND PT_DMND 28
Element_DMND::Element_DMND()
{
- Identifier = "DEFAULT_PT_DMND";
- Name = "DMND";
- Colour = PIXPACK(0xCCFFFF);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 186;
- Description = "Diamond. Indestructible.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_DMND";
+ Name = "DMND";
+ Colour = PIXPACK(0xCCFFFF);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 186;
+ Description = "Diamond. Indestructible.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+
}
Element_DMND::~Element_DMND() {} \ No newline at end of file
diff --git a/src/simulation/elements/DRIC.cpp b/src/simulation/elements/DRIC.cpp
index ea2a3c8..de4a66c 100644
--- a/src/simulation/elements/DRIC.cpp
+++ b/src/simulation/elements/DRIC.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_DRIC PT_DRIC 81
Element_DRIC::Element_DRIC()
{
- Identifier = "DEFAULT_PT_DRIC";
- Name = "DRIC";
- Colour = PIXPACK(0xE0E0E0);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = -0.0005f* CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 100;
-
- Temperature = 172.65f;
- HeatConduct = 2;
- Description = "Dry Ice.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 195.65f;
- HighTemperatureTransition = PT_CO2;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_DRIC";
+ Name = "DRIC";
+ Colour = PIXPACK(0xE0E0E0);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = -0.0005f* CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 100;
+
+ Temperature = 172.65f;
+ HeatConduct = 2;
+ Description = "Dry Ice.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 195.65f;
+ HighTemperatureTransition = PT_CO2;
+
+ Update = NULL;
+
}
Element_DRIC::~Element_DRIC() {} \ No newline at end of file
diff --git a/src/simulation/elements/DSTW.cpp b/src/simulation/elements/DSTW.cpp
index c6f1aca..495748d 100644
--- a/src/simulation/elements/DSTW.cpp
+++ b/src/simulation/elements/DSTW.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_DSTW PT_DSTW 25
Element_DSTW::Element_DSTW()
{
- Identifier = "DEFAULT_PT_DSTW";
- Name = "DSTW";
- Colour = PIXPACK(0x1020C0);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 30;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 23;
- Description = "Distilled water, does not conduct electricity.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_NEUTPASS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 273.15f;
- LowTemperatureTransition = PT_ICEI;
- HighTemperature = 373.0f;
- HighTemperatureTransition = PT_WTRV;
-
- Update = &Element_DSTW::update;
-
+ Identifier = "DEFAULT_PT_DSTW";
+ Name = "DSTW";
+ Colour = PIXPACK(0x1020C0);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 30;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 23;
+ Description = "Distilled water, does not conduct electricity.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_NEUTPASS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 273.15f;
+ LowTemperatureTransition = PT_ICEI;
+ HighTemperature = 373.0f;
+ HighTemperatureTransition = PT_WTRV;
+
+ Update = &Element_DSTW::update;
+
}
//#TPT-Directive ElementHeader Element_DSTW static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_DSTW::update(UPDATE_FUNC_ARGS)
int r, rx, ry, rt;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
switch (r&0xFF)
diff --git a/src/simulation/elements/DTEC.cpp b/src/simulation/elements/DTEC.cpp
index 00a8c13..69218e6 100644
--- a/src/simulation/elements/DTEC.cpp
+++ b/src/simulation/elements/DTEC.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_DTEC PT_DTEC 162
Element_DTEC::Element_DTEC()
{
- Identifier = "DEFAULT_PT_DTEC";
- Name = "DTEC";
- Colour = PIXPACK(0xFD9D18);
- MenuVisible = 1;
- MenuSection = SC_SENSOR;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Creates a spark when something with its ctype is nearby";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_DTEC::update;
-
+ Identifier = "DEFAULT_PT_DTEC";
+ Name = "DTEC";
+ Colour = PIXPACK(0xFD9D18);
+ MenuVisible = 1;
+ MenuSection = SC_SENSOR;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Creates a spark when something with its ctype is nearby";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_DTEC::update;
+
}
//#TPT-Directive ElementHeader Element_DTEC static int update(UPDATE_FUNC_ARGS)
@@ -56,7 +56,7 @@ int Element_DTEC::update(UPDATE_FUNC_ARGS)
parts[i].life = 0;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -75,7 +75,7 @@ int Element_DTEC::update(UPDATE_FUNC_ARGS)
}
for (rx=-rd; rx<rd+1; rx++)
for (ry=-rd; ry<rd+1; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if(!r)
diff --git a/src/simulation/elements/DUST.cpp b/src/simulation/elements/DUST.cpp
index 924dabb..7b4cf8c 100644
--- a/src/simulation/elements/DUST.cpp
+++ b/src/simulation/elements/DUST.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_DUST PT_DUST 1
Element_DUST::Element_DUST()
{
- Identifier = "DEFAULT_PT_DUST";
- Name = "DUST";
- Colour = PIXPACK(0xFFE0A0);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.7f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.80f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 10;
- Explosive = 0;
- Meltable = 0;
- Hardness = 30;
-
- Weight = 85;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Very light dust. Flammable.";
-
- State = ST_SOLID;
- Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
- Graphics = NULL;
+ Identifier = "DEFAULT_PT_DUST";
+ Name = "DUST";
+ Colour = PIXPACK(0xFFE0A0);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.7f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.80f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 10;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 85;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Very light dust. Flammable.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+ Graphics = NULL;
}
Element_DUST::~Element_DUST() {} \ No newline at end of file
diff --git a/src/simulation/elements/DYST.cpp b/src/simulation/elements/DYST.cpp
index fdf16bb..14cfc27 100644
--- a/src/simulation/elements/DYST.cpp
+++ b/src/simulation/elements/DYST.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_DYST PT_DYST 64
Element_DYST::Element_DYST()
{
- Identifier = "DEFAULT_PT_DYST";
- Name = "DYST";
- Colour = PIXPACK(0xBBB0A0);
- MenuVisible = 0;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.7f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.80f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 20;
- Explosive = 0;
- Meltable = 0;
- Hardness = 30;
-
- Weight = 80;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Dead Yeast.";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 473.0f;
- HighTemperatureTransition = PT_DUST;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_DYST";
+ Name = "DYST";
+ Colour = PIXPACK(0xBBB0A0);
+ MenuVisible = 0;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.7f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.80f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 20;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 80;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Dead Yeast.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 473.0f;
+ HighTemperatureTransition = PT_DUST;
+
+ Update = NULL;
+
}
Element_DYST::~Element_DYST() {} \ No newline at end of file
diff --git a/src/simulation/elements/ELEC.cpp b/src/simulation/elements/ELEC.cpp
index 1ee9c86..fe056f3 100644
--- a/src/simulation/elements/ELEC.cpp
+++ b/src/simulation/elements/ELEC.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_ELEC PT_ELEC 136
Element_ELEC::Element_ELEC()
{
- Identifier = "DEFAULT_PT_ELEC";
- Name = "ELEC";
- Colour = PIXPACK(0xDFEFFF);
- MenuVisible = 1;
- MenuSection = SC_NUCLEAR;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 1.00f;
- Collision = -0.99f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = -1;
-
- Temperature = R_TEMP+200.0f+273.15f;
- HeatConduct = 251;
- Description = "Electrons";
-
- State = ST_GAS;
- Properties = TYPE_ENERGY|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_ELEC::update;
- Graphics = &Element_ELEC::graphics;
+ Identifier = "DEFAULT_PT_ELEC";
+ Name = "ELEC";
+ Colour = PIXPACK(0xDFEFFF);
+ MenuVisible = 1;
+ MenuSection = SC_NUCLEAR;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 1.00f;
+ Collision = -0.99f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = -1;
+
+ Temperature = R_TEMP+200.0f+273.15f;
+ HeatConduct = 251;
+ Description = "Electrons";
+
+ State = ST_GAS;
+ Properties = TYPE_ENERGY|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_ELEC::update;
+ Graphics = &Element_ELEC::graphics;
}
//#TPT-Directive ElementHeader Element_ELEC static int update(UPDATE_FUNC_ARGS)
@@ -54,7 +54,7 @@ int Element_ELEC::update(UPDATE_FUNC_ARGS)
parts[i].pavg[1] = y;
for (rx=-2; rx<=2; rx++)
for (ry=-2; ry<=2; ry++)
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES) {
+ if (BOUNDS_CHECK) {
r = pmap[y+ry][x+rx];
if (!r)
r = sim->photons[y+ry][x+rx];
diff --git a/src/simulation/elements/EMBR.cpp b/src/simulation/elements/EMBR.cpp
index 5ba37c2..754d0e5 100644
--- a/src/simulation/elements/EMBR.cpp
+++ b/src/simulation/elements/EMBR.cpp
@@ -2,125 +2,122 @@
//#TPT-Directive ElementClass Element_EMBR PT_EMBR 147
Element_EMBR::Element_EMBR()
{
-
- //{"EMBR", PIXPACK(0xFFF288), 0.4f, 0.001f * CFDS, 0.99f, 0.90f, 0.0f, 0.07f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 20, 0, 1, 30, SC_EXPLOSIVE, 500.0f +273.15f, 29, "Sparks. Formed by explosions.", ST_NONE, TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL|PROP_SPARKSETTLE, &update_EMBR, &graphics_EMBR},
-
- Identifier = "DEFAULT_PT_EMBR";
- Name = "EMBR";
- Colour = PIXPACK(0xFFF288);
- MenuVisible = 0;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.001f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.90f;
- Collision = 0.0f;
- Gravity = 0.07f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 30;
-
- Temperature = 500.0f +273.15f;
- HeatConduct = 29;
- Description = "Sparks. Formed by explosions.";
-
- State = ST_NONE;
- Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL|PROP_SPARKSETTLE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_EMBR::update;
- Graphics = &Element_EMBR::graphics;
+ Identifier = "DEFAULT_PT_EMBR";
+ Name = "EMBR";
+ Colour = PIXPACK(0xFFF288);
+ MenuVisible = 0;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.001f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.90f;
+ Collision = 0.0f;
+ Gravity = 0.07f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 30;
+
+ Temperature = 500.0f +273.15f;
+ HeatConduct = 29;
+ Description = "Sparks. Formed by explosions.";
+
+ State = ST_NONE;
+ Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL|PROP_SPARKSETTLE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_EMBR::update;
+ Graphics = &Element_EMBR::graphics;
}
//#TPT-Directive ElementHeader Element_EMBR static int update(UPDATE_FUNC_ARGS)
int Element_EMBR::update(UPDATE_FUNC_ARGS) {
- int r, rx, ry, nb;
- for (rx=-1; rx<2; rx++)
- for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
- {
- r = pmap[y+ry][x+rx];
- if (!r)
- continue;
- if ((sim->elements[r&0xFF].Properties & (TYPE_SOLID | TYPE_PART | TYPE_LIQUID)) && !(sim->elements[r&0xFF].Properties & PROP_SPARKSETTLE))
- {
- sim->kill_part(i);
- return 1;
- }
- }
- return 0;
+ int r, rx, ry, nb;
+ for (rx=-1; rx<2; rx++)
+ for (ry=-1; ry<2; ry++)
+ if (BOUNDS_CHECK && (rx || ry))
+ {
+ r = pmap[y+ry][x+rx];
+ if (!r)
+ continue;
+ if ((sim->elements[r&0xFF].Properties & (TYPE_SOLID | TYPE_PART | TYPE_LIQUID)) && !(sim->elements[r&0xFF].Properties & PROP_SPARKSETTLE))
+ {
+ sim->kill_part(i);
+ return 1;
+ }
+ }
+ return 0;
}
//#TPT-Directive ElementHeader Element_EMBR static int graphics(GRAPHICS_FUNC_ARGS)
int Element_EMBR::graphics(GRAPHICS_FUNC_ARGS)
{
- if (cpart->ctype&0xFFFFFF)
- {
- int maxComponent;
- *colr = (cpart->ctype&0xFF0000)>>16;
- *colg = (cpart->ctype&0x00FF00)>>8;
- *colb = (cpart->ctype&0x0000FF);
- maxComponent = *colr;
+ if (cpart->ctype&0xFFFFFF)
+ {
+ int maxComponent;
+ *colr = (cpart->ctype&0xFF0000)>>16;
+ *colg = (cpart->ctype&0x00FF00)>>8;
+ *colb = (cpart->ctype&0x0000FF);
+ maxComponent = *colr;
- if (*colg>maxComponent) maxComponent = *colg;
- if (*colb>maxComponent) maxComponent = *colb;
- if (maxComponent<60)//make sure it isn't too dark to see
- {
- float multiplier = 60.0f/maxComponent;
- *colr *= multiplier;
- *colg *= multiplier;
- *colb *= multiplier;
- }
- }
- else if (cpart->tmp != 0)
- {
- *colr = *colg = *colb = 255;
- }
+ if (*colg>maxComponent) maxComponent = *colg;
+ if (*colb>maxComponent) maxComponent = *colb;
+ if (maxComponent<60)//make sure it isn't too dark to see
+ {
+ float multiplier = 60.0f/maxComponent;
+ *colr *= multiplier;
+ *colg *= multiplier;
+ *colb *= multiplier;
+ }
+ }
+ else if (cpart->tmp != 0)
+ {
+ *colr = *colg = *colb = 255;
+ }
- if (ren->decorations_enable && cpart->dcolour)
- {
- int a = (cpart->dcolour>>24)&0xFF;
- *colr = (a*((cpart->dcolour>>16)&0xFF) + (255-a)**colr) >> 8;
- *colg = (a*((cpart->dcolour>>8)&0xFF) + (255-a)**colg) >> 8;
- *colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8;
- }
- *firer = *colr;
- *fireg = *colg;
- *fireb = *colb;
- if (cpart->tmp==1)
- {
- *pixel_mode = FIRE_ADD | PMODE_BLEND | PMODE_GLOW;
- *firea = (cpart->life-15)*4;
- *cola = (cpart->life+15)*4;
- }
- else if (cpart->tmp==2)
- {
- *pixel_mode = PMODE_FLAT | FIRE_ADD;
- *firea = 255;
- }
- else
- {
- *pixel_mode = PMODE_SPARK | PMODE_ADD;
- if (cpart->life<64) *cola = 4*cpart->life;
- }
- return 0;
+ if (ren->decorations_enable && cpart->dcolour)
+ {
+ int a = (cpart->dcolour>>24)&0xFF;
+ *colr = (a*((cpart->dcolour>>16)&0xFF) + (255-a)**colr) >> 8;
+ *colg = (a*((cpart->dcolour>>8)&0xFF) + (255-a)**colg) >> 8;
+ *colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8;
+ }
+ *firer = *colr;
+ *fireg = *colg;
+ *fireb = *colb;
+ if (cpart->tmp==1)
+ {
+ *pixel_mode = FIRE_ADD | PMODE_BLEND | PMODE_GLOW;
+ *firea = (cpart->life-15)*4;
+ *cola = (cpart->life+15)*4;
+ }
+ else if (cpart->tmp==2)
+ {
+ *pixel_mode = PMODE_FLAT | FIRE_ADD;
+ *firea = 255;
+ }
+ else
+ {
+ *pixel_mode = PMODE_SPARK | PMODE_ADD;
+ if (cpart->life<64) *cola = 4*cpart->life;
+ }
+ return 0;
}
Element_EMBR::~Element_EMBR() {}
diff --git a/src/simulation/elements/EMP.cpp b/src/simulation/elements/EMP.cpp
index 527f42d..395e015 100644
--- a/src/simulation/elements/EMP.cpp
+++ b/src/simulation/elements/EMP.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_EMP PT_EMP 134
Element_EMP::Element_EMP()
{
- Identifier = "DEFAULT_PT_EMP";
- Name = "EMP";
- Colour = PIXPACK(0x66AAFF);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.0f;
- HotAir = 0.0f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 3;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 121;
- Description = "Breaks activated electronics.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_EMP::update;
- Graphics = &Element_EMP::graphics;
+ Identifier = "DEFAULT_PT_EMP";
+ Name = "EMP";
+ Colour = PIXPACK(0x66AAFF);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.0f;
+ HotAir = 0.0f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 3;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 121;
+ Description = "Breaks activated electronics.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_EMP::update;
+ Graphics = &Element_EMP::graphics;
}
//#TPT-Directive ElementHeader Element_EMP static int update(UPDATE_FUNC_ARGS)
@@ -77,7 +77,7 @@ int Element_EMP::update(UPDATE_FUNC_ARGS)
{
int is_elec=0;
if (parts[r].ctype==PT_PSCN || parts[r].ctype==PT_NSCN || parts[r].ctype==PT_PTCT ||
- parts[r].ctype==PT_NTCT || parts[r].ctype==PT_INST || parts[r].ctype==PT_SWCH || t==PT_WIRE || t==PT_SWCH)
+ parts[r].ctype==PT_NTCT || parts[r].ctype==PT_INST || parts[r].ctype==PT_SWCH || t==PT_WIRE || t==PT_SWCH)
{
is_elec=1;
if (!(rand()%100))
diff --git a/src/simulation/elements/ETRD.cpp b/src/simulation/elements/ETRD.cpp
index 3a63f6f..3447f07 100644
--- a/src/simulation/elements/ETRD.cpp
+++ b/src/simulation/elements/ETRD.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_ETRD PT_ETRD 50
Element_ETRD::Element_ETRD()
{
- Identifier = "DEFAULT_PT_ETRD";
- Name = "ETRD";
- Colour = PIXPACK(0x404040);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)";
-
- State = ST_NONE;
- Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_ETRD";
+ Name = "ETRD";
+ Colour = PIXPACK(0x404040);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+
}
Element_ETRD::~Element_ETRD() {} \ No newline at end of file
diff --git a/src/simulation/elements/EXOT.cpp b/src/simulation/elements/EXOT.cpp
index 1b763ca..52bf462 100644
--- a/src/simulation/elements/EXOT.cpp
+++ b/src/simulation/elements/EXOT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_EXOT PT_EXOT 145
Element_EXOT::Element_EXOT()
{
- Identifier = "DEFAULT_PT_EXOT";
- Name = "EXOT";
- Colour = PIXPACK(0x404040);
- MenuVisible = 1;
- MenuSection = SC_NUCLEAR;
- Enabled = 1;
-
- Advection = 0.3f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.95f;
- Loss = 0.80f;
- Collision = 0.0f;
- Gravity = 0.15f;
- Diffusion = 0.00f;
- HotAir = 0.0003f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 2;
-
- Weight = 46;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 250;
- Description = "Exotic matter. Explodes with excess exposure to electrons.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_NEUTPASS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_EXOT::update;
- Graphics = &Element_EXOT::graphics;
+ Identifier = "DEFAULT_PT_EXOT";
+ Name = "EXOT";
+ Colour = PIXPACK(0x404040);
+ MenuVisible = 1;
+ MenuSection = SC_NUCLEAR;
+ Enabled = 1;
+
+ Advection = 0.3f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.95f;
+ Loss = 0.80f;
+ Collision = 0.0f;
+ Gravity = 0.15f;
+ Diffusion = 0.00f;
+ HotAir = 0.0003f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 2;
+
+ Weight = 46;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 250;
+ Description = "Exotic matter. Explodes with excess exposure to electrons.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_NEUTPASS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_EXOT::update;
+ Graphics = &Element_EXOT::graphics;
}
//#TPT-Directive ElementHeader Element_EXOT static int update(UPDATE_FUNC_ARGS)
@@ -51,7 +51,7 @@ int Element_EXOT::update(UPDATE_FUNC_ARGS) {
int r, rt, rx, ry, nb, rrx, rry, trade, tym;
for (rx=-2; rx<=2; rx++)
for (ry=-2; ry<=2; ry++)
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES && (rx || ry)) {
+ if (BOUNDS_CHECK && (rx || ry)) {
r = pmap[y+ry][x+rx];
if (!r)
continue;
diff --git a/src/simulation/elements/FIGH.cpp b/src/simulation/elements/FIGH.cpp
index e1072f2..146c3db 100644
--- a/src/simulation/elements/FIGH.cpp
+++ b/src/simulation/elements/FIGH.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_FIGH PT_FIGH 158
Element_FIGH::Element_FIGH()
{
- Identifier = "DEFAULT_PT_FIGH";
- Name = "FIGH";
- Colour = PIXPACK(0xFFE0A0);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.5f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.2f;
- Loss = 1.0f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.0f;
- HotAir = 0.00f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 50;
-
- Temperature = R_TEMP+14.6f+273.15f;
- HeatConduct = 0;
- Description = "Fighter. Tries to kill stickmen.";
-
- State = ST_NONE;
- Properties = 0;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 620.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = &Element_FIGH::update;
- Graphics = &Element_STKM::graphics;
+ Identifier = "DEFAULT_PT_FIGH";
+ Name = "FIGH";
+ Colour = PIXPACK(0xFFE0A0);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.5f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.2f;
+ Loss = 1.0f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.0f;
+ HotAir = 0.00f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 50;
+
+ Temperature = R_TEMP+14.6f+273.15f;
+ HeatConduct = 0;
+ Description = "Fighter. Tries to kill stickmen.";
+
+ State = ST_NONE;
+ Properties = 0;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 620.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = &Element_FIGH::update;
+ Graphics = &Element_STKM::graphics;
}
//#TPT-Directive ElementHeader Element_FIGH static int update(UPDATE_FUNC_ARGS)
@@ -59,7 +59,7 @@ int Element_FIGH::update(UPDATE_FUNC_ARGS)
if (sim->player2.spwn)
{
if (sim->player.spwn && (pow((float)sim->player.legs[2]-x, 2) + pow((float)sim->player.legs[3]-y, 2))<=
- (pow((float)sim->player2.legs[2]-x, 2) + pow((float)sim->player2.legs[3]-y, 2)))
+ (pow((float)sim->player2.legs[2]-x, 2) + pow((float)sim->player2.legs[3]-y, 2)))
{
tarx = (unsigned int)sim->player.legs[2];
tary = (unsigned int)sim->player.legs[3];
@@ -74,8 +74,8 @@ int Element_FIGH::update(UPDATE_FUNC_ARGS)
else if (sim->player.spwn)
{
tarx = (unsigned int)sim->player.legs[2];
- tary = (unsigned int)sim->player.legs[3];
- parts[i].tmp2 = 1;
+ tary = (unsigned int)sim->player.legs[3];
+ parts[i].tmp2 = 1;
}
switch (parts[i].tmp2)
diff --git a/src/simulation/elements/FILT.cpp b/src/simulation/elements/FILT.cpp
index 58501c2..d6b82f2 100644
--- a/src/simulation/elements/FILT.cpp
+++ b/src/simulation/elements/FILT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_FILT PT_FILT 125
Element_FILT::Element_FILT()
{
- Identifier = "DEFAULT_PT_FILT";
- Name = "FILT";
- Colour = PIXPACK(0x000056);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Filter for photons, changes the color.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID | PROP_NOAMBHEAT;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
- Graphics = &Element_FILT::graphics;
+ Identifier = "DEFAULT_PT_FILT";
+ Name = "FILT";
+ Colour = PIXPACK(0x000056);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Filter for photons, changes the color.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID | PROP_NOAMBHEAT;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+ Graphics = &Element_FILT::graphics;
}
//#TPT-Directive ElementHeader Element_FILT static int graphics(GRAPHICS_FUNC_ARGS)
diff --git a/src/simulation/elements/FIRE.cpp b/src/simulation/elements/FIRE.cpp
index 35c7758..6e3e01a 100644
--- a/src/simulation/elements/FIRE.cpp
+++ b/src/simulation/elements/FIRE.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_FIRE PT_FIRE 4
Element_FIRE::Element_FIRE()
{
- Identifier = "DEFAULT_PT_FIRE";
- Name = "FIRE";
- Colour = PIXPACK(0xFF1000);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.9f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.97f;
- Loss = 0.20f;
- Collision = 0.0f;
- Gravity = -0.1f;
- Diffusion = 0.00f;
- HotAir = 0.001f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 2;
-
- Temperature = R_TEMP+400.0f+273.15f;
- HeatConduct = 88;
- Description = "Ignites flammable materials. Heats air.";
-
- State = ST_GAS;
- Properties = TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 2773.0f;
- HighTemperatureTransition = PT_PLSM;
-
- Update = &Element_FIRE::update;
- Graphics = &Element_FIRE::graphics;
+ Identifier = "DEFAULT_PT_FIRE";
+ Name = "FIRE";
+ Colour = PIXPACK(0xFF1000);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.9f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.97f;
+ Loss = 0.20f;
+ Collision = 0.0f;
+ Gravity = -0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.001f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 2;
+
+ Temperature = R_TEMP+400.0f+273.15f;
+ HeatConduct = 88;
+ Description = "Ignites flammable materials. Heats air.";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 2773.0f;
+ HighTemperatureTransition = PT_PLSM;
+
+ Update = &Element_FIRE::update;
+ Graphics = &Element_FIRE::graphics;
}
//#TPT-Directive ElementHeader Element_FIRE static int update(UPDATE_FUNC_ARGS)
@@ -87,7 +87,7 @@ int Element_FIRE::update(UPDATE_FUNC_ARGS)
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -96,10 +96,10 @@ int Element_FIRE::update(UPDATE_FUNC_ARGS)
continue;
rt = r&0xFF;
if ((surround_space || sim->elements[rt].Explosive) &&
- (t!=PT_SPRK || (rt!=PT_RBDM && rt!=PT_LRBD && rt!=PT_INSL)) &&
- (t!=PT_PHOT || rt!=PT_INSL) &&
+ (t!=PT_SPRK || (rt!=PT_RBDM && rt!=PT_LRBD && rt!=PT_INSL)) &&
+ (t!=PT_PHOT || rt!=PT_INSL) &&
(rt!=PT_SPNG || parts[r>>8].life==0) &&
- sim->elements[rt].Flammable && (sim->elements[rt].Flammable + (int)(sim->pv[(y+ry)/CELL][(x+rx)/CELL]*10.0f))>(rand()%1000))
+ sim->elements[rt].Flammable && (sim->elements[rt].Flammable + (int)(sim->pv[(y+ry)/CELL][(x+rx)/CELL]*10.0f))>(rand()%1000))
{
sim->part_change_type(r>>8,x+rx,y+ry,PT_FIRE);
parts[r>>8].temp = restrict_flt(sim->elements[PT_FIRE].Temperature + (sim->elements[rt].Flammable/2), MIN_TEMP, MAX_TEMP);
@@ -118,7 +118,7 @@ int Element_FIRE::updateLegacy(UPDATE_FUNC_ARGS) {
int r, rx, ry, rt, lpv, t = parts[i].type;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/FIRW.cpp b/src/simulation/elements/FIRW.cpp
index 3863c94..5d1c895 100644
--- a/src/simulation/elements/FIRW.cpp
+++ b/src/simulation/elements/FIRW.cpp
@@ -6,48 +6,48 @@ extern "C"
//#TPT-Directive ElementClass Element_FIRW PT_FIRW 69
Element_FIRW::Element_FIRW()
{
- Identifier = "DEFAULT_PT_FIRW";
- Name = "FIRW";
- Colour = PIXPACK(0xFFA040);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.2f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.95f;
- Collision = -0.1f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 30;
-
- Weight = 55;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Fireworks!";
-
- State = ST_SOLID;
- Properties = TYPE_PART|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_FIRW::update;
- Graphics = &Element_FIRW::graphics;
+ Identifier = "DEFAULT_PT_FIRW";
+ Name = "FIRW";
+ Colour = PIXPACK(0xFFA040);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.2f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.95f;
+ Collision = -0.1f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 55;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Fireworks!";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_FIRW::update;
+ Graphics = &Element_FIRW::graphics;
}
//#TPT-Directive ElementHeader Element_FIRW static int update(UPDATE_FUNC_ARGS)
@@ -57,7 +57,7 @@ int Element_FIRW::update(UPDATE_FUNC_ARGS)
if (parts[i].tmp<=0) {
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/FOG.cpp b/src/simulation/elements/FOG.cpp
index e2aae3c..f5d76f9 100644
--- a/src/simulation/elements/FOG.cpp
+++ b/src/simulation/elements/FOG.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_FOG PT_FOG 92
Element_FOG::Element_FOG()
{
- Identifier = "DEFAULT_PT_FOG";
- Name = "FOG";
- Colour = PIXPACK(0xAAAAAA);
- MenuVisible = 1;
- MenuSection = SC_CRACKER2;
- Enabled = 1;
-
- Advection = 0.8f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.4f;
- Loss = 0.70f;
- Collision = -0.1f;
- Gravity = 0.0f;
- Diffusion = 0.99f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 30;
-
- Weight = 1;
-
- Temperature = 243.15f;
- HeatConduct = 100;
- Description = "Not quite Steam";
-
- State = ST_GAS;
- Properties = TYPE_GAS|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 373.15f;
- HighTemperatureTransition = PT_WTRV;
-
- Update = &Element_FOG::update;
-
+ Identifier = "DEFAULT_PT_FOG";
+ Name = "FOG";
+ Colour = PIXPACK(0xAAAAAA);
+ MenuVisible = 1;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 0.8f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.4f;
+ Loss = 0.70f;
+ Collision = -0.1f;
+ Gravity = 0.0f;
+ Diffusion = 0.99f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 1;
+
+ Temperature = 243.15f;
+ HeatConduct = 100;
+ Description = "Not quite Steam";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 373.15f;
+ HighTemperatureTransition = PT_WTRV;
+
+ Update = &Element_FOG::update;
+
}
//#TPT-Directive ElementHeader Element_FOG static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_FOG::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/FRAY.cpp b/src/simulation/elements/FRAY.cpp
index 5ab7de8..ab45cb6 100644
--- a/src/simulation/elements/FRAY.cpp
+++ b/src/simulation/elements/FRAY.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_FRAY PT_FRAY 159
Element_FRAY::Element_FRAY()
{
- Identifier = "DEFAULT_PT_FRAY";
- Name = "FRAY";
- Colour = PIXPACK(0x00BBFF);
- MenuVisible = 1;
- MenuSection = SC_FORCE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = 20.0f+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Force Emitter. Push or pull objects based on temp value, use like ARAY";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_FRAY::update;
-
+ Identifier = "DEFAULT_PT_FRAY";
+ Name = "FRAY";
+ Colour = PIXPACK(0x00BBFF);
+ MenuVisible = 1;
+ MenuSection = SC_FORCE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = 20.0f+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Force Emitter. Push or pull objects based on temp value, use like ARAY";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_FRAY::update;
+
}
//#TPT-Directive ElementHeader Element_FRAY static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_FRAY::update(UPDATE_FUNC_ARGS)
int r, nxx, nyy, len, nxi, nyi, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/FRME.cpp b/src/simulation/elements/FRME.cpp
index 54a00b0..f5b6a09 100644
--- a/src/simulation/elements/FRME.cpp
+++ b/src/simulation/elements/FRME.cpp
@@ -2,47 +2,47 @@
//#TPT-Directive ElementClass Element_FRME PT_FRME 169
Element_FRME::Element_FRME()
{
- Identifier = "DEFAULT_PT_FRME";
- Name = "FRME";
- Colour = PIXPACK(0x999988);
- MenuVisible = 1;
- MenuSection = SC_FORCE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Frame, can be used with pistons to push many particles";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Graphics = &Element_FRME::graphics;
+ Identifier = "DEFAULT_PT_FRME";
+ Name = "FRME";
+ Colour = PIXPACK(0x999988);
+ MenuVisible = 1;
+ MenuSection = SC_FORCE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Frame, can be used with pistons to push many particles";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Graphics = &Element_FRME::graphics;
}
//#TPT-Directive ElementHeader Element_FRME static int graphics(GRAPHICS_FUNC_ARGS)
diff --git a/src/simulation/elements/FRZW.cpp b/src/simulation/elements/FRZW.cpp
index b48cd6f..39d2bd3 100644
--- a/src/simulation/elements/FRZW.cpp
+++ b/src/simulation/elements/FRZW.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_FRZW PT_FRZW 101
Element_FRZW::Element_FRZW()
{
- Identifier = "DEFAULT_PT_FRZW";
- Name = "FRZW";
- Colour = PIXPACK(0x1020C0);
- MenuVisible = 1;
- MenuSection = SC_CRACKER2;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 30;
-
- Temperature = 120.0f;
- HeatConduct = 29;
- Description = "Freeze water. Hybrid liquid formed when Freeze powder melts.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID||PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 53.0f;
- HighTemperatureTransition = PT_ICEI;
-
- Update = &Element_FRZW::update;
-
+ Identifier = "DEFAULT_PT_FRZW";
+ Name = "FRZW";
+ Colour = PIXPACK(0x1020C0);
+ MenuVisible = 1;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 30;
+
+ Temperature = 120.0f;
+ HeatConduct = 29;
+ Description = "Freeze water. Hybrid liquid formed when Freeze powder melts.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID||PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 53.0f;
+ HighTemperatureTransition = PT_ICEI;
+
+ Update = &Element_FRZW::update;
+
}
//#TPT-Directive ElementHeader Element_FRZW static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_FRZW::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/FRZZ.cpp b/src/simulation/elements/FRZZ.cpp
index 02b5782..f527804 100644
--- a/src/simulation/elements/FRZZ.cpp
+++ b/src/simulation/elements/FRZZ.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_FRZZ PT_FRZZ 100
Element_FRZZ::Element_FRZZ()
{
- Identifier = "DEFAULT_PT_FRZZ";
- Name = "FRZZ";
- Colour = PIXPACK(0xC0E0FF);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.7f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.90f;
- Collision = -0.1f;
- Gravity = 0.05f;
- Diffusion = 0.01f;
- HotAir = -0.00005f* CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 50;
-
- Temperature = 253.15f;
- HeatConduct = 46;
- Description = "Freeze powder. When melted, forms ice that always cools. Spreads with regular water.";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = 1.8f;
- HighPressureTransition = PT_SNOW;
- LowTemperature = 50.0f;
- LowTemperatureTransition = PT_ICEI;
- HighTemperature = 273.15;
- HighTemperatureTransition = PT_WATR;
-
- Update = &Element_FRZZ::update;
-
+ Identifier = "DEFAULT_PT_FRZZ";
+ Name = "FRZZ";
+ Colour = PIXPACK(0xC0E0FF);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.7f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.90f;
+ Collision = -0.1f;
+ Gravity = 0.05f;
+ Diffusion = 0.01f;
+ HotAir = -0.00005f* CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 50;
+
+ Temperature = 253.15f;
+ HeatConduct = 46;
+ Description = "Freeze powder. When melted, forms ice that always cools. Spreads with regular water.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = 1.8f;
+ HighPressureTransition = PT_SNOW;
+ LowTemperature = 50.0f;
+ LowTemperatureTransition = PT_ICEI;
+ HighTemperature = 273.15;
+ HighTemperatureTransition = PT_WATR;
+
+ Update = &Element_FRZZ::update;
+
}
//#TPT-Directive ElementHeader Element_FRZZ static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_FRZZ::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/FSEP.cpp b/src/simulation/elements/FSEP.cpp
index 132e0de..6b8ae47 100644
--- a/src/simulation/elements/FSEP.cpp
+++ b/src/simulation/elements/FSEP.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_FSEP PT_FSEP 71
Element_FSEP::Element_FSEP()
{
- Identifier = "DEFAULT_PT_FSEP";
- Name = "FSEP";
- Colour = PIXPACK(0x63AD5F);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.7f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.80f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 30;
-
- Weight = 70;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Fuse Powder. See FUSE.";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_FSEP::update;
-
+ Identifier = "DEFAULT_PT_FSEP";
+ Name = "FSEP";
+ Colour = PIXPACK(0x63AD5F);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.7f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.80f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 70;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Fuse Powder. See FUSE.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_FSEP::update;
+
}
//#TPT-Directive ElementHeader Element_FSEP static int update(UPDATE_FUNC_ARGS)
@@ -67,7 +67,7 @@ int Element_FSEP::update(UPDATE_FUNC_ARGS)
else {
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/FUSE.cpp b/src/simulation/elements/FUSE.cpp
index 71f551f..9267e5e 100644
--- a/src/simulation/elements/FUSE.cpp
+++ b/src/simulation/elements/FUSE.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_FUSE PT_FUSE 70
Element_FUSE::Element_FUSE()
{
- Identifier = "DEFAULT_PT_FUSE";
- Name = "FUSE";
- Colour = PIXPACK(0x0A5706);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.0f;
- HotAir = 0.0f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 200;
- Description = "Solid. Burns slowly. Ignites at somewhat high temperatures and electricity.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_FUSE::update;
-
+ Identifier = "DEFAULT_PT_FUSE";
+ Name = "FUSE";
+ Colour = PIXPACK(0x0A5706);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.0f;
+ HotAir = 0.0f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 200;
+ Description = "Solid. Burns slowly. Ignites at somewhat high temperatures and electricity.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_FUSE::update;
+
}
//#TPT-Directive ElementHeader Element_FUSE static int update(UPDATE_FUNC_ARGS)
@@ -75,7 +75,7 @@ int Element_FUSE::update(UPDATE_FUNC_ARGS)
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/FWRK.cpp b/src/simulation/elements/FWRK.cpp
index a16fbc6..afb9a9c 100644
--- a/src/simulation/elements/FWRK.cpp
+++ b/src/simulation/elements/FWRK.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_FWRK PT_FWRK 98
Element_FWRK::Element_FWRK()
{
- Identifier = "DEFAULT_PT_FWRK";
- Name = "FWRK";
- Colour = PIXPACK(0x666666);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.4f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 97;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 100;
- Description = "First fireworks made, activated by heat/neutrons.";
-
- State = ST_SOLID;
- Properties = TYPE_PART|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_FWRK::update;
-
+ Identifier = "DEFAULT_PT_FWRK";
+ Name = "FWRK";
+ Colour = PIXPACK(0x666666);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.4f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 97;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 100;
+ Description = "First fireworks made, activated by heat/neutrons.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_FWRK::update;
+
}
//#TPT-Directive ElementHeader Element_FWRK static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/GAS.cpp b/src/simulation/elements/GAS.cpp
index 45bcf3e..5eff93f 100644
--- a/src/simulation/elements/GAS.cpp
+++ b/src/simulation/elements/GAS.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_GAS PT_GAS 10
Element_GAS::Element_GAS()
{
- Identifier = "DEFAULT_PT_GAS";
- Name = "GAS";
- Colour = PIXPACK(0xE0FF20);
- MenuVisible = 1;
- MenuSection = SC_GAS;
- Enabled = 1;
-
- Advection = 1.0f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.30f;
- Collision = -0.1f;
- Gravity = 0.0f;
- Diffusion = 0.75f;
- HotAir = 0.001f * CFDS;
- Falldown = 0;
-
- Flammable = 600;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 1;
-
- Temperature = R_TEMP+2.0f +273.15f;
- HeatConduct = 42;
- Description = "Gas. Diffuses. Flammable. Liquefies under pressure.";
-
- State = ST_GAS;
- Properties = TYPE_GAS | PROP_NEUTPASS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = 6.0f;
- HighPressureTransition = PT_OIL;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 573.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_GAS";
+ Name = "GAS";
+ Colour = PIXPACK(0xE0FF20);
+ MenuVisible = 1;
+ MenuSection = SC_GAS;
+ Enabled = 1;
+
+ Advection = 1.0f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.30f;
+ Collision = -0.1f;
+ Gravity = 0.0f;
+ Diffusion = 0.75f;
+ HotAir = 0.001f * CFDS;
+ Falldown = 0;
+
+ Flammable = 600;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 1;
+
+ Temperature = R_TEMP+2.0f +273.15f;
+ HeatConduct = 42;
+ Description = "Gas. Diffuses. Flammable. Liquefies under pressure.";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS | PROP_NEUTPASS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = 6.0f;
+ HighPressureTransition = PT_OIL;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 573.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = NULL;
+
}
Element_GAS::~Element_GAS() {}
diff --git a/src/simulation/elements/GBMB.cpp b/src/simulation/elements/GBMB.cpp
index 1b0ede0..1e12818 100644
--- a/src/simulation/elements/GBMB.cpp
+++ b/src/simulation/elements/GBMB.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_GBMB PT_GBMB 157
Element_GBMB::Element_GBMB()
{
- Identifier = "DEFAULT_PT_GBMB";
- Name = "GBMB";
- Colour = PIXPACK(0x1144BB);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 30;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 29;
- Description = "Sticks to first object it touches then produces strong gravity push.";
-
- State = ST_NONE;
- Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_GBMB::update;
- Graphics = &Element_GBMB::graphics;
+ Identifier = "DEFAULT_PT_GBMB";
+ Name = "GBMB";
+ Colour = PIXPACK(0x1144BB);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 30;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 29;
+ Description = "Sticks to first object it touches then produces strong gravity push.";
+
+ State = ST_NONE;
+ Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_GBMB::update;
+ Graphics = &Element_GBMB::graphics;
}
//#TPT-Directive ElementHeader Element_GBMB static int update(UPDATE_FUNC_ARGS)
@@ -55,15 +55,18 @@ int Element_GBMB::update(UPDATE_FUNC_ARGS)
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
{
- r = pmap[y+ry][x+rx];
- if(!r)
- continue;
- if((r&0xFF)!=PT_BOMB && (r&0xFF)!=PT_GBMB &&
- (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN &&
- (r&0xFF)!=PT_DMND)
+ if (BOUNDS_CHECK)
{
- parts[i].life=60;
- break;
+ r = pmap[y+ry][x+rx];
+ if(!r)
+ continue;
+ if((r&0xFF)!=PT_BOMB && (r&0xFF)!=PT_GBMB &&
+ (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN &&
+ (r&0xFF)!=PT_DMND)
+ {
+ parts[i].life=60;
+ break;
+ }
}
}
}
diff --git a/src/simulation/elements/GEL.cpp b/src/simulation/elements/GEL.cpp
index 0a61b82..5fd9a96 100644
--- a/src/simulation/elements/GEL.cpp
+++ b/src/simulation/elements/GEL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_GEL PT_GEL 142
Element_GEL::Element_GEL()
{
- Identifier = "DEFAULT_PT_GEL";
- Name = "GEL";
- Colour = PIXPACK(0xFF9900);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 35;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 29;
- Description = "Gel. A liquid with variable viscosity and heat conductivity";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_LIFE_DEC|PROP_NEUTPENETRATE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_GEL::update;
- Graphics = &Element_GEL::graphics;
+ Identifier = "DEFAULT_PT_GEL";
+ Name = "GEL";
+ Colour = PIXPACK(0xFF9900);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 35;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 29;
+ Description = "Gel. A liquid with variable viscosity and heat conductivity";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_LIFE_DEC|PROP_NEUTPENETRATE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_GEL::update;
+ Graphics = &Element_GEL::graphics;
}
//#TPT-Directive ElementHeader Element_GEL static int update(UPDATE_FUNC_ARGS)
@@ -57,7 +57,7 @@ int Element_GEL::update(UPDATE_FUNC_ARGS)
absorbChanceDenom = parts[i].tmp*10 + 500;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
gel=false;
r = pmap[y+ry][x+rx];
@@ -127,7 +127,7 @@ int Element_GEL::update(UPDATE_FUNC_ARGS)
dx = parts[i].x - parts[r>>8].x;
dy = parts[i].y - parts[r>>8].y;
- //Stickness
+ //Stickiness
if ((dx*dx + dy*dy)>1.5 && (gel || !sim->elements[rt].Falldown || (fabs((float)rx)<2 && fabs((float)ry)<2)))
{
float per, nd;
diff --git a/src/simulation/elements/GLAS.cpp b/src/simulation/elements/GLAS.cpp
index b752a0b..5baa59c 100644
--- a/src/simulation/elements/GLAS.cpp
+++ b/src/simulation/elements/GLAS.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_GLAS PT_GLAS 45
Element_GLAS::Element_GLAS()
{
- Identifier = "DEFAULT_PT_GLAS";
- Name = "GLAS";
- Colour = PIXPACK(0x404040);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 150;
- Description = "Solid. Meltable. Shatters under pressure";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID | PROP_NEUTPASS | PROP_HOT_GLOW | PROP_SPARKSETTLE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1973.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = &Element_GLAS::update;
-
+ Identifier = "DEFAULT_PT_GLAS";
+ Name = "GLAS";
+ Colour = PIXPACK(0x404040);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 150;
+ Description = "Solid. Meltable. Shatters under pressure";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID | PROP_NEUTPASS | PROP_HOT_GLOW | PROP_SPARKSETTLE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1973.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = &Element_GLAS::update;
+
}
//#TPT-Directive ElementHeader Element_GLAS static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/GLOW.cpp b/src/simulation/elements/GLOW.cpp
index 373fc51..d8c07ba 100644
--- a/src/simulation/elements/GLOW.cpp
+++ b/src/simulation/elements/GLOW.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_GLOW PT_GLOW 66
Element_GLOW::Element_GLOW()
{
- Identifier = "DEFAULT_PT_GLOW";
- Name = "GLOW";
- Colour = PIXPACK(0x445464);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.3f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.80f;
- Collision = 0.0f;
- Gravity = 0.15f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 2;
-
- Weight = 40;
-
- Temperature = R_TEMP+20.0f+273.15f;
- HeatConduct = 44;
- Description = "Glow, Glows under pressure";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_GLOW::update;
- Graphics = &Element_GLOW::graphics;
+ Identifier = "DEFAULT_PT_GLOW";
+ Name = "GLOW";
+ Colour = PIXPACK(0x445464);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.3f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.80f;
+ Collision = 0.0f;
+ Gravity = 0.15f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 2;
+
+ Weight = 40;
+
+ Temperature = R_TEMP+20.0f+273.15f;
+ HeatConduct = 44;
+ Description = "Glow, Glows under pressure";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_GLOW::update;
+ Graphics = &Element_GLOW::graphics;
}
//#TPT-Directive ElementHeader Element_GLOW static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_GLOW::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/GOO.cpp b/src/simulation/elements/GOO.cpp
index 3dcef31..0d55ba5 100644
--- a/src/simulation/elements/GOO.cpp
+++ b/src/simulation/elements/GOO.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_GOO PT_GOO 12
Element_GOO::Element_GOO()
{
- Identifier = "DEFAULT_PT_GOO";
- Name = "GOO";
- Colour = PIXPACK(0x804000);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.97f;
- Loss = 0.50f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 12;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 75;
- Description = "Solid. Deforms and disappears under pressure.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID | PROP_NEUTPENETRATE|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_GOO::update;
-
+ Identifier = "DEFAULT_PT_GOO";
+ Name = "GOO";
+ Colour = PIXPACK(0x804000);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.97f;
+ Loss = 0.50f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 12;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 75;
+ Description = "Solid. Deforms and disappears under pressure.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID | PROP_NEUTPENETRATE|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_GOO::update;
+
}
//#TPT-Directive ElementHeader Element_GOO static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/GPMP.cpp b/src/simulation/elements/GPMP.cpp
index d22934e..cbef4ed 100644
--- a/src/simulation/elements/GPMP.cpp
+++ b/src/simulation/elements/GPMP.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_GPMP PT_GPMP 154
Element_GPMP::Element_GPMP()
{
- Identifier = "DEFAULT_PT_GPMP";
- Name = "GPMP";
- Colour = PIXPACK(0x0A3B3B);
- MenuVisible = 1;
- MenuSection = SC_POWERED;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = 0.0f +273.15f;
- HeatConduct = 0;
- Description = "Changes gravity to its temp when activated. (use HEAT/COOL).";
-
- State = ST_NONE;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_GPMP::update;
- Graphics = &Element_GPMP::graphics;
+ Identifier = "DEFAULT_PT_GPMP";
+ Name = "GPMP";
+ Colour = PIXPACK(0x0A3B3B);
+ MenuVisible = 1;
+ MenuSection = SC_POWERED;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = 0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Changes gravity to its temp when activated. (use HEAT/COOL).";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_GPMP::update;
+ Graphics = &Element_GPMP::graphics;
}
//#TPT-Directive ElementHeader Element_GPMP static int update(UPDATE_FUNC_ARGS)
@@ -65,7 +65,7 @@ int Element_GPMP::update(UPDATE_FUNC_ARGS)
sim->gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] = 0.2f*(parts[i].temp-273.15);
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/GRAV.cpp b/src/simulation/elements/GRAV.cpp
index 144ba94..c8d1484 100644
--- a/src/simulation/elements/GRAV.cpp
+++ b/src/simulation/elements/GRAV.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_GRAV PT_GRAV 102
Element_GRAV::Element_GRAV()
{
- Identifier = "DEFAULT_PT_GRAV";
- Name = "GRAV";
- Colour = PIXPACK(0xFFE0A0);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.7f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 1.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 10;
- Explosive = 0;
- Meltable = 0;
- Hardness = 30;
-
- Weight = 85;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Very light dust. Changes colour based on velocity.";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
- Graphics = &Element_GRAV::graphics;
+ Identifier = "DEFAULT_PT_GRAV";
+ Name = "GRAV";
+ Colour = PIXPACK(0xFFE0A0);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.7f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 1.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 10;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 85;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Very light dust. Changes colour based on velocity.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+ Graphics = &Element_GRAV::graphics;
}
//#TPT-Directive ElementHeader Element_GRAV static int graphics(GRAPHICS_FUNC_ARGS)
int Element_GRAV::graphics(GRAPHICS_FUNC_ARGS)
diff --git a/src/simulation/elements/GUNP.cpp b/src/simulation/elements/GUNP.cpp
index 798e0f7..5e191e9 100644
--- a/src/simulation/elements/GUNP.cpp
+++ b/src/simulation/elements/GUNP.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_GUNP PT_GUNP 7
Element_GUNP::Element_GUNP()
{
- Identifier = "DEFAULT_PT_GUNP";
- Name = "GUN";
- Colour = PIXPACK(0xC0C0D0);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.7f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.80f;
- Collision = -0.1f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 600;
- Explosive = 1;
- Meltable = 0;
- Hardness = 10;
-
- Weight = 85;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 97;
- Description = "Light dust. Explosive.";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 673.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_GUNP";
+ Name = "GUN";
+ Colour = PIXPACK(0xC0C0D0);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.7f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.80f;
+ Collision = -0.1f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 600;
+ Explosive = 1;
+ Meltable = 0;
+ Hardness = 10;
+
+ Weight = 85;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 97;
+ Description = "Light dust. Explosive.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 673.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = NULL;
+
}
Element_GUNP::~Element_GUNP() {} \ No newline at end of file
diff --git a/src/simulation/elements/H2.cpp b/src/simulation/elements/H2.cpp
index e9913e1..e066dfd 100644
--- a/src/simulation/elements/H2.cpp
+++ b/src/simulation/elements/H2.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_H2 PT_H2 148
Element_H2::Element_H2()
{
- Identifier = "DEFAULT_PT_H2";
- Name = "HYGN";
- Colour = PIXPACK(0x5070FF);
- MenuVisible = 1;
- MenuSection = SC_GAS;
- Enabled = 1;
-
- Advection = 2.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.30f;
- Collision = -0.10f;
- Gravity = 0.00f;
- Diffusion = 3.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 1;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Combines with O2 to make WATR";
-
- State = ST_GAS;
- Properties = TYPE_GAS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_H2::update;
-
+ Identifier = "DEFAULT_PT_H2";
+ Name = "HYGN";
+ Colour = PIXPACK(0x5070FF);
+ MenuVisible = 1;
+ MenuSection = SC_GAS;
+ Enabled = 1;
+
+ Advection = 2.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.30f;
+ Collision = -0.10f;
+ Gravity = 0.00f;
+ Diffusion = 3.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 1;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Combines with O2 to make WATR";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_H2::update;
+
}
//#TPT-Directive ElementHeader Element_H2 static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_H2::update(UPDATE_FUNC_ARGS)
int r,rx,ry,rt;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/HFLM.cpp b/src/simulation/elements/HFLM.cpp
index e4fb3b4..1c39a2c 100644
--- a/src/simulation/elements/HFLM.cpp
+++ b/src/simulation/elements/HFLM.cpp
@@ -1,54 +1,54 @@
#include "simulation/Elements.h"
extern "C"
{
- #include "hmap.h"
+ #include "hmap.h"
}
//#TPT-Directive ElementClass Element_HFLM PT_HFLM 68
Element_HFLM::Element_HFLM()
{
- Identifier = "DEFAULT_PT_HFLM";
- Name = "CFLM";
- Colour = PIXPACK(0x8080FF);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.9f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.97f;
- Loss = 0.20f;
- Collision = 0.0f;
- Gravity = -0.1f;
- Diffusion = 0.00f;
- HotAir = 0.0005f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 2;
-
- Temperature = 0.0f;
- HeatConduct = 88;
- Description = "Sub-zero flame.";
-
- State = ST_LIQUID;
- Properties = TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
- Graphics = &Element_HFLM::graphics;
+ Identifier = "DEFAULT_PT_HFLM";
+ Name = "CFLM";
+ Colour = PIXPACK(0x8080FF);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.9f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.97f;
+ Loss = 0.20f;
+ Collision = 0.0f;
+ Gravity = -0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.0005f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 2;
+
+ Temperature = 0.0f;
+ HeatConduct = 88;
+ Description = "Sub-zero flame.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+ Graphics = &Element_HFLM::graphics;
}
//#TPT-Directive ElementHeader Element_HFLM static int graphics(GRAPHICS_FUNC_ARGS)
diff --git a/src/simulation/elements/HSWC.cpp b/src/simulation/elements/HSWC.cpp
index 1b3200d..499ce50 100644
--- a/src/simulation/elements/HSWC.cpp
+++ b/src/simulation/elements/HSWC.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_HSWC PT_HSWC 75
Element_HSWC::Element_HSWC()
{
- Identifier = "DEFAULT_PT_HSWC";
- Name = "HSWC";
- Colour = PIXPACK(0x3B0A0A);
- MenuVisible = 1;
- MenuSection = SC_POWERED;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Heat switch. Conducts Heat only when activated";
-
- State = ST_NONE;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_HSWC::update;
- Graphics = &Element_HSWC::graphics;
+ Identifier = "DEFAULT_PT_HSWC";
+ Name = "HSWC";
+ Colour = PIXPACK(0x3B0A0A);
+ MenuVisible = 1;
+ MenuSection = SC_POWERED;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Heat switch. Conducts Heat only when activated";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_HSWC::update;
+ Graphics = &Element_HSWC::graphics;
}
//#TPT-Directive ElementHeader Element_HSWC static int update(UPDATE_FUNC_ARGS)
@@ -59,7 +59,7 @@ int Element_HSWC::update(UPDATE_FUNC_ARGS)
{
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/ICEI.cpp b/src/simulation/elements/ICEI.cpp
index 95210bb..74386a6 100644
--- a/src/simulation/elements/ICEI.cpp
+++ b/src/simulation/elements/ICEI.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_ICEI PT_ICEI 13
Element_ICEI::Element_ICEI()
{
- Identifier = "DEFAULT_PT_ICEI";
- Name = "ICE";
- Colour = PIXPACK(0xA0C0FF);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = -0.0003f* CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 100;
-
- Temperature = R_TEMP-50.0f+273.15f;
- HeatConduct = 46;
- Description = "Solid. Freezes water. Crushes under pressure. Cools down air.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC|PROP_NEUTPASS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = 0.8f;
- HighPressureTransition = PT_SNOW;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 252.05f;
- HighTemperatureTransition = ST;
-
- Update = &Element_ICEI::update;
-
+ Identifier = "DEFAULT_PT_ICEI";
+ Name = "ICE";
+ Colour = PIXPACK(0xA0C0FF);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = -0.0003f* CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 100;
+
+ Temperature = R_TEMP-50.0f+273.15f;
+ HeatConduct = 46;
+ Description = "Solid. Freezes water. Crushes under pressure. Cools down air.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC|PROP_NEUTPASS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = 0.8f;
+ HighPressureTransition = PT_SNOW;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 252.05f;
+ HighTemperatureTransition = ST;
+
+ Update = &Element_ICEI::update;
+
}
//#TPT-Directive ElementHeader Element_ICEI static int update(UPDATE_FUNC_ARGS)
@@ -56,7 +56,7 @@ int Element_ICEI::update(UPDATE_FUNC_ARGS)
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/IGNT.cpp b/src/simulation/elements/IGNT.cpp
index 85a2441..c827e6a 100644
--- a/src/simulation/elements/IGNT.cpp
+++ b/src/simulation/elements/IGNT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_IGNT PT_IGNT 140
Element_IGNT::Element_IGNT()
{
- Identifier = "DEFAULT_PT_IGNT";
- Name = "IGNC";
- Colour = PIXPACK(0xC0B050);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 88;
- Description = "Ignition cord.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID | PROP_NEUTPENETRATE | PROP_SPARKSETTLE | PROP_LIFE_KILL;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 673.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = &Element_IGNT::update;
-
+ Identifier = "DEFAULT_PT_IGNT";
+ Name = "IGNC";
+ Colour = PIXPACK(0xC0B050);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 88;
+ Description = "Ignition cord.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID | PROP_NEUTPENETRATE | PROP_SPARKSETTLE | PROP_LIFE_KILL;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 673.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = &Element_IGNT::update;
+
}
//#TPT-Directive ElementHeader Element_IGNT static int update(UPDATE_FUNC_ARGS)
@@ -54,7 +54,7 @@ int Element_IGNT::update(UPDATE_FUNC_ARGS)
{
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/INSL.cpp b/src/simulation/elements/INSL.cpp
index 8685775..61ded31 100644
--- a/src/simulation/elements/INSL.cpp
+++ b/src/simulation/elements/INSL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_INSL PT_INSL 38
Element_INSL::Element_INSL()
{
- Identifier = "DEFAULT_PT_INSL";
- Name = "INSL";
- Colour = PIXPACK(0x9EA3B6);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.95f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 7;
- Explosive = 0;
- Meltable = 0;
- Hardness = 10;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Insulator, does not conduct heat or electricity.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_INSL";
+ Name = "INSL";
+ Colour = PIXPACK(0x9EA3B6);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.95f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 7;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 10;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Insulator, does not conduct heat or electricity.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+
}
Element_INSL::~Element_INSL() {} \ No newline at end of file
diff --git a/src/simulation/elements/INST.cpp b/src/simulation/elements/INST.cpp
index a8a8d3e..dcf1c11 100644
--- a/src/simulation/elements/INST.cpp
+++ b/src/simulation/elements/INST.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_INST PT_INST 106
Element_INST::Element_INST()
{
- Identifier = "DEFAULT_PT_INST";
- Name = "INST";
- Colour = PIXPACK(0x404039);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 1;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Instantly conducts, PSCN to charge, NSCN to take.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_INST";
+ Name = "INST";
+ Colour = PIXPACK(0x404039);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 1;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Instantly conducts, PSCN to charge, NSCN to take.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+
}
Element_INST::~Element_INST() {} \ No newline at end of file
diff --git a/src/simulation/elements/INVIS.cpp b/src/simulation/elements/INVIS.cpp
index 54d722d..18c78b9 100644
--- a/src/simulation/elements/INVIS.cpp
+++ b/src/simulation/elements/INVIS.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_INVIS PT_INVIS 115
Element_INVIS::Element_INVIS()
{
- Identifier = "DEFAULT_PT_INVIS";
- Name = "INVS";
- Colour = PIXPACK(0x00CCCC);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 15;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 164;
- Description = "Invisible to everything while under pressure.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID | PROP_NEUTPASS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_INVIS::update;
- Graphics = &Element_INVIS::graphics;
+ Identifier = "DEFAULT_PT_INVIS";
+ Name = "INVS";
+ Colour = PIXPACK(0x00CCCC);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 15;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 164;
+ Description = "Invisible to everything while under pressure.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID | PROP_NEUTPASS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_INVIS::update;
+ Graphics = &Element_INVIS::graphics;
}
//#TPT-Directive ElementHeader Element_INVIS static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/INWR.cpp b/src/simulation/elements/INWR.cpp
index 35d57ec..3e438be 100644
--- a/src/simulation/elements/INWR.cpp
+++ b/src/simulation/elements/INWR.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_INWR PT_INWR 62
Element_INWR::Element_INWR()
{
- Identifier = "DEFAULT_PT_INWR";
- Name = "INWR";
- Colour = PIXPACK(0x544141);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 1;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Insulated Wire. Doesn't conduct to metal or semiconductors.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1687.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_INWR";
+ Name = "INWR";
+ Colour = PIXPACK(0x544141);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 1;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Insulated Wire. Doesn't conduct to metal or semiconductors.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1687.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = NULL;
+
}
Element_INWR::~Element_INWR() {} \ No newline at end of file
diff --git a/src/simulation/elements/IRON.cpp b/src/simulation/elements/IRON.cpp
index 6551c2f..5f92136 100644
--- a/src/simulation/elements/IRON.cpp
+++ b/src/simulation/elements/IRON.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_IRON PT_IRON 76
Element_IRON::Element_IRON()
{
- Identifier = "DEFAULT_PT_IRON";
- Name = "IRON";
- Colour = PIXPACK(0x707070);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 1;
- Hardness = 50;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Rusts with salt, can be used for electrolysis of WATR";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1687.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = &Element_IRON::update;
-
+ Identifier = "DEFAULT_PT_IRON";
+ Name = "IRON";
+ Colour = PIXPACK(0x707070);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 1;
+ Hardness = 50;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Rusts with salt, can be used for electrolysis of WATR";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1687.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = &Element_IRON::update;
+
}
//#TPT-Directive ElementHeader Element_IRON static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_IRON::update(UPDATE_FUNC_ARGS)
int r, rx, ry, rt;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
switch (r&0xFF)
diff --git a/src/simulation/elements/ISOZ.cpp b/src/simulation/elements/ISOZ.cpp
index 9f9e9b1..a4036dd 100644
--- a/src/simulation/elements/ISOZ.cpp
+++ b/src/simulation/elements/ISOZ.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_ISOZ PT_ISOZ 107
Element_ISOZ::Element_ISOZ()
{
- Identifier = "DEFAULT_PT_ISOZ";
- Name = "ISOZ";
- Colour = PIXPACK(0xAA30D0);
- MenuVisible = 1;
- MenuSection = SC_NUCLEAR;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 24;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 29;
- Description = "Radioactive liquid";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_NEUTPENETRATE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 160.0f;
- LowTemperatureTransition = PT_ISZS;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_ISOZ::update;
-
+ Identifier = "DEFAULT_PT_ISOZ";
+ Name = "ISOZ";
+ Colour = PIXPACK(0xAA30D0);
+ MenuVisible = 1;
+ MenuSection = SC_NUCLEAR;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 24;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 29;
+ Description = "Radioactive liquid";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_NEUTPENETRATE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 160.0f;
+ LowTemperatureTransition = PT_ISZS;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_ISOZ::update;
+
}
//#TPT-Directive ElementHeader Element_ISOZ static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/ISZS.cpp b/src/simulation/elements/ISZS.cpp
index 3ee82cb..f810223 100644
--- a/src/simulation/elements/ISZS.cpp
+++ b/src/simulation/elements/ISZS.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_ISZS PT_ISZS 108
Element_ISZS::Element_ISZS()
{
- Identifier = "DEFAULT_PT_ISZS";
- Name = "ISZS";
- Colour = PIXPACK(0x662089);
- MenuVisible = 1;
- MenuSection = SC_NUCLEAR;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = -0.0007f* CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 1;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = 140.00f;
- HeatConduct = 251;
- Description = "Solid form of ISOZ, slowly decays.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 300.0f;
- HighTemperatureTransition = PT_ISOZ;
-
- Update = &Element_ISZS::update;
-
+ Identifier = "DEFAULT_PT_ISZS";
+ Name = "ISZS";
+ Colour = PIXPACK(0x662089);
+ MenuVisible = 1;
+ MenuSection = SC_NUCLEAR;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = -0.0007f* CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 1;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = 140.00f;
+ HeatConduct = 251;
+ Description = "Solid form of ISOZ, slowly decays.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 300.0f;
+ HighTemperatureTransition = PT_ISOZ;
+
+ Update = &Element_ISZS::update;
+
}
//#TPT-Directive ElementHeader Element_ISZS static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/LAVA.cpp b/src/simulation/elements/LAVA.cpp
index 35eefec..796af14 100644
--- a/src/simulation/elements/LAVA.cpp
+++ b/src/simulation/elements/LAVA.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_LAVA PT_LAVA 6
Element_LAVA::Element_LAVA()
{
- Identifier = "DEFAULT_PT_LAVA";
- Name = "LAVA";
- Colour = PIXPACK(0xE05010);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.3f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.95f;
- Loss = 0.80f;
- Collision = 0.0f;
- Gravity = 0.15f;
- Diffusion = 0.00f;
- HotAir = 0.0003f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 2;
-
- Weight = 45;
-
- Temperature = R_TEMP+1500.0f+273.15f;
- HeatConduct = 60;
- Description = "Heavy liquid. Ignites flammable materials. Solidifies when cold.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 2573.15f;
- LowTemperatureTransition = ST;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_FIRE::update;
- Graphics = &Element_LAVA::graphics;
+ Identifier = "DEFAULT_PT_LAVA";
+ Name = "LAVA";
+ Colour = PIXPACK(0xE05010);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.3f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.95f;
+ Loss = 0.80f;
+ Collision = 0.0f;
+ Gravity = 0.15f;
+ Diffusion = 0.00f;
+ HotAir = 0.0003f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 2;
+
+ Weight = 45;
+
+ Temperature = R_TEMP+1500.0f+273.15f;
+ HeatConduct = 60;
+ Description = "Heavy liquid. Ignites flammable materials. Solidifies when cold.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 2573.15f;
+ LowTemperatureTransition = ST;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_FIRE::update;
+ Graphics = &Element_LAVA::graphics;
}
diff --git a/src/simulation/elements/LCRY.cpp b/src/simulation/elements/LCRY.cpp
index 8bcf4d0..a6406ee 100644
--- a/src/simulation/elements/LCRY.cpp
+++ b/src/simulation/elements/LCRY.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_LCRY PT_LCRY 54
Element_LCRY::Element_LCRY()
{
- Identifier = "DEFAULT_PT_LCRY";
- Name = "LCRY";
- Colour = PIXPACK(0x505050);
- MenuVisible = 1;
- MenuSection = SC_POWERED;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Liquid Crystal. Changes colour when charged. (PSCN Charges, NSCN Discharges)";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1273.0f;
- HighTemperatureTransition = PT_BGLA;
-
- Update = &Element_LCRY::update;
- Graphics = &Element_LCRY::graphics;
+ Identifier = "DEFAULT_PT_LCRY";
+ Name = "LCRY";
+ Colour = PIXPACK(0x505050);
+ MenuVisible = 1;
+ MenuSection = SC_POWERED;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Liquid Crystal. Changes colour when charged. (PSCN Charges, NSCN Discharges)";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1273.0f;
+ HighTemperatureTransition = PT_BGLA;
+
+ Update = &Element_LCRY::update;
+ Graphics = &Element_LCRY::graphics;
}
//#TPT-Directive ElementHeader Element_LCRY static int update(UPDATE_FUNC_ARGS)
@@ -86,7 +86,7 @@ int Element_LCRY::update(UPDATE_FUNC_ARGS)
}
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/LIFE.cpp b/src/simulation/elements/LIFE.cpp
index 89062b2..9c5bdf8 100644
--- a/src/simulation/elements/LIFE.cpp
+++ b/src/simulation/elements/LIFE.cpp
@@ -6,53 +6,52 @@ pixel Element_GOL_colour[NGOL];
//#TPT-Directive ElementClass Element_LIFE PT_LIFE 78
Element_LIFE::Element_LIFE()
{
- Identifier = "DEFAULT_PT_LIFE";
- Name = "LIFE";
- Colour = PIXPACK(0x0CAC00);
- MenuVisible = 0;
- MenuSection = SC_LIFE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = 9000.0f;
- HeatConduct = 40;
- Description = "Game Of Life! B3/S23";
-
- State = ST_NONE;
- Properties = TYPE_SOLID|PROP_LIFE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;//&Element_LIFE::update;
- Graphics = &Element_LIFE::graphics;
-
- if(!Element_GOL_colourInit)
- {
- Element_GOL_colourInit = true;
+ Identifier = "DEFAULT_PT_LIFE";
+ Name = "LIFE";
+ Colour = PIXPACK(0x0CAC00);
+ MenuVisible = 0;
+ MenuSection = SC_LIFE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = 9000.0f;
+ HeatConduct = 40;
+ Description = "Game Of Life! B3/S23";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID|PROP_LIFE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;//&Element_LIFE::update;
+ Graphics = &Element_LIFE::graphics;
+ if(!Element_GOL_colourInit)
+ {
+ Element_GOL_colourInit = true;
int golMenuCount;
gol_menu * golMenuT = LoadGOLMenu(golMenuCount);
@@ -61,7 +60,7 @@ Element_LIFE::Element_LIFE()
Element_GOL_colour[i] = golMenuT[i].colour;
}
free(golMenuT);
- }
+ }
}
//#TPT-Directive ElementHeader Element_LIFE static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/LIGH.cpp b/src/simulation/elements/LIGH.cpp
index 2e64bb2..1556110 100644
--- a/src/simulation/elements/LIGH.cpp
+++ b/src/simulation/elements/LIGH.cpp
@@ -3,48 +3,48 @@
//#TPT-Directive ElementClass Element_LIGH PT_LIGH 87
Element_LIGH::Element_LIGH()
{
- Identifier = "DEFAULT_PT_LIGH";
- Name = "LIGH";
- Colour = PIXPACK(0xFFFFC0);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "More realistic lightning. Set pen size to set the size of the lightning.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_LIGH::update;
- Graphics = &Element_LIGH::graphics;
+ Identifier = "DEFAULT_PT_LIGH";
+ Name = "LIGH";
+ Colour = PIXPACK(0xFFFFC0);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "More realistic lightning. Set pen size to set the size of the lightning.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_LIGH::update;
+ Graphics = &Element_LIGH::graphics;
}
#define LIGHTING_POWER 0.65
@@ -82,7 +82,7 @@ int Element_LIGH::update(UPDATE_FUNC_ARGS)
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -90,7 +90,7 @@ int Element_LIGH::update(UPDATE_FUNC_ARGS)
rt = r&0xFF;
if ((surround_space || sim->elements[rt].Explosive) &&
(rt!=PT_SPNG || parts[r>>8].life==0) &&
- sim->elements[rt].Flammable && (sim->elements[rt].Flammable + (int)(sim->pv[(y+ry)/CELL][(x+rx)/CELL]*10.0f))>(rand()%1000))
+ sim->elements[rt].Flammable && (sim->elements[rt].Flammable + (int)(sim->pv[(y+ry)/CELL][(x+rx)/CELL]*10.0f))>(rand()%1000))
{
sim->part_change_type(r>>8,x+rx,y+ry,PT_FIRE);
parts[r>>8].temp = restrict_flt(sim->elements[PT_FIRE].Temperature + (sim->elements[rt].Flammable/2), MIN_TEMP, MAX_TEMP);
diff --git a/src/simulation/elements/LNTG.cpp b/src/simulation/elements/LNTG.cpp
index ac97191..f5c08c0 100644
--- a/src/simulation/elements/LNTG.cpp
+++ b/src/simulation/elements/LNTG.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_LNTG PT_LNTG 37
Element_LNTG::Element_LNTG()
{
- Identifier = "DEFAULT_PT_LNTG";
- Name = "LN2";
- Colour = PIXPACK(0x80A0DF);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 30;
-
- Temperature = 70.15f;
- HeatConduct = 70;
- Description = "Liquid Nitrogen. Very cold.";
-
- State = ST_SOLID;
- Properties = TYPE_LIQUID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 63.0f;
- LowTemperatureTransition = PT_NICE;
- HighTemperature = 77.0f;
- HighTemperatureTransition = PT_NONE;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_LNTG";
+ Name = "LN2";
+ Colour = PIXPACK(0x80A0DF);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 30;
+
+ Temperature = 70.15f;
+ HeatConduct = 70;
+ Description = "Liquid Nitrogen. Very cold.";
+
+ State = ST_SOLID;
+ Properties = TYPE_LIQUID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 63.0f;
+ LowTemperatureTransition = PT_NICE;
+ HighTemperature = 77.0f;
+ HighTemperatureTransition = PT_NONE;
+
+ Update = NULL;
+
}
Element_LNTG::~Element_LNTG() {} \ No newline at end of file
diff --git a/src/simulation/elements/LO2.cpp b/src/simulation/elements/LO2.cpp
index e032b9e..2b291f3 100644
--- a/src/simulation/elements/LO2.cpp
+++ b/src/simulation/elements/LO2.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_LO2 PT_LO2 60
Element_LO2::Element_LO2()
{
- Identifier = "DEFAULT_PT_LO2";
- Name = "LOXY";
- Colour = PIXPACK(0x80A0EF);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 5000;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 30;
-
- Temperature = 80.0f;
- HeatConduct = 70;
- Description = "Liquid Oxygen. Very cold. Reacts with fire";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 90.1f;
- HighTemperatureTransition = PT_O2;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_LO2";
+ Name = "LOXY";
+ Colour = PIXPACK(0x80A0EF);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 5000;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 30;
+
+ Temperature = 80.0f;
+ HeatConduct = 70;
+ Description = "Liquid Oxygen. Very cold. Reacts with fire";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 90.1f;
+ HighTemperatureTransition = PT_O2;
+
+ Update = NULL;
+
}
Element_LO2::~Element_LO2() {} \ No newline at end of file
diff --git a/src/simulation/elements/LOLZ.cpp b/src/simulation/elements/LOLZ.cpp
index f1d4167..301e99a 100644
--- a/src/simulation/elements/LOLZ.cpp
+++ b/src/simulation/elements/LOLZ.cpp
@@ -2,60 +2,60 @@
//#TPT-Directive ElementClass Element_LOLZ PT_LOLZ 123
Element_LOLZ::Element_LOLZ()
{
- Identifier = "DEFAULT_PT_LOLZ";
- Name = "LOLZ";
- Colour = PIXPACK(0x569212);
- MenuVisible = 1;
- MenuSection = SC_CRACKER2;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.00f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.0f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = 373.0f;
- HeatConduct = 40;
- Description = "Lolz";
-
- State = ST_GAS;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
+ Identifier = "DEFAULT_PT_LOLZ";
+ Name = "LOLZ";
+ Colour = PIXPACK(0x569212);
+ MenuVisible = 1;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.00f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.0f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = 373.0f;
+ HeatConduct = 40;
+ Description = "Lolz";
+
+ State = ST_GAS;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
}
//#TPT-Directive ElementHeader Element_LOLZ static int RuleTable[9][9]
int Element_LOLZ::RuleTable[9][9] =
{
- {0,0,0,0,0,0,0,0,0},
- {1,0,0,0,0,0,1,0,0},
- {1,0,0,0,0,0,1,0,0},
- {1,0,0,1,1,0,0,1,0},
- {1,0,1,0,0,1,0,1,0},
- {1,0,1,0,0,1,0,1,0},
- {0,1,0,1,1,0,0,1,0},
- {0,1,0,0,0,0,0,1,0},
- {0,1,0,0,0,0,0,1,0},
+ {0,0,0,0,0,0,0,0,0},
+ {1,0,0,0,0,0,1,0,0},
+ {1,0,0,0,0,0,1,0,0},
+ {1,0,0,1,1,0,0,1,0},
+ {1,0,1,0,0,1,0,1,0},
+ {1,0,1,0,0,1,0,1,0},
+ {0,1,0,1,1,0,0,1,0},
+ {0,1,0,0,0,0,0,1,0},
+ {0,1,0,0,0,0,0,1,0},
};
//#TPT-Directive ElementHeader Element_LOLZ static int lolz[XRES/9][YRES/9];
diff --git a/src/simulation/elements/LOVE.cpp b/src/simulation/elements/LOVE.cpp
index c5ce789..f3b476a 100644
--- a/src/simulation/elements/LOVE.cpp
+++ b/src/simulation/elements/LOVE.cpp
@@ -2,60 +2,60 @@
//#TPT-Directive ElementClass Element_LOVE PT_LOVE 94
Element_LOVE::Element_LOVE()
{
- Identifier = "DEFAULT_PT_LOVE";
- Name = "LOVE";
- Colour = PIXPACK(0xFF30FF);
- MenuVisible = 1;
- MenuSection = SC_CRACKER2;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.00f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.0f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = 373.0f;
- HeatConduct = 40;
- Description = "Love...";
-
- State = ST_GAS;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
+ Identifier = "DEFAULT_PT_LOVE";
+ Name = "LOVE";
+ Colour = PIXPACK(0xFF30FF);
+ MenuVisible = 1;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.00f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.0f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = 373.0f;
+ HeatConduct = 40;
+ Description = "Love...";
+
+ State = ST_GAS;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
}
//#TPT-Directive ElementHeader Element_LOVE static int RuleTable[9][9]
int Element_LOVE::RuleTable[9][9] =
{
- {0,0,1,1,0,0,0,0,0},
- {0,1,0,0,1,1,0,0,0},
- {1,0,0,0,0,0,1,0,0},
- {1,0,0,0,0,0,0,1,0},
- {0,1,0,0,0,0,0,0,1},
- {1,0,0,0,0,0,0,1,0},
- {1,0,0,0,0,0,1,0,0},
- {0,1,0,0,1,1,0,0,0},
- {0,0,1,1,0,0,0,0,0},
+ {0,0,1,1,0,0,0,0,0},
+ {0,1,0,0,1,1,0,0,0},
+ {1,0,0,0,0,0,1,0,0},
+ {1,0,0,0,0,0,0,1,0},
+ {0,1,0,0,0,0,0,0,1},
+ {1,0,0,0,0,0,0,1,0},
+ {1,0,0,0,0,0,1,0,0},
+ {0,1,0,0,1,1,0,0,0},
+ {0,0,1,1,0,0,0,0,0},
};
//#TPT-Directive ElementHeader Element_LOVE static int love[XRES/9][YRES/9];
diff --git a/src/simulation/elements/LRBD.cpp b/src/simulation/elements/LRBD.cpp
index f609cce..faf57cd 100644
--- a/src/simulation/elements/LRBD.cpp
+++ b/src/simulation/elements/LRBD.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_LRBD PT_LRBD 42
Element_LRBD::Element_LRBD()
{
- Identifier = "DEFAULT_PT_LRBD";
- Name = "LRBD";
- Colour = PIXPACK(0xAAAAAA);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.3f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.95f;
- Loss = 0.80f;
- Collision = 0.0f;
- Gravity = 0.15f;
- Diffusion = 0.00f;
- HotAir = 0.000001f* CFDS;
- Falldown = 2;
-
- Flammable = 1000;
- Explosive = 1;
- Meltable = 0;
- Hardness = 2;
-
- Weight = 45;
-
- Temperature = R_TEMP+45.0f+273.15f;
- HeatConduct = 170;
- Description = "Liquid Rubidium.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 311.0f;
- LowTemperatureTransition = PT_RBDM;
- HighTemperature = 961.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_LRBD";
+ Name = "LRBD";
+ Colour = PIXPACK(0xAAAAAA);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.3f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.95f;
+ Loss = 0.80f;
+ Collision = 0.0f;
+ Gravity = 0.15f;
+ Diffusion = 0.00f;
+ HotAir = 0.000001f* CFDS;
+ Falldown = 2;
+
+ Flammable = 1000;
+ Explosive = 1;
+ Meltable = 0;
+ Hardness = 2;
+
+ Weight = 45;
+
+ Temperature = R_TEMP+45.0f+273.15f;
+ HeatConduct = 170;
+ Description = "Liquid Rubidium.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 311.0f;
+ LowTemperatureTransition = PT_RBDM;
+ HighTemperature = 961.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = NULL;
+
}
Element_LRBD::~Element_LRBD() {} \ No newline at end of file
diff --git a/src/simulation/elements/MERC.cpp b/src/simulation/elements/MERC.cpp
index 57c6481..d14cdab 100644
--- a/src/simulation/elements/MERC.cpp
+++ b/src/simulation/elements/MERC.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_MERC PT_MERC 152
Element_MERC::Element_MERC()
{
- Identifier = "DEFAULT_PT_MERC";
- Name = "MERC";
- Colour = PIXPACK(0x736B6D);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.80f;
- Collision = 0.0f;
- Gravity = 0.3f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 91;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Mercury. Volume changes with temperature, Conductive.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_NEUTABSORB|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_MERC::update;
-
+ Identifier = "DEFAULT_PT_MERC";
+ Name = "MERC";
+ Colour = PIXPACK(0x736B6D);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.80f;
+ Collision = 0.0f;
+ Gravity = 0.3f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 91;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Mercury. Volume changes with temperature, Conductive.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_NEUTABSORB|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_MERC::update;
+
}
//#TPT-Directive ElementHeader Element_MERC static int update(UPDATE_FUNC_ARGS)
@@ -57,7 +57,7 @@ int Element_MERC::update(UPDATE_FUNC_ARGS)
{
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r || (parts[i].tmp >=maxtmp))
@@ -75,7 +75,7 @@ int Element_MERC::update(UPDATE_FUNC_ARGS)
else
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (parts[i].tmp<=maxtmp)
@@ -94,7 +94,7 @@ int Element_MERC::update(UPDATE_FUNC_ARGS)
{
rx = rand()%5-2;
ry = rand()%5-2;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/METL.cpp b/src/simulation/elements/METL.cpp
index 17b09d0..7432790 100644
--- a/src/simulation/elements/METL.cpp
+++ b/src/simulation/elements/METL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_METL PT_METL 14
Element_METL::Element_METL()
{
- Identifier = "DEFAULT_PT_METL";
- Name = "METL";
- Colour = PIXPACK(0x404060);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 1;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Solid. Conducts electricity. Meltable.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1273.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_METL";
+ Name = "METL";
+ Colour = PIXPACK(0x404060);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 1;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Solid. Conducts electricity. Meltable.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1273.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = NULL;
+
}
Element_METL::~Element_METL() {} \ No newline at end of file
diff --git a/src/simulation/elements/MORT.cpp b/src/simulation/elements/MORT.cpp
index f8f1d8c..768fddc 100644
--- a/src/simulation/elements/MORT.cpp
+++ b/src/simulation/elements/MORT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_MORT PT_MORT 77
Element_MORT::Element_MORT()
{
- Identifier = "DEFAULT_PT_MORT";
- Name = "MORT";
- Colour = PIXPACK(0xE0E0E0);
- MenuVisible = 1;
- MenuSection = SC_CRACKER2;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 1.00f;
- Collision = -0.99f;
- Gravity = 0.0f;
- Diffusion = 0.01f;
- HotAir = 0.002f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = -1;
-
- Temperature = R_TEMP+4.0f +273.15f;
- HeatConduct = 60;
- Description = "Steam Train.";
-
- State = ST_NONE;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_MORT::update;
-
+ Identifier = "DEFAULT_PT_MORT";
+ Name = "MORT";
+ Colour = PIXPACK(0xE0E0E0);
+ MenuVisible = 1;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 1.00f;
+ Collision = -0.99f;
+ Gravity = 0.0f;
+ Diffusion = 0.01f;
+ HotAir = 0.002f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = -1;
+
+ Temperature = R_TEMP+4.0f +273.15f;
+ HeatConduct = 60;
+ Description = "Steam Train.";
+
+ State = ST_NONE;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_MORT::update;
+
}
//#TPT-Directive ElementHeader Element_MORT static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/MWAX.cpp b/src/simulation/elements/MWAX.cpp
index 4153893..604a50d 100644
--- a/src/simulation/elements/MWAX.cpp
+++ b/src/simulation/elements/MWAX.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_MWAX PT_MWAX 34
Element_MWAX::Element_MWAX()
{
- Identifier = "DEFAULT_PT_MWAX";
- Name = "MWAX";
- Colour = PIXPACK(0xE0E0AA);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.3f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.95f;
- Loss = 0.80f;
- Collision = 0.0f;
- Gravity = 0.15f;
- Diffusion = 0.00f;
- HotAir = 0.000001f* CFDS;
- Falldown = 2;
-
- Flammable = 5;
- Explosive = 0;
- Meltable = 0;
- Hardness = 2;
-
- Weight = 25;
-
- Temperature = R_TEMP+28.0f+273.15f;
- HeatConduct = 44;
- Description = "Liquid Wax.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 318.0f;
- LowTemperatureTransition = PT_WAX;
- HighTemperature = 673.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_MWAX";
+ Name = "MWAX";
+ Colour = PIXPACK(0xE0E0AA);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.3f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.95f;
+ Loss = 0.80f;
+ Collision = 0.0f;
+ Gravity = 0.15f;
+ Diffusion = 0.00f;
+ HotAir = 0.000001f* CFDS;
+ Falldown = 2;
+
+ Flammable = 5;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 2;
+
+ Weight = 25;
+
+ Temperature = R_TEMP+28.0f+273.15f;
+ HeatConduct = 44;
+ Description = "Liquid Wax.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 318.0f;
+ LowTemperatureTransition = PT_WAX;
+ HighTemperature = 673.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = NULL;
+
}
Element_MWAX::~Element_MWAX() {} \ No newline at end of file
diff --git a/src/simulation/elements/NBHL.cpp b/src/simulation/elements/NBHL.cpp
index 2ccb864..d10f44a 100644
--- a/src/simulation/elements/NBHL.cpp
+++ b/src/simulation/elements/NBHL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_NBHL PT_NBHL 150
Element_NBHL::Element_NBHL()
{
- Identifier = "DEFAULT_PT_NBHL";
- Name = "BHOL";
- Colour = PIXPACK(0x202020);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 186;
- Description = "Black hole (Requires newtonian gravity)";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_NBHL::update;
-
+ Identifier = "DEFAULT_PT_NBHL";
+ Name = "BHOL";
+ Colour = PIXPACK(0x202020);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 186;
+ Description = "Black hole (Requires newtonian gravity)";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_NBHL::update;
+
}
//#TPT-Directive ElementHeader Element_NBHL static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/NBLE.cpp b/src/simulation/elements/NBLE.cpp
index d1ece54..ada32a9 100644
--- a/src/simulation/elements/NBLE.cpp
+++ b/src/simulation/elements/NBLE.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_NBLE PT_NBLE 52
Element_NBLE::Element_NBLE()
{
- Identifier = "DEFAULT_PT_NBLE";
- Name = "NBLE";
- Colour = PIXPACK(0xEB4917);
- MenuVisible = 1;
- MenuSection = SC_GAS;
- Enabled = 1;
-
- Advection = 1.0f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.30f;
- Collision = -0.1f;
- Gravity = 0.0f;
- Diffusion = 0.75f;
- HotAir = 0.001f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 1;
-
- Temperature = R_TEMP+2.0f +273.15f;
- HeatConduct = 106;
- Description = "Noble Gas. Diffuses. Conductive. Ionizes into plasma when introduced to electricity";
-
- State = ST_GAS;
- Properties = TYPE_GAS|PROP_CONDUCTS|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_NBLE::update;
-
+ Identifier = "DEFAULT_PT_NBLE";
+ Name = "NBLE";
+ Colour = PIXPACK(0xEB4917);
+ MenuVisible = 1;
+ MenuSection = SC_GAS;
+ Enabled = 1;
+
+ Advection = 1.0f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.30f;
+ Collision = -0.1f;
+ Gravity = 0.0f;
+ Diffusion = 0.75f;
+ HotAir = 0.001f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 1;
+
+ Temperature = R_TEMP+2.0f +273.15f;
+ HeatConduct = 106;
+ Description = "Noble Gas. Diffuses. Conductive. Ionizes into plasma when introduced to electricity";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS|PROP_CONDUCTS|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_NBLE::update;
+
}
//#TPT-Directive ElementHeader Element_NBLE static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/NEUT.cpp b/src/simulation/elements/NEUT.cpp
index 8a98ffa..5ae502b 100644
--- a/src/simulation/elements/NEUT.cpp
+++ b/src/simulation/elements/NEUT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_NEUT PT_NEUT 18
Element_NEUT::Element_NEUT()
{
- Identifier = "DEFAULT_PT_NEUT";
- Name = "NEUT";
- Colour = PIXPACK(0x20E0FF);
- MenuVisible = 1;
- MenuSection = SC_NUCLEAR;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 1.00f;
- Collision = -0.99f;
- Gravity = 0.0f;
- Diffusion = 0.01f;
- HotAir = 0.002f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = -1;
-
- Temperature = R_TEMP+4.0f +273.15f;
- HeatConduct = 60;
- Description = "Neutrons. Interact with matter in odd ways.";
-
- State = ST_GAS;
- Properties = TYPE_ENERGY|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_NEUT::update;
- Graphics = &Element_NEUT::graphics;
+ Identifier = "DEFAULT_PT_NEUT";
+ Name = "NEUT";
+ Colour = PIXPACK(0x20E0FF);
+ MenuVisible = 1;
+ MenuSection = SC_NUCLEAR;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 1.00f;
+ Collision = -0.99f;
+ Gravity = 0.0f;
+ Diffusion = 0.01f;
+ HotAir = 0.002f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = -1;
+
+ Temperature = R_TEMP+4.0f +273.15f;
+ HeatConduct = 60;
+ Description = "Neutrons. Interact with matter in odd ways.";
+
+ State = ST_GAS;
+ Properties = TYPE_ENERGY|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_NEUT::update;
+ Graphics = &Element_NEUT::graphics;
}
//#TPT-Directive ElementHeader Element_NEUT static int update(UPDATE_FUNC_ARGS)
@@ -53,7 +53,7 @@ int Element_NEUT::update(UPDATE_FUNC_ARGS)
int pressureFactor = 3 + (int)sim->pv[y/CELL][x/CELL];
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
switch (r&0xFF)
diff --git a/src/simulation/elements/NICE.cpp b/src/simulation/elements/NICE.cpp
index 8a6086e..0c121c6 100644
--- a/src/simulation/elements/NICE.cpp
+++ b/src/simulation/elements/NICE.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_NICE PT_NICE 51
Element_NICE::Element_NICE()
{
- Identifier = "DEFAULT_PT_NICE";
- Name = "NICE";
- Colour = PIXPACK(0xC0E0FF);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = -0.0005f* CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 100;
-
- Temperature = 35.0f;
- HeatConduct = 46;
- Description = "Nitrogen Ice.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 63.1f;
- HighTemperatureTransition = PT_LNTG;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_NICE";
+ Name = "NICE";
+ Colour = PIXPACK(0xC0E0FF);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = -0.0005f* CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 100;
+
+ Temperature = 35.0f;
+ HeatConduct = 46;
+ Description = "Nitrogen Ice.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 63.1f;
+ HighTemperatureTransition = PT_LNTG;
+
+ Update = NULL;
+
}
Element_NICE::~Element_NICE() {} \ No newline at end of file
diff --git a/src/simulation/elements/NITR.cpp b/src/simulation/elements/NITR.cpp
index bf0feee..55375b9 100644
--- a/src/simulation/elements/NITR.cpp
+++ b/src/simulation/elements/NITR.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_NITR PT_NITR 8
Element_NITR::Element_NITR()
{
- Identifier = "DEFAULT_PT_NITR";
- Name = "NITR";
- Colour = PIXPACK(0x20E010);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.5f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.92f;
- Loss = 0.97f;
- Collision = 0.0f;
- Gravity = 0.2f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 1000;
- Explosive = 2;
- Meltable = 0;
- Hardness = 3;
-
- Weight = 23;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 50;
- Description = "Liquid. Pressure sensitive explosive.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 673.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_NITR";
+ Name = "NITR";
+ Colour = PIXPACK(0x20E010);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.5f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.92f;
+ Loss = 0.97f;
+ Collision = 0.0f;
+ Gravity = 0.2f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 1000;
+ Explosive = 2;
+ Meltable = 0;
+ Hardness = 3;
+
+ Weight = 23;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 50;
+ Description = "Liquid. Pressure sensitive explosive.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 673.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = NULL;
+
}
Element_NITR::~Element_NITR() {} \ No newline at end of file
diff --git a/src/simulation/elements/NONE.cpp b/src/simulation/elements/NONE.cpp
index 95d9d3e..5dd02af 100644
--- a/src/simulation/elements/NONE.cpp
+++ b/src/simulation/elements/NONE.cpp
@@ -2,64 +2,64 @@
//#TPT-Directive ElementClass Element_NONE PT_NONE 0
Element_NONE::Element_NONE()
{
- Identifier = "DEFAULT_PT_NONE";
- Name = "";
- Colour = PIXPACK(0x000000);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Erases particles.";
-
- State = ST_NONE;
- Properties = 0;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
- IconGenerator = &Element_NONE::iconGen;
+ Identifier = "DEFAULT_PT_NONE";
+ Name = "";
+ Colour = PIXPACK(0x000000);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Erases particles.";
+
+ State = ST_NONE;
+ Properties = 0;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ 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);
+ 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);
- }
+ 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;
+ return newTexture;
}
diff --git a/src/simulation/elements/NSCN.cpp b/src/simulation/elements/NSCN.cpp
index c16e9c4..1e71f10 100644
--- a/src/simulation/elements/NSCN.cpp
+++ b/src/simulation/elements/NSCN.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_NSCN PT_NSCN 36
Element_NSCN::Element_NSCN()
{
- Identifier = "DEFAULT_PT_NSCN";
- Name = "NSCN";
- Colour = PIXPACK(0x505080);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 1;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "N-Type Silicon, Will not transfer current to P-Type Silicon.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1687.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_NSCN";
+ Name = "NSCN";
+ Colour = PIXPACK(0x505080);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 1;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "N-Type Silicon, Will not transfer current to P-Type Silicon.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1687.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = NULL;
+
}
Element_NSCN::~Element_NSCN() {} \ No newline at end of file
diff --git a/src/simulation/elements/NTCT.cpp b/src/simulation/elements/NTCT.cpp
index 2241468..c6c065e 100644
--- a/src/simulation/elements/NTCT.cpp
+++ b/src/simulation/elements/NTCT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_NTCT PT_NTCT 43
Element_NTCT::Element_NTCT()
{
- Identifier = "DEFAULT_PT_NTCT";
- Name = "NTCT";
- Colour = PIXPACK(0x505040);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 1;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Semi-conductor. Only conducts electricity when hot (More than 100C)";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1687.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = &Element_NTCT::update;
-
+ Identifier = "DEFAULT_PT_NTCT";
+ Name = "NTCT";
+ Colour = PIXPACK(0x505040);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 1;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Semi-conductor. Only conducts electricity when hot (More than 100C)";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1687.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = &Element_NTCT::update;
+
}
//#TPT-Directive ElementHeader Element_NTCT static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/NWHL.cpp b/src/simulation/elements/NWHL.cpp
index 7fcda4a..7db070c 100644
--- a/src/simulation/elements/NWHL.cpp
+++ b/src/simulation/elements/NWHL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_NWHL PT_NWHL 151
Element_NWHL::Element_NWHL()
{
- Identifier = "DEFAULT_PT_NWHL";
- Name = "WHOL";
- Colour = PIXPACK(0xFFFFFF);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 186;
- Description = "White hole (Requires newtonian gravity)";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_NWHL::update;
-
+ Identifier = "DEFAULT_PT_NWHL";
+ Name = "WHOL";
+ Colour = PIXPACK(0xFFFFFF);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 186;
+ Description = "White hole (Requires newtonian gravity)";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_NWHL::update;
+
}
//#TPT-Directive ElementHeader Element_NWHL static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/O2.cpp b/src/simulation/elements/O2.cpp
index d446834..9f543a1 100644
--- a/src/simulation/elements/O2.cpp
+++ b/src/simulation/elements/O2.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_O2 PT_O2 61
Element_O2::Element_O2()
{
- Identifier = "DEFAULT_PT_O2";
- Name = "OXYG";
- Colour = PIXPACK(0x80A0FF);
- MenuVisible = 1;
- MenuSection = SC_GAS;
- Enabled = 1;
-
- Advection = 2.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.30f;
- Collision = -0.1f;
- Gravity = 0.0f;
- Diffusion = 3.0f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 1;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Gas. Ignites easily.";
-
- State = ST_GAS;
- Properties = TYPE_GAS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 90.0f;
- LowTemperatureTransition = PT_LO2;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_O2::update;
-
+ Identifier = "DEFAULT_PT_O2";
+ Name = "OXYG";
+ Colour = PIXPACK(0x80A0FF);
+ MenuVisible = 1;
+ MenuSection = SC_GAS;
+ Enabled = 1;
+
+ Advection = 2.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.30f;
+ Collision = -0.1f;
+ Gravity = 0.0f;
+ Diffusion = 3.0f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 1;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Gas. Ignites easily.";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 90.0f;
+ LowTemperatureTransition = PT_LO2;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_O2::update;
+
}
//#TPT-Directive ElementHeader Element_O2 static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_O2::update(UPDATE_FUNC_ARGS)
int r,rx,ry;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/OIL.cpp b/src/simulation/elements/OIL.cpp
index a397ab8..3d2239d 100644
--- a/src/simulation/elements/OIL.cpp
+++ b/src/simulation/elements/OIL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_OIL PT_OIL 3
Element_OIL::Element_OIL()
{
- Identifier = "DEFAULT_PT_OIL";
- Name = "OIL";
- Colour = PIXPACK(0x404010);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 20;
- Explosive = 0;
- Meltable = 0;
- Hardness = 5;
-
- Weight = 20;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 42;
- Description = "Liquid. Flammable.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID | PROP_NEUTPASS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 333.0f;
- HighTemperatureTransition = PT_GAS;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_OIL";
+ Name = "OIL";
+ Colour = PIXPACK(0x404010);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 20;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 5;
+
+ Weight = 20;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 42;
+ Description = "Liquid. Flammable.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID | PROP_NEUTPASS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 333.0f;
+ HighTemperatureTransition = PT_GAS;
+
+ Update = NULL;
+
}
Element_OIL::~Element_OIL() {}
diff --git a/src/simulation/elements/PBCN.cpp b/src/simulation/elements/PBCN.cpp
index bec42db..86514f2 100644
--- a/src/simulation/elements/PBCN.cpp
+++ b/src/simulation/elements/PBCN.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PBCN PT_PBCN 153
Element_PBCN::Element_PBCN()
{
- Identifier = "DEFAULT_PT_PBCN";
- Name = "PBCN";
- Colour = PIXPACK(0x3B1D0A);
- MenuVisible = 1;
- MenuSection = SC_POWERED;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.97f;
- Loss = 0.50f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 12;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Powered breakable clone";
-
- State = ST_NONE;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_PBCN::update;
- Graphics = &Element_PBCN::graphics;
+ Identifier = "DEFAULT_PT_PBCN";
+ Name = "PBCN";
+ Colour = PIXPACK(0x3B1D0A);
+ MenuVisible = 1;
+ MenuSection = SC_POWERED;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.97f;
+ Loss = 0.50f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 12;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Powered breakable clone";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_PBCN::update;
+ Graphics = &Element_PBCN::graphics;
}
//#TPT-Directive ElementHeader Element_PBCN static int update(UPDATE_FUNC_ARGS)
@@ -66,7 +66,7 @@ int Element_PBCN::update(UPDATE_FUNC_ARGS)
if (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM || !sim->elements[parts[i].ctype].Enabled || (parts[i].ctype==PT_LIFE && (parts[i].tmp<0 || parts[i].tmp>=NGOL)))
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
+ if (BOUNDS_CHECK)
{
r = sim->photons[y+ry][x+rx];
if (!r)
@@ -75,10 +75,10 @@ int Element_PBCN::update(UPDATE_FUNC_ARGS)
continue;
rt = r&0xFF;
if (rt!=PT_CLNE && rt!=PT_PCLN &&
- rt!=PT_BCLN && rt!=PT_SPRK &&
- rt!=PT_NSCN && rt!=PT_PSCN &&
- rt!=PT_STKM && rt!=PT_STKM2 &&
- rt!=PT_PBCN && rt<PT_NUM)
+ rt!=PT_BCLN && rt!=PT_SPRK &&
+ rt!=PT_NSCN && rt!=PT_PSCN &&
+ rt!=PT_STKM && rt!=PT_STKM2 &&
+ rt!=PT_PBCN && rt<PT_NUM)
{
parts[i].ctype = rt;
if (rt==PT_LIFE || rt==PT_LAVA)
@@ -94,7 +94,7 @@ int Element_PBCN::update(UPDATE_FUNC_ARGS)
{
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/PCLN.cpp b/src/simulation/elements/PCLN.cpp
index 1cd2ede..6ad4964 100644
--- a/src/simulation/elements/PCLN.cpp
+++ b/src/simulation/elements/PCLN.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PCLN PT_PCLN 74
Element_PCLN::Element_PCLN()
{
- Identifier = "DEFAULT_PT_PCLN";
- Name = "PCLN";
- Colour = PIXPACK(0x3B3B0A);
- MenuVisible = 1;
- MenuSection = SC_POWERED;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Solid. When activated, duplicates any particles it touches.";
-
- State = ST_NONE;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_PCLN::update;
- Graphics = &Element_PCLN::graphics;
+ Identifier = "DEFAULT_PT_PCLN";
+ Name = "PCLN";
+ Colour = PIXPACK(0x3B3B0A);
+ MenuVisible = 1;
+ MenuSection = SC_POWERED;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Solid. When activated, duplicates any particles it touches.";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_PCLN::update;
+ Graphics = &Element_PCLN::graphics;
}
//#TPT-Directive ElementHeader Element_PCLN static int update(UPDATE_FUNC_ARGS)
@@ -54,7 +54,7 @@ int Element_PCLN::update(UPDATE_FUNC_ARGS)
parts[i].life--;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -80,7 +80,7 @@ int Element_PCLN::update(UPDATE_FUNC_ARGS)
if (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM || !sim->elements[parts[i].ctype].Enabled || (parts[i].ctype==PT_LIFE && (parts[i].tmp<0 || parts[i].tmp>=NGOL)))
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
+ if (BOUNDS_CHECK)
{
r = sim->photons[y+ry][x+rx];
if (!r)
@@ -89,10 +89,10 @@ int Element_PCLN::update(UPDATE_FUNC_ARGS)
continue;
rt = r&0xFF;
if (rt!=PT_CLNE && rt!=PT_PCLN &&
- rt!=PT_BCLN && rt!=PT_SPRK &&
- rt!=PT_NSCN && rt!=PT_PSCN &&
- rt!=PT_STKM && rt!=PT_STKM2 &&
- rt!=PT_PBCN && rt<PT_NUM)
+ rt!=PT_BCLN && rt!=PT_SPRK &&
+ rt!=PT_NSCN && rt!=PT_PSCN &&
+ rt!=PT_STKM && rt!=PT_STKM2 &&
+ rt!=PT_PBCN && rt<PT_NUM)
{
parts[i].ctype = rt;
if (rt==PT_LIFE || rt==PT_LAVA)
diff --git a/src/simulation/elements/PHOT.cpp b/src/simulation/elements/PHOT.cpp
index 9a69cbc..943e603 100644
--- a/src/simulation/elements/PHOT.cpp
+++ b/src/simulation/elements/PHOT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PHOT PT_PHOT 31
Element_PHOT::Element_PHOT()
{
- Identifier = "DEFAULT_PT_PHOT";
- Name = "PHOT";
- Colour = PIXPACK(0xFFFFFF);
- MenuVisible = 1;
- MenuSection = SC_NUCLEAR;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 1.00f;
- Collision = -0.99f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = -1;
-
- Temperature = R_TEMP+900.0f+273.15f;
- HeatConduct = 251;
- Description = "Photons. Travel in straight lines.";
-
- State = ST_GAS;
- Properties = TYPE_ENERGY|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_PHOT::update;
- Graphics = &Element_PHOT::graphics;
+ Identifier = "DEFAULT_PT_PHOT";
+ Name = "PHOT";
+ Colour = PIXPACK(0xFFFFFF);
+ MenuVisible = 1;
+ MenuSection = SC_NUCLEAR;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 1.00f;
+ Collision = -0.99f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = -1;
+
+ Temperature = R_TEMP+900.0f+273.15f;
+ HeatConduct = 251;
+ Description = "Photons. Travel in straight lines.";
+
+ State = ST_GAS;
+ Properties = TYPE_ENERGY|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_PHOT::update;
+ Graphics = &Element_PHOT::graphics;
}
//#TPT-Directive ElementHeader Element_PHOT static int update(UPDATE_FUNC_ARGS)
@@ -61,7 +61,7 @@ int Element_PHOT::update(UPDATE_FUNC_ARGS)
if (!(rand()%10)) Element_FIRE::update(UPDATE_FUNC_SUBCALL_ARGS);
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES) {
+ if (BOUNDS_CHECK) {
r = pmap[y+ry][x+rx];
if (!r)
continue;
diff --git a/src/simulation/elements/PIPE.cpp b/src/simulation/elements/PIPE.cpp
index b82e402..0e49890 100644
--- a/src/simulation/elements/PIPE.cpp
+++ b/src/simulation/elements/PIPE.cpp
@@ -92,7 +92,7 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS)
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
{
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if ((r&0xFF) == PT_BRCK)
@@ -135,7 +135,7 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS)
// make automatic pipe pattern
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -182,7 +182,7 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS)
rndstore = rndstore>>3;
rx = pos_1_rx[rnd];
ry = pos_1_ry[rnd];
- if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
+ if (BOUNDS_CHECK)
{
r = pmap[y+ry][x+rx];
if(!r)
@@ -230,7 +230,7 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS)
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
{
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -251,7 +251,7 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS)
{
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
if (!pmap[y+ry][x+rx] && sim->bmap[(y+ry)/CELL][(x+rx)/CELL]!=WL_ALLOWAIR && sim->bmap[(y+ry)/CELL][(x+rx)/CELL]!=WL_WALL && sim->bmap[(y+ry)/CELL][(x+rx)/CELL]!=WL_WALLELEC && (sim->bmap[(y+ry)/CELL][(x+rx)/CELL]!=WL_EWALL || sim->emap[(y+ry)/CELL][(x+rx)/CELL]))
parts[i].life=50;
@@ -262,7 +262,7 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS)
int issingle = 1;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (((r&0xFF)==PT_PIPE || (r&0xFF) == PT_PPIP) && parts[i].ctype==1 && parts[i].life )
@@ -284,9 +284,7 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS)
//#TPT-Directive ElementHeader Element_PIPE static int graphics(GRAPHICS_FUNC_ARGS)
int Element_PIPE::graphics(GRAPHICS_FUNC_ARGS)
-
{
-
if ((cpart->tmp&0xFF)>0 && (cpart->tmp&0xFF)<PT_NUM)
{
//Create a temp. particle and do a subcall.
diff --git a/src/simulation/elements/PLEX.cpp b/src/simulation/elements/PLEX.cpp
index c2f157b..13672a1 100644
--- a/src/simulation/elements/PLEX.cpp
+++ b/src/simulation/elements/PLEX.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PLEX PT_PLEX 11
Element_PLEX::Element_PLEX()
{
- Identifier = "DEFAULT_PT_PLEX";
- Name = "C-4";
- Colour = PIXPACK(0xD080E0);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 1000;
- Explosive = 2;
- Meltable = 50;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 88;
- Description = "Solid. Pressure sensitive explosive.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID | PROP_NEUTPENETRATE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 673.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_PLEX";
+ Name = "C-4";
+ Colour = PIXPACK(0xD080E0);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 1000;
+ Explosive = 2;
+ Meltable = 50;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 88;
+ Description = "Solid. Pressure sensitive explosive.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID | PROP_NEUTPENETRATE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 673.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = NULL;
+
}
Element_PLEX::~Element_PLEX() {} \ No newline at end of file
diff --git a/src/simulation/elements/PLNT.cpp b/src/simulation/elements/PLNT.cpp
index dd8928c..4a8a591 100644
--- a/src/simulation/elements/PLNT.cpp
+++ b/src/simulation/elements/PLNT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PLNT PT_PLNT 20
Element_PLNT::Element_PLNT()
{
- Identifier = "DEFAULT_PT_PLNT";
- Name = "PLNT";
- Colour = PIXPACK(0x0CAC00);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.95f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 20;
- Explosive = 0;
- Meltable = 0;
- Hardness = 10;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 65;
- Description = "Plant, drinks water and grows.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_NEUTPENETRATE|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 573.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = &Element_PLNT::update;
- Graphics = &Element_PLNT::graphics;
+ Identifier = "DEFAULT_PT_PLNT";
+ Name = "PLNT";
+ Colour = PIXPACK(0x0CAC00);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.95f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 20;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 10;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 65;
+ Description = "Plant, drinks water and grows.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_NEUTPENETRATE|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 573.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = &Element_PLNT::update;
+ Graphics = &Element_PLNT::graphics;
}
//#TPT-Directive ElementHeader Element_PLNT static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_PLNT::update(UPDATE_FUNC_ARGS)
int r, rx, ry, np;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
switch (r&0xFF)
@@ -103,7 +103,7 @@ int Element_PLNT::update(UPDATE_FUNC_ARGS)
{
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/PLSM.cpp b/src/simulation/elements/PLSM.cpp
index 4812b84..6d39a6b 100644
--- a/src/simulation/elements/PLSM.cpp
+++ b/src/simulation/elements/PLSM.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PLSM PT_PLSM 49
Element_PLSM::Element_PLSM()
{
- Identifier = "DEFAULT_PT_PLSM";
- Name = "PLSM";
- Colour = PIXPACK(0xBB99FF);
- MenuVisible = 1;
- MenuSection = SC_GAS;
- Enabled = 1;
-
- Advection = 0.9f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.97f;
- Loss = 0.20f;
- Collision = 0.0f;
- Gravity = -0.1f;
- Diffusion = 0.30f;
- HotAir = 0.001f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 1;
-
- Temperature = 10000.0f +273.15f;
- HeatConduct = 5;
- Description = "Plasma, extremely hot.";
-
- State = ST_NONE;
- Properties = TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_FIRE::update;
- Graphics = &Element_PLSM::graphics;
+ Identifier = "DEFAULT_PT_PLSM";
+ Name = "PLSM";
+ Colour = PIXPACK(0xBB99FF);
+ MenuVisible = 1;
+ MenuSection = SC_GAS;
+ Enabled = 1;
+
+ Advection = 0.9f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.97f;
+ Loss = 0.20f;
+ Collision = 0.0f;
+ Gravity = -0.1f;
+ Diffusion = 0.30f;
+ HotAir = 0.001f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 1;
+
+ Temperature = 10000.0f +273.15f;
+ HeatConduct = 5;
+ Description = "Plasma, extremely hot.";
+
+ State = ST_NONE;
+ Properties = TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_FIRE::update;
+ Graphics = &Element_PLSM::graphics;
}
//#TPT-Directive ElementHeader Element_PLSM static int graphics(GRAPHICS_FUNC_ARGS)
diff --git a/src/simulation/elements/PLUT.cpp b/src/simulation/elements/PLUT.cpp
index 282de46..4247357 100644
--- a/src/simulation/elements/PLUT.cpp
+++ b/src/simulation/elements/PLUT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PLUT PT_PLUT 19
Element_PLUT::Element_PLUT()
{
- Identifier = "DEFAULT_PT_PLUT";
- Name = "PLUT";
- Colour = PIXPACK(0x407020);
- MenuVisible = 1;
- MenuSection = SC_NUCLEAR;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.4f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 90;
-
- Temperature = R_TEMP+4.0f +273.15f;
- HeatConduct = 251;
- Description = "Heavy particles. Fissile. Generates neutrons under pressure.";
-
- State = ST_SOLID;
- Properties = TYPE_PART|PROP_NEUTPASS|PROP_RADIOACTIVE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_PLUT::update;
-
+ Identifier = "DEFAULT_PT_PLUT";
+ Name = "PLUT";
+ Colour = PIXPACK(0x407020);
+ MenuVisible = 1;
+ MenuSection = SC_NUCLEAR;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.4f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 90;
+
+ Temperature = R_TEMP+4.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Heavy particles. Fissile. Generates neutrons under pressure.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART|PROP_NEUTPASS|PROP_RADIOACTIVE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_PLUT::update;
+
}
//#TPT-Directive ElementHeader Element_PLUT static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/PQRT.cpp b/src/simulation/elements/PQRT.cpp
index 2b3898f..f27936d 100644
--- a/src/simulation/elements/PQRT.cpp
+++ b/src/simulation/elements/PQRT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PQRT PT_PQRT 133
Element_PQRT::Element_PQRT()
{
- Identifier = "DEFAULT_PT_PQRT";
- Name = "PQRT";
- Colour = PIXPACK(0x88BBBB);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.95f;
- Collision = -0.1f;
- Gravity = 0.27f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 90;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 3;
- Description = "Broken quartz.";
-
- State = ST_SOLID;
- Properties = TYPE_PART| PROP_HOT_GLOW;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 2573.15f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = &Element_PQRT::update;
- Graphics = &Element_PQRT::graphics;
+ Identifier = "DEFAULT_PT_PQRT";
+ Name = "PQRT";
+ Colour = PIXPACK(0x88BBBB);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.95f;
+ Collision = -0.1f;
+ Gravity = 0.27f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 90;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 3;
+ Description = "Broken quartz.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART| PROP_HOT_GLOW;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 2573.15f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = &Element_PQRT::update;
+ Graphics = &Element_PQRT::graphics;
}
//#TPT-Directive ElementHeader Element_PQRT static int update(UPDATE_FUNC_ARGS)
@@ -54,7 +54,7 @@ int Element_PQRT::update(UPDATE_FUNC_ARGS)
if (parts[i].ctype!=-1)
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -78,7 +78,7 @@ int Element_PQRT::update(UPDATE_FUNC_ARGS)
rnd = rnd>>3;
ry = (rnd%5)-2;
sry = (rnd%3)-1;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
if (!stopgrow)//try to grow
{
diff --git a/src/simulation/elements/PRTI.cpp b/src/simulation/elements/PRTI.cpp
index fc48325..4f5a0f5 100644
--- a/src/simulation/elements/PRTI.cpp
+++ b/src/simulation/elements/PRTI.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PRTI PT_PRTI 109
Element_PRTI::Element_PRTI()
{
- Identifier = "DEFAULT_PT_PRTI";
- Name = "PRTI";
- Colour = PIXPACK(0xEB5917);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = -0.005f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Portal IN. Things go in here, now with channels (same as WIFI)";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_PRTI::update;
- Graphics = &Element_PRTI::graphics;
+ Identifier = "DEFAULT_PT_PRTI";
+ Name = "PRTI";
+ Colour = PIXPACK(0xEB5917);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = -0.005f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Portal IN. Things go in here, now with channels (same as WIFI)";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_PRTI::update;
+ Graphics = &Element_PRTI::graphics;
}
/*these are the count values of where the particle gets stored, depending on where it came from
@@ -66,7 +66,7 @@ int Element_PRTI::update(UPDATE_FUNC_ARGS)
{
rx = sim->portal_rx[count];
ry = sim->portal_ry[count];
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/PRTO.cpp b/src/simulation/elements/PRTO.cpp
index e3d6938..d4a6cda 100644
--- a/src/simulation/elements/PRTO.cpp
+++ b/src/simulation/elements/PRTO.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PRTO PT_PRTO 110
Element_PRTO::Element_PRTO()
{
- Identifier = "DEFAULT_PT_PRTO";
- Name = "PRTO";
- Colour = PIXPACK(0x0020EB);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.005f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Portal OUT. Things come out here, now with channels (same as WIFI)";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_PRTO::update;
- Graphics = &Element_PRTO::graphics;
+ Identifier = "DEFAULT_PT_PRTO";
+ Name = "PRTO";
+ Colour = PIXPACK(0x0020EB);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.005f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Portal OUT. Things come out here, now with channels (same as WIFI)";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_PRTO::update;
+ Graphics = &Element_PRTO::graphics;
}
/*these are the count values of where the particle gets stored, depending on where it came from
@@ -66,7 +66,7 @@ int Element_PRTO::update(UPDATE_FUNC_ARGS)
{
rx = sim->portal_rx[count];
ry = sim->portal_ry[count];
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/PSCN.cpp b/src/simulation/elements/PSCN.cpp
index b074f7b..5456eaf 100644
--- a/src/simulation/elements/PSCN.cpp
+++ b/src/simulation/elements/PSCN.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PSCN PT_PSCN 35
Element_PSCN::Element_PSCN()
{
- Identifier = "DEFAULT_PT_PSCN";
- Name = "PSCN";
- Colour = PIXPACK(0x805050);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 1;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "P-Type Silicon, Will transfer current to any conductor.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1687.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_PSCN";
+ Name = "PSCN";
+ Colour = PIXPACK(0x805050);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 1;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "P-Type Silicon, Will transfer current to any conductor.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1687.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = NULL;
+
}
Element_PSCN::~Element_PSCN() {} \ No newline at end of file
diff --git a/src/simulation/elements/PSTE.cpp b/src/simulation/elements/PSTE.cpp
index 6efea51..1dc12fa 100644
--- a/src/simulation/elements/PSTE.cpp
+++ b/src/simulation/elements/PSTE.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PSTE PT_PSTE 111
Element_PSTE::Element_PSTE()
{
- Identifier = "DEFAULT_PT_PSTE";
- Name = "PSTE";
- Colour = PIXPACK(0xAA99AA);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 31;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 29;
- Description = "Colloid, Hardens under pressure";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = 0.5f;
- HighPressureTransition = PT_PSTS;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 747.0f;
- HighTemperatureTransition = PT_BRCK;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_PSTE";
+ Name = "PSTE";
+ Colour = PIXPACK(0xAA99AA);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 31;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 29;
+ Description = "Colloid, Hardens under pressure";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = 0.5f;
+ HighPressureTransition = PT_PSTS;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 747.0f;
+ HighTemperatureTransition = PT_BRCK;
+
+ Update = NULL;
+
}
Element_PSTE::~Element_PSTE() {} \ No newline at end of file
diff --git a/src/simulation/elements/PSTN.cpp b/src/simulation/elements/PSTN.cpp
index 0c350b1..0f6e916 100644
--- a/src/simulation/elements/PSTN.cpp
+++ b/src/simulation/elements/PSTN.cpp
@@ -2,49 +2,48 @@
//#TPT-Directive ElementClass Element_PSTN PT_PSTN 168
Element_PSTN::Element_PSTN()
{
- Identifier = "DEFAULT_PT_PSTN";
- Name = "PSTN";
- Colour = PIXPACK(0xAA9999);
- MenuVisible = 1;
- MenuSection = SC_FORCE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Piston, extends and pushes particles";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_PSTN::update;
- Graphics = &Element_PSTN::graphics;
-
+ Identifier = "DEFAULT_PT_PSTN";
+ Name = "PSTN";
+ Colour = PIXPACK(0xAA9999);
+ MenuVisible = 1;
+ MenuSection = SC_FORCE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Piston, extends and pushes particles";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_PSTN::update;
+ Graphics = &Element_PSTN::graphics;
}
//#TPT-Directive ElementHeader Element_PSTN static int tempParts[128];
@@ -70,7 +69,7 @@ int Element_PSTN::update(UPDATE_FUNC_ARGS)
if (state == PISTON_INACTIVE) {
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry) && (!rx || !ry))
+ if (BOUNDS_CHECK && (rx || ry) && (!rx || !ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -86,7 +85,7 @@ int Element_PSTN::update(UPDATE_FUNC_ARGS)
if(state == PISTON_EXTEND || state == PISTON_RETRACT) {
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry) && (!rx || !ry))
+ if (BOUNDS_CHECK && (rx || ry) && (!rx || !ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/PSTS.cpp b/src/simulation/elements/PSTS.cpp
index 5dd331c..d6cfdc4 100644
--- a/src/simulation/elements/PSTS.cpp
+++ b/src/simulation/elements/PSTS.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PSTS PT_PSTS 112
Element_PSTS::Element_PSTS()
{
- Identifier = "DEFAULT_PT_PSTS";
- Name = "PSTS";
- Colour = PIXPACK(0x776677);
- MenuVisible = 0;
- MenuSection = SC_CRACKER;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.00f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 100;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 29;
- Description = "Solid form of PSTE, temporary";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = 0.5f;
- LowPressureTransition = PT_PSTE;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_PSTS";
+ Name = "PSTS";
+ Colour = PIXPACK(0x776677);
+ MenuVisible = 0;
+ MenuSection = SC_CRACKER;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.00f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 100;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 29;
+ Description = "Solid form of PSTE, temporary";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = 0.5f;
+ LowPressureTransition = PT_PSTE;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+
}
Element_PSTS::~Element_PSTS() {} \ No newline at end of file
diff --git a/src/simulation/elements/PTCT.cpp b/src/simulation/elements/PTCT.cpp
index bda58c7..7d3738d 100644
--- a/src/simulation/elements/PTCT.cpp
+++ b/src/simulation/elements/PTCT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PTCT PT_PTCT 46
Element_PTCT::Element_PTCT()
{
- Identifier = "DEFAULT_PT_PTCT";
- Name = "PTCT";
- Colour = PIXPACK(0x405050);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 1;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Semi-conductor. Only conducts electricity when cold (Less than 100C)";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1414.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = &Element_PTCT::update;
-
+ Identifier = "DEFAULT_PT_PTCT";
+ Name = "PTCT";
+ Colour = PIXPACK(0x405050);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 1;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Semi-conductor. Only conducts electricity when cold (Less than 100C)";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1414.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = &Element_PTCT::update;
+
}
//#TPT-Directive ElementHeader Element_PTCT static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/PUMP.cpp b/src/simulation/elements/PUMP.cpp
index c8d48ff..4c02cdc 100644
--- a/src/simulation/elements/PUMP.cpp
+++ b/src/simulation/elements/PUMP.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PUMP PT_PUMP 97
Element_PUMP::Element_PUMP()
{
- Identifier = "DEFAULT_PT_PUMP";
- Name = "PUMP";
- Colour = PIXPACK(0x0A0A3B);
- MenuVisible = 1;
- MenuSection = SC_POWERED;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.95f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 10;
-
- Weight = 100;
-
- Temperature = 273.15f;
- HeatConduct = 0;
- Description = "Changes pressure to its temp when activated. (use HEAT/COOL).";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_PUMP::update;
- Graphics = &Element_PUMP::graphics;
+ Identifier = "DEFAULT_PT_PUMP";
+ Name = "PUMP";
+ Colour = PIXPACK(0x0A0A3B);
+ MenuVisible = 1;
+ MenuSection = SC_POWERED;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.95f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 10;
+
+ Weight = 100;
+
+ Temperature = 273.15f;
+ HeatConduct = 0;
+ Description = "Changes pressure to its temp when activated. (use HEAT/COOL).";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_PUMP::update;
+ Graphics = &Element_PUMP::graphics;
}
//#TPT-Directive ElementHeader Element_PUMP static int update(UPDATE_FUNC_ARGS)
@@ -70,7 +70,7 @@ int Element_PUMP::update(UPDATE_FUNC_ARGS)
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/PVOD.cpp b/src/simulation/elements/PVOD.cpp
index 2478a7c..34e44be 100644
--- a/src/simulation/elements/PVOD.cpp
+++ b/src/simulation/elements/PVOD.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_PVOD PT_PVOD 84
Element_PVOD::Element_PVOD()
{
- Identifier = "DEFAULT_PT_PVOD";
- Name = "PVOD";
- Colour = PIXPACK(0x792020);
- MenuVisible = 1;
- MenuSection = SC_POWERED;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Solid. When activated, destroys entering particles";
-
- State = ST_NONE;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_PVOD::update;
- Graphics = &Element_PVOD::graphics;
+ Identifier = "DEFAULT_PT_PVOD";
+ Name = "PVOD";
+ Colour = PIXPACK(0x792020);
+ MenuVisible = 1;
+ MenuSection = SC_POWERED;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Solid. When activated, destroys entering particles";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_PVOD::update;
+ Graphics = &Element_PVOD::graphics;
}
//#TPT-Directive ElementHeader Element_PVOD static int update(UPDATE_FUNC_ARGS)
@@ -54,7 +54,7 @@ int Element_PVOD::update(UPDATE_FUNC_ARGS)
parts[i].life--;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/QRTZ.cpp b/src/simulation/elements/QRTZ.cpp
index 6e5102c..a9510b1 100644
--- a/src/simulation/elements/QRTZ.cpp
+++ b/src/simulation/elements/QRTZ.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_QRTZ PT_QRTZ 132
Element_QRTZ::Element_QRTZ()
{
- Identifier = "DEFAULT_PT_QRTZ";
- Name = "QRTZ";
- Colour = PIXPACK(0xAADDDD);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 3;
- Description = "Quartz, breakable mineral. Conducts but becomes brittle at lower temperatures.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_HOT_GLOW|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 2573.15f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = &Element_QRTZ::update;
- Graphics = &Element_QRTZ::graphics;
+ Identifier = "DEFAULT_PT_QRTZ";
+ Name = "QRTZ";
+ Colour = PIXPACK(0xAADDDD);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 3;
+ Description = "Quartz, breakable mineral. Conducts but becomes brittle at lower temperatures.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_HOT_GLOW|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 2573.15f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = &Element_QRTZ::update;
+ Graphics = &Element_QRTZ::graphics;
}
//#TPT-Directive ElementHeader Element_QRTZ static int update(UPDATE_FUNC_ARGS)
@@ -60,7 +60,7 @@ int Element_QRTZ::update(UPDATE_FUNC_ARGS)
if (parts[i].ctype!=-1)
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -84,7 +84,7 @@ int Element_QRTZ::update(UPDATE_FUNC_ARGS)
rnd >>= 3;
ry = (rnd%5)-2;
sry = (rnd%3)-1;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
if (!stopgrow)//try to grow
{
diff --git a/src/simulation/elements/RBDM.cpp b/src/simulation/elements/RBDM.cpp
index 90a332b..eb25df4 100644
--- a/src/simulation/elements/RBDM.cpp
+++ b/src/simulation/elements/RBDM.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_RBDM PT_RBDM 41
Element_RBDM::Element_RBDM()
{
- Identifier = "DEFAULT_PT_RBDM";
- Name = "RBDM";
- Colour = PIXPACK(0xCCCCCC);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 1000;
- Explosive = 1;
- Meltable = 50;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 240;
- Description = "Rubidium, explosive, especially on contact with water, low melting point";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 312.0f;
- HighTemperatureTransition = PT_LRBD;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_RBDM";
+ Name = "RBDM";
+ Colour = PIXPACK(0xCCCCCC);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 1000;
+ Explosive = 1;
+ Meltable = 50;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 240;
+ Description = "Rubidium, explosive, especially on contact with water, low melting point";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 312.0f;
+ HighTemperatureTransition = PT_LRBD;
+
+ Update = NULL;
+
}
Element_RBDM::~Element_RBDM() {} \ No newline at end of file
diff --git a/src/simulation/elements/REPL.cpp b/src/simulation/elements/REPL.cpp
index 0b68487..aa513e9 100644
--- a/src/simulation/elements/REPL.cpp
+++ b/src/simulation/elements/REPL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_REPL PT_REPL 160
Element_REPL::Element_REPL()
{
- Identifier = "DEFAULT_PT_REPL";
- Name = "RPEL";
- Colour = PIXPACK(0x99CC00);
- MenuVisible = 1;
- MenuSection = SC_FORCE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = 20.0f+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Repel or attract particles based on temp value.";
-
- State = ST_NONE;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_REPL::update;
-
+ Identifier = "DEFAULT_PT_REPL";
+ Name = "RPEL";
+ Colour = PIXPACK(0x99CC00);
+ MenuVisible = 1;
+ MenuSection = SC_FORCE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = 20.0f+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Repel or attract particles based on temp value.";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_REPL::update;
+
}
//#TPT-Directive ElementHeader Element_REPL static int update(UPDATE_FUNC_ARGS)
@@ -54,7 +54,7 @@ int Element_REPL::update(UPDATE_FUNC_ARGS)
{
rx = (rand()%21)-10;
ry = (rand()%21)-10;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/RIME.cpp b/src/simulation/elements/RIME.cpp
index bf15dc4..ab61988 100644
--- a/src/simulation/elements/RIME.cpp
+++ b/src/simulation/elements/RIME.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_RIME PT_RIME 91
Element_RIME::Element_RIME()
{
- Identifier = "DEFAULT_PT_RIME";
- Name = "RIME";
- Colour = PIXPACK(0xCCCCCC);
- MenuVisible = 1;
- MenuSection = SC_CRACKER2;
- Enabled = 1;
-
- Advection = 0.00f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.00f;
- Loss = 0.00f;
- Collision = 0.00f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 30;
-
- Weight = 100;
-
- Temperature = 243.15f;
- HeatConduct = 100;
- Description = "Not quite Ice";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 273.15f;
- HighTemperatureTransition = PT_WATR;
-
- Update = &Element_RIME::update;
-
+ Identifier = "DEFAULT_PT_RIME";
+ Name = "RIME";
+ Colour = PIXPACK(0xCCCCCC);
+ MenuVisible = 1;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 0.00f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.00f;
+ Loss = 0.00f;
+ Collision = 0.00f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 100;
+
+ Temperature = 243.15f;
+ HeatConduct = 100;
+ Description = "Not quite Ice";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 273.15f;
+ HighTemperatureTransition = PT_WATR;
+
+ Update = &Element_RIME::update;
+
}
//#TPT-Directive ElementHeader Element_RIME static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_RIME::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/SALT.cpp b/src/simulation/elements/SALT.cpp
index a2e6274..4e21f1b 100644
--- a/src/simulation/elements/SALT.cpp
+++ b/src/simulation/elements/SALT.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SALT PT_SALT 26
Element_SALT::Element_SALT()
{
- Identifier = "DEFAULT_PT_SALT";
- Name = "SALT";
- Colour = PIXPACK(0xFFFFFF);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.95f;
- Collision = -0.1f;
- Gravity = 0.3f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 5;
- Hardness = 1;
-
- Weight = 75;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 110;
- Description = "Salt, dissolves in water.";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1173.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_SALT";
+ Name = "SALT";
+ Colour = PIXPACK(0xFFFFFF);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.95f;
+ Collision = -0.1f;
+ Gravity = 0.3f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 5;
+ Hardness = 1;
+
+ Weight = 75;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 110;
+ Description = "Salt, dissolves in water.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1173.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = NULL;
+
}
Element_SALT::~Element_SALT() {} \ No newline at end of file
diff --git a/src/simulation/elements/SAND.cpp b/src/simulation/elements/SAND.cpp
index a1d9c00..a0262e3 100644
--- a/src/simulation/elements/SAND.cpp
+++ b/src/simulation/elements/SAND.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SAND PT_SAND 44
Element_SAND::Element_SAND()
{
- Identifier = "DEFAULT_PT_SAND";
- Name = "SAND";
- Colour = PIXPACK(0xFFD090);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.95f;
- Collision = -0.1f;
- Gravity = 0.3f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 5;
- Hardness = 1;
-
- Weight = 90;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 150;
- Description = "Sand, Heavy particles. Meltable.";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1973.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_SAND";
+ Name = "SAND";
+ Colour = PIXPACK(0xFFD090);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.95f;
+ Collision = -0.1f;
+ Gravity = 0.3f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 5;
+ Hardness = 1;
+
+ Weight = 90;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 150;
+ Description = "Sand, Heavy particles. Meltable.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1973.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = NULL;
+
}
Element_SAND::~Element_SAND() {} \ No newline at end of file
diff --git a/src/simulation/elements/SHLD1.cpp b/src/simulation/elements/SHLD1.cpp
index 2920add..d6abdf0 100644
--- a/src/simulation/elements/SHLD1.cpp
+++ b/src/simulation/elements/SHLD1.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SHLD1 PT_SHLD1 119
Element_SHLD1::Element_SHLD1()
{
- Identifier = "DEFAULT_PT_SHLD1";
- Name = "SHLD";
- Colour = PIXPACK(0xAAAAAA);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Shield, spark it to grow";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = 7.0f;
- HighPressureTransition = PT_NONE;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_SHLD1::update;
-
+ Identifier = "DEFAULT_PT_SHLD1";
+ Name = "SHLD";
+ Colour = PIXPACK(0xAAAAAA);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Shield, spark it to grow";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = 7.0f;
+ HighPressureTransition = PT_NONE;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_SHLD1::update;
+
}
//#TPT-Directive ElementHeader Element_SHLD1 static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_SHLD1::update(UPDATE_FUNC_ARGS)
int r, nnx, nny, rx, ry;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/SHLD2.cpp b/src/simulation/elements/SHLD2.cpp
index 82ff3b1..5202182 100644
--- a/src/simulation/elements/SHLD2.cpp
+++ b/src/simulation/elements/SHLD2.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SHLD2 PT_SHLD2 120
Element_SHLD2::Element_SHLD2()
{
- Identifier = "DEFAULT_PT_SHLD2";
- Name = "SHD2";
- Colour = PIXPACK(0x777777);
- MenuVisible = 0;
- MenuSection = SC_CRACKER2;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Shield lvl 2";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = 15.0f;
- HighPressureTransition = PT_NONE;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_SHLD2::update;
-
+ Identifier = "DEFAULT_PT_SHLD2";
+ Name = "SHD2";
+ Colour = PIXPACK(0x777777);
+ MenuVisible = 0;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Shield lvl 2";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = 15.0f;
+ HighPressureTransition = PT_NONE;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_SHLD2::update;
+
}
//#TPT-Directive ElementHeader Element_SHLD2 static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_SHLD2::update(UPDATE_FUNC_ARGS)
int r, nnx, nny, rx, ry, np;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/SHLD3.cpp b/src/simulation/elements/SHLD3.cpp
index 64a9c1f..6eaae1c 100644
--- a/src/simulation/elements/SHLD3.cpp
+++ b/src/simulation/elements/SHLD3.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SHLD3 PT_SHLD3 121
Element_SHLD3::Element_SHLD3()
{
- Identifier = "DEFAULT_PT_SHLD3";
- Name = "SHD3";
- Colour = PIXPACK(0x444444);
- MenuVisible = 0;
- MenuSection = SC_CRACKER2;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Shield lvl 3";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = 25.0f;
- HighPressureTransition = PT_NONE;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_SHLD3::update;
-
+ Identifier = "DEFAULT_PT_SHLD3";
+ Name = "SHD3";
+ Colour = PIXPACK(0x444444);
+ MenuVisible = 0;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Shield lvl 3";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = 25.0f;
+ HighPressureTransition = PT_NONE;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_SHLD3::update;
+
}
//#TPT-Directive ElementHeader Element_SHLD3 static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_SHLD3::update(UPDATE_FUNC_ARGS)
int r, nnx, nny, rx, ry, np;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/SHLD4.cpp b/src/simulation/elements/SHLD4.cpp
index 3ce4988..85e01db 100644
--- a/src/simulation/elements/SHLD4.cpp
+++ b/src/simulation/elements/SHLD4.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SHLD4 PT_SHLD4 122
Element_SHLD4::Element_SHLD4()
{
- Identifier = "DEFAULT_PT_SHLD4";
- Name = "SHD4";
- Colour = PIXPACK(0x212121);
- MenuVisible = 0;
- MenuSection = SC_CRACKER2;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Shield lvl 4";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = 40.0f;
- HighPressureTransition = PT_NONE;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_SHLD4::update;
-
+ Identifier = "DEFAULT_PT_SHLD4";
+ Name = "SHD4";
+ Colour = PIXPACK(0x212121);
+ MenuVisible = 0;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Shield lvl 4";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = 40.0f;
+ HighPressureTransition = PT_NONE;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_SHLD4::update;
+
}
//#TPT-Directive ElementHeader Element_SHLD4 static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_SHLD4::update(UPDATE_FUNC_ARGS)
int r, nnx, nny, rx, ry, np;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/SING.cpp b/src/simulation/elements/SING.cpp
index 878dac3..e0ec3db 100644
--- a/src/simulation/elements/SING.cpp
+++ b/src/simulation/elements/SING.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SING PT_SING 131
Element_SING::Element_SING()
{
- Identifier = "DEFAULT_PT_SING";
- Name = "SING";
- Colour = PIXPACK(0x242424);
- MenuVisible = 1;
- MenuSection = SC_NUCLEAR;
- Enabled = 1;
-
- Advection = 0.7f;
- AirDrag = 0.36f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.80f;
- Collision = 0.1f;
- Gravity = 0.12f;
- Diffusion = 0.00f;
- HotAir = -0.001f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 86;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Singularity";
-
- State = ST_SOLID;
- Properties = TYPE_PART|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_SING::update;
-
+ Identifier = "DEFAULT_PT_SING";
+ Name = "SING";
+ Colour = PIXPACK(0x242424);
+ MenuVisible = 1;
+ MenuSection = SC_NUCLEAR;
+ Enabled = 1;
+
+ Advection = 0.7f;
+ AirDrag = 0.36f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.80f;
+ Collision = 0.1f;
+ Gravity = 0.12f;
+ Diffusion = 0.00f;
+ HotAir = -0.001f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 86;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Singularity";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_SING::update;
+
}
//#TPT-Directive ElementHeader Element_SING static int update(UPDATE_FUNC_ARGS)
@@ -116,7 +116,7 @@ int Element_SING::update(UPDATE_FUNC_ARGS)
}
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/SLTW.cpp b/src/simulation/elements/SLTW.cpp
index fa25cb6..9cc3bbf 100644
--- a/src/simulation/elements/SLTW.cpp
+++ b/src/simulation/elements/SLTW.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SLTW PT_SLTW 27
Element_SLTW::Element_SLTW()
{
- Identifier = "DEFAULT_PT_SLTW";
- Name = "SLTW";
- Colour = PIXPACK(0x4050F0);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 35;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 75;
- Description = "Saltwater, conducts electricity, difficult to freeze.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 252.05f;
- LowTemperatureTransition = PT_ICEI;
- HighTemperature = 383.0f;
- HighTemperatureTransition = ST;
-
- Update = &Element_SLTW::update;
-
+ Identifier = "DEFAULT_PT_SLTW";
+ Name = "SLTW";
+ Colour = PIXPACK(0x4050F0);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 35;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 75;
+ Description = "Saltwater, conducts electricity, difficult to freeze.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 252.05f;
+ LowTemperatureTransition = PT_ICEI;
+ HighTemperature = 383.0f;
+ HighTemperatureTransition = ST;
+
+ Update = &Element_SLTW::update;
+
}
//#TPT-Directive ElementHeader Element_SLTW static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_SLTW::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
switch (r&0xFF)
diff --git a/src/simulation/elements/SMKE.cpp b/src/simulation/elements/SMKE.cpp
index a00eca2..e3344b4 100644
--- a/src/simulation/elements/SMKE.cpp
+++ b/src/simulation/elements/SMKE.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SMKE PT_SMKE 57
Element_SMKE::Element_SMKE()
{
- Identifier = "DEFAULT_PT_SMKE";
- Name = "SMKE";
- Colour = PIXPACK(0x222222);
- MenuVisible = 1;
- MenuSection = SC_GAS;
- Enabled = 1;
-
- Advection = 0.9f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.97f;
- Loss = 0.20f;
- Collision = 0.0f;
- Gravity = -0.1f;
- Diffusion = 0.00f;
- HotAir = 0.001f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 1;
-
- Temperature = R_TEMP+320.0f+273.15f;
- HeatConduct = 88;
- Description = "Smoke";
-
- State = ST_SOLID;
- Properties = TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 625.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = NULL;
- Graphics = &Element_SMKE::graphics;
+ Identifier = "DEFAULT_PT_SMKE";
+ Name = "SMKE";
+ Colour = PIXPACK(0x222222);
+ MenuVisible = 1;
+ MenuSection = SC_GAS;
+ Enabled = 1;
+
+ Advection = 0.9f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.97f;
+ Loss = 0.20f;
+ Collision = 0.0f;
+ Gravity = -0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.001f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 1;
+
+ Temperature = R_TEMP+320.0f+273.15f;
+ HeatConduct = 88;
+ Description = "Smoke";
+
+ State = ST_SOLID;
+ Properties = TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 625.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = NULL;
+ Graphics = &Element_SMKE::graphics;
}
//#TPT-Directive ElementHeader Element_SMKE static int graphics(GRAPHICS_FUNC_ARGS)
diff --git a/src/simulation/elements/SNOW.cpp b/src/simulation/elements/SNOW.cpp
index 2077ae8..d70c589 100644
--- a/src/simulation/elements/SNOW.cpp
+++ b/src/simulation/elements/SNOW.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SNOW PT_SNOW 16
Element_SNOW::Element_SNOW()
{
- Identifier = "DEFAULT_PT_SNOW";
- Name = "SNOW";
- Colour = PIXPACK(0xC0E0FF);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.7f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.90f;
- Collision = -0.1f;
- Gravity = 0.05f;
- Diffusion = 0.01f;
- HotAir = -0.00005f* CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 50;
-
- Temperature = R_TEMP-30.0f+273.15f;
- HeatConduct = 46;
- Description = "Light particles.";
-
- State = ST_SOLID;
- Properties = TYPE_PART|PROP_LIFE_DEC|PROP_NEUTPASS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 273.0f;
- HighTemperatureTransition = ST;
-
- Update = &Element_SNOW::update;
-
+ Identifier = "DEFAULT_PT_SNOW";
+ Name = "SNOW";
+ Colour = PIXPACK(0xC0E0FF);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.7f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.90f;
+ Collision = -0.1f;
+ Gravity = 0.05f;
+ Diffusion = 0.01f;
+ HotAir = -0.00005f* CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 50;
+
+ Temperature = R_TEMP-30.0f+273.15f;
+ HeatConduct = 46;
+ Description = "Light particles.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART|PROP_LIFE_DEC|PROP_NEUTPASS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 273.0f;
+ HighTemperatureTransition = ST;
+
+ Update = &Element_SNOW::update;
+
}
//#TPT-Directive ElementHeader Element_SNOW static int update(UPDATE_FUNC_ARGS)
@@ -56,7 +56,7 @@ int Element_SNOW::update(UPDATE_FUNC_ARGS)
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/SOAP.cpp b/src/simulation/elements/SOAP.cpp
index 72d74e0..fcdac37 100644
--- a/src/simulation/elements/SOAP.cpp
+++ b/src/simulation/elements/SOAP.cpp
@@ -2,49 +2,49 @@
//#TPT-Directive ElementClass Element_SOAP PT_SOAP 149
Element_SOAP::Element_SOAP()
{
- Identifier = "DEFAULT_PT_SOAP";
- Name = "SOAP";
- Colour = PIXPACK(0xF5F5DC);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 35;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 29;
- Description = "Soap. Creates bubbles.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_NEUTPENETRATE|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITL;
- HighTemperatureTransition = NT;
-
- Update = &Element_SOAP::update;
- Graphics = &Element_SOAP::graphics;
-
+ Identifier = "DEFAULT_PT_SOAP";
+ Name = "SOAP";
+ Colour = PIXPACK(0xF5F5DC);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 35;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 29;
+ Description = "Soap. Creates bubbles.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_NEUTPENETRATE|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITL;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_SOAP::update;
+ Graphics = &Element_SOAP::graphics;
+
}
//#TPT-Directive ElementHeader Element_SOAP static void attach(Particle * parts, int i1, int i2)
@@ -116,7 +116,7 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS)
{
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -130,7 +130,7 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS)
if (parts[i].life<=0)
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r && !sim->bmap[(y+ry)/CELL][(x+rx)/CELL])
@@ -139,7 +139,7 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS)
{
if (sim->bmap[(y+ry)/CELL][(x+rx)/CELL]
|| (r && sim->elements[r&0xFF].State != ST_GAS
- && (r&0xFF) != PT_SOAP && (r&0xFF) != PT_GLAS))
+ && (r&0xFF) != PT_SOAP && (r&0xFF) != PT_GLAS))
{
sim->detach(i);
continue;
@@ -202,7 +202,7 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS)
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -219,7 +219,7 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS)
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/SPAWN.cpp b/src/simulation/elements/SPAWN.cpp
index 85295f2..8414178 100644
--- a/src/simulation/elements/SPAWN.cpp
+++ b/src/simulation/elements/SPAWN.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SPAWN PT_SPAWN 118
Element_SPAWN::Element_SPAWN()
{
- Identifier = "DEFAULT_PT_SPAWN";
- Name = "SPWN";
- Colour = PIXPACK(0xAAAAAA);
- MenuVisible = 0;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "STKM spawn point";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_SPAWN::update;
-
+ Identifier = "DEFAULT_PT_SPAWN";
+ Name = "SPWN";
+ Colour = PIXPACK(0xAAAAAA);
+ MenuVisible = 0;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "STKM spawn point";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_SPAWN::update;
+
}
//#TPT-Directive ElementHeader Element_SPAWN static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/SPAWN2.cpp b/src/simulation/elements/SPAWN2.cpp
index 3cc048b..db9af4b 100644
--- a/src/simulation/elements/SPAWN2.cpp
+++ b/src/simulation/elements/SPAWN2.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SPAWN2 PT_SPAWN2 117
Element_SPAWN2::Element_SPAWN2()
{
- Identifier = "DEFAULT_PT_SPAWN2";
- Name = "SPWN2";
- Colour = PIXPACK(0xAAAAAA);
- MenuVisible = 0;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "STK2 spawn point";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_SPAWN2::update;
-
+ Identifier = "DEFAULT_PT_SPAWN2";
+ Name = "SPWN2";
+ Colour = PIXPACK(0xAAAAAA);
+ MenuVisible = 0;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "STK2 spawn point";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_SPAWN2::update;
+
}
//#TPT-Directive ElementHeader Element_SPAWN2 static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/SPNG.cpp b/src/simulation/elements/SPNG.cpp
index de32c24..ac60a38 100644
--- a/src/simulation/elements/SPNG.cpp
+++ b/src/simulation/elements/SPNG.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SPNG PT_SPNG 90
Element_SPNG::Element_SPNG()
{
- Identifier = "DEFAULT_PT_SPNG";
- Name = "SPNG";
- Colour = PIXPACK(0xFFBE30);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.00f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.00f;
- Loss = 0.00f;
- Collision = 0.00f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 20;
- Explosive = 0;
- Meltable = 0;
- Hardness = 30;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "A sponge, absorbs water.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 2730.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = &Element_SPNG::update;
- Graphics = &Element_SPNG::graphics;
+ Identifier = "DEFAULT_PT_SPNG";
+ Name = "SPNG";
+ Colour = PIXPACK(0xFFBE30);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.00f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.00f;
+ Loss = 0.00f;
+ Collision = 0.00f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 20;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "A sponge, absorbs water.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 2730.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = &Element_SPNG::update;
+ Graphics = &Element_SPNG::graphics;
}
//#TPT-Directive ElementHeader Element_SPNG static int update(UPDATE_FUNC_ARGS)
@@ -56,7 +56,7 @@ int Element_SPNG::update(UPDATE_FUNC_ARGS)
int absorbChanceDenom = parts[i].life*10000/limit + 500;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
switch (r&0xFF)
@@ -102,7 +102,7 @@ int Element_SPNG::update(UPDATE_FUNC_ARGS)
else
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if ((!r)&&parts[i].life>=1)//if nothing then create water
@@ -115,7 +115,7 @@ int Element_SPNG::update(UPDATE_FUNC_ARGS)
{
rx = rand()%5-2;
ry = rand()%5-2;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -143,7 +143,7 @@ int Element_SPNG::update(UPDATE_FUNC_ARGS)
{
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -165,7 +165,7 @@ int Element_SPNG::update(UPDATE_FUNC_ARGS)
if (tmp || parts[i].temp>=374)
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if ((!r)&&parts[i].life>=1)//if nothing then create steam
diff --git a/src/simulation/elements/SPRK.cpp b/src/simulation/elements/SPRK.cpp
index 3939bd8..8122385 100644
--- a/src/simulation/elements/SPRK.cpp
+++ b/src/simulation/elements/SPRK.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SPRK PT_SPRK 15
Element_SPRK::Element_SPRK()
{
- Identifier = "DEFAULT_PT_SPRK";
- Name = "SPRK";
- Colour = PIXPACK(0xFFFF80);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.001f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Electricity. Conducted by metal and water.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_SPRK::update;
- Graphics = &Element_SPRK::graphics;
+ Identifier = "DEFAULT_PT_SPRK";
+ Name = "SPRK";
+ Colour = PIXPACK(0xFFFF80);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.001f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Electricity. Conducted by metal and water.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_SPRK::update;
+ Graphics = &Element_SPRK::graphics;
}
//#TPT-Directive ElementHeader Element_SPRK static int update(UPDATE_FUNC_ARGS)
@@ -112,7 +112,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS)
parts[i].tmp=300;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (r)
@@ -143,7 +143,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS)
case PT_IRON:
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -163,7 +163,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS)
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/STKM.cpp b/src/simulation/elements/STKM.cpp
index 081720e..9fdead2 100644
--- a/src/simulation/elements/STKM.cpp
+++ b/src/simulation/elements/STKM.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_STKM PT_STKM 55
Element_STKM::Element_STKM()
{
- Identifier = "DEFAULT_PT_STKM";
- Name = "STKM";
- Colour = PIXPACK(0xFFE0A0);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.5f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.2f;
- Loss = 1.0f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.0f;
- HotAir = 0.00f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 50;
-
- Temperature = R_TEMP+14.6f+273.15f;
- HeatConduct = 0;
- Description = "Stickman. Don't kill him!";
-
- State = ST_NONE;
- Properties = 0;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 620.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = &Element_STKM::update;
- Graphics = &Element_STKM::graphics;
+ Identifier = "DEFAULT_PT_STKM";
+ Name = "STKM";
+ Colour = PIXPACK(0xFFE0A0);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.5f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.2f;
+ Loss = 1.0f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.0f;
+ HotAir = 0.00f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 50;
+
+ Temperature = R_TEMP+14.6f+273.15f;
+ HeatConduct = 0;
+ Description = "Stickman. Don't kill him!";
+
+ State = ST_NONE;
+ Properties = 0;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 620.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = &Element_STKM::update;
+ Graphics = &Element_STKM::graphics;
}
//#TPT-Directive ElementHeader Element_STKM static int update(UPDATE_FUNC_ARGS)
@@ -155,7 +155,7 @@ int Element_STKM::run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) {
playerp->legs[15] = playerp->legs[13];
playerp->legs[13] = pp;
- //Setting accseleration to 0
+ //Setting acceleration to 0
playerp->accs[0] = 0;
playerp->accs[1] = 0;
diff --git a/src/simulation/elements/STKM2.cpp b/src/simulation/elements/STKM2.cpp
index a2c0073..0621d75 100644
--- a/src/simulation/elements/STKM2.cpp
+++ b/src/simulation/elements/STKM2.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_STKM2 PT_STKM2 128
Element_STKM2::Element_STKM2()
{
- Identifier = "DEFAULT_PT_STKM2";
- Name = "STK2";
- Colour = PIXPACK(0x6464FF);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.5f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.2f;
- Loss = 1.0f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.0f;
- HotAir = 0.00f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 50;
-
- Temperature = R_TEMP+14.6f+273.15f;
- HeatConduct = 0;
- Description = "Stickman. Don't kill him!";
-
- State = ST_NONE;
- Properties = 0;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 620.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = &Element_STKM2::update;
- Graphics = &Element_STKM::graphics;
+ Identifier = "DEFAULT_PT_STKM2";
+ Name = "STK2";
+ Colour = PIXPACK(0x6464FF);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.5f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.2f;
+ Loss = 1.0f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.0f;
+ HotAir = 0.00f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 50;
+
+ Temperature = R_TEMP+14.6f+273.15f;
+ HeatConduct = 0;
+ Description = "Stickman. Don't kill him!";
+
+ State = ST_NONE;
+ Properties = 0;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 620.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = &Element_STKM2::update;
+ Graphics = &Element_STKM::graphics;
}
//#TPT-Directive ElementHeader Element_STKM2 static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/STNE.cpp b/src/simulation/elements/STNE.cpp
index ff5251d..c2197c5 100644
--- a/src/simulation/elements/STNE.cpp
+++ b/src/simulation/elements/STNE.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_STNE PT_STNE 5
Element_STNE::Element_STNE()
{
- Identifier = "DEFAULT_PT_STNE";
- Name = "STNE";
- Colour = PIXPACK(0xA0A0A0);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.95f;
- Collision = -0.1f;
- Gravity = 0.3f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 5;
- Hardness = 1;
-
- Weight = 90;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 150;
- Description = "Heavy particles. Meltable.";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 983.0f;
- HighTemperatureTransition = PT_LAVA;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_STNE";
+ Name = "STNE";
+ Colour = PIXPACK(0xA0A0A0);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.95f;
+ Collision = -0.1f;
+ Gravity = 0.3f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 5;
+ Hardness = 1;
+
+ Weight = 90;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 150;
+ Description = "Heavy particles. Meltable.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 983.0f;
+ HighTemperatureTransition = PT_LAVA;
+
+ Update = NULL;
+
}
Element_STNE::~Element_STNE() {} \ No newline at end of file
diff --git a/src/simulation/elements/STOR.cpp b/src/simulation/elements/STOR.cpp
index a9f5d94..5b51677 100644
--- a/src/simulation/elements/STOR.cpp
+++ b/src/simulation/elements/STOR.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_STOR PT_STOR 83
Element_STOR::Element_STOR()
{
- Identifier = "DEFAULT_PT_STOR";
- Name = "STOR";
- Colour = PIXPACK(0x50DFDF);
- MenuVisible = 1;
- MenuSection = SC_POWERED;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Solid. Stores a single particle, releases when charged with PSCN, also passes to PIPE";
-
- State = ST_NONE;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_STOR::update;
- Graphics = &Element_STOR::graphics;
+ Identifier = "DEFAULT_PT_STOR";
+ Name = "STOR";
+ Colour = PIXPACK(0x50DFDF);
+ MenuVisible = 1;
+ MenuSection = SC_POWERED;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Solid. Stores a single particle, releases when charged with PSCN, also passes to PIPE";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_STOR::update;
+ Graphics = &Element_STOR::graphics;
}
//#TPT-Directive ElementHeader Element_STOR static int update(UPDATE_FUNC_ARGS)
@@ -54,7 +54,7 @@ int Element_STOR::update(UPDATE_FUNC_ARGS)
parts[i].life--;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if ((r>>8)>=NPART || !r)
diff --git a/src/simulation/elements/SWCH.cpp b/src/simulation/elements/SWCH.cpp
index 422b7b5..fd8fd26 100644
--- a/src/simulation/elements/SWCH.cpp
+++ b/src/simulation/elements/SWCH.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SWCH PT_SWCH 56
Element_SWCH::Element_SWCH()
{
- Identifier = "DEFAULT_PT_SWCH";
- Name = "SWCH";
- Colour = PIXPACK(0x103B11);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Solid. Only conducts when switched on. (PSCN switches on, NSCN switches off)";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_SWCH::update;
- Graphics = &Element_SWCH::graphics;
+ Identifier = "DEFAULT_PT_SWCH";
+ Name = "SWCH";
+ Colour = PIXPACK(0x103B11);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Solid. Only conducts when switched on. (PSCN switches on, NSCN switches off)";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_SWCH::update;
+ Graphics = &Element_SWCH::graphics;
}
bool isRedBRAY(UPDATE_FUNC_ARGS, int xc, int yc)
@@ -59,7 +59,7 @@ int Element_SWCH::update(UPDATE_FUNC_ARGS)
parts[i].life--;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/TESC.cpp b/src/simulation/elements/TESC.cpp
index d8b4e9f..0ad7e00 100644
--- a/src/simulation/elements/TESC.cpp
+++ b/src/simulation/elements/TESC.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_TESC PT_TESC 88
Element_TESC::Element_TESC()
{
- Identifier = "DEFAULT_PT_TESC";
- Name = "TESC";
- Colour = PIXPACK(0x707040);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Tesla coil!";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_TESC";
+ Name = "TESC";
+ Colour = PIXPACK(0x707040);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Tesla coil!";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+
}
Element_TESC::~Element_TESC() {} \ No newline at end of file
diff --git a/src/simulation/elements/THDR.cpp b/src/simulation/elements/THDR.cpp
index f309628..3c9f0c9 100644
--- a/src/simulation/elements/THDR.cpp
+++ b/src/simulation/elements/THDR.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_THDR PT_THDR 48
Element_THDR::Element_THDR()
{
- Identifier = "DEFAULT_PT_THDR";
- Name = "THDR";
- Colour = PIXPACK(0xFFFFA0);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.0f;
- Loss = 0.30f;
- Collision = -0.99f;
- Gravity = 0.6f;
- Diffusion = 0.62f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 1;
-
- Temperature = 9000.0f +273.15f;
- HeatConduct = 1;
- Description = "Lightning! Very hot, inflicts damage upon most materials, transfers current to metals.";
-
- State = ST_NONE;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_THDR::update;
- Graphics = &Element_THDR::graphics;
+ Identifier = "DEFAULT_PT_THDR";
+ Name = "THDR";
+ Colour = PIXPACK(0xFFFFA0);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.0f;
+ Loss = 0.30f;
+ Collision = -0.99f;
+ Gravity = 0.6f;
+ Diffusion = 0.62f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 1;
+
+ Temperature = 9000.0f +273.15f;
+ HeatConduct = 1;
+ Description = "Lightning! Very hot, inflicts damage upon most materials, transfers current to metals.";
+
+ State = ST_NONE;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_THDR::update;
+ Graphics = &Element_THDR::graphics;
}
//#TPT-Directive ElementHeader Element_THDR static int update(UPDATE_FUNC_ARGS)
@@ -53,7 +53,7 @@ int Element_THDR::update(UPDATE_FUNC_ARGS)
bool kill=false;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/THRM.cpp b/src/simulation/elements/THRM.cpp
index bd14692..3d94a2c 100644
--- a/src/simulation/elements/THRM.cpp
+++ b/src/simulation/elements/THRM.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_THRM PT_THRM 65
Element_THRM::Element_THRM()
{
- Identifier = "DEFAULT_PT_THRM";
- Name = "THRM";
- Colour = PIXPACK(0xA08090);
- MenuVisible = 1;
- MenuSection = SC_EXPLOSIVE;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.04f * CFDS;
- AirLoss = 0.94f;
- Loss = 0.95f;
- Collision = -0.1f;
- Gravity = 0.3f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 2;
- Hardness = 2;
-
- Weight = 90;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 211;
- Description = "Thermite. Burns at extremely high temperature.";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_THRM::update;
-
+ Identifier = "DEFAULT_PT_THRM";
+ Name = "THRM";
+ Colour = PIXPACK(0xA08090);
+ MenuVisible = 1;
+ MenuSection = SC_EXPLOSIVE;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.04f * CFDS;
+ AirLoss = 0.94f;
+ Loss = 0.95f;
+ Collision = -0.1f;
+ Gravity = 0.3f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 2;
+ Hardness = 2;
+
+ Weight = 90;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 211;
+ Description = "Thermite. Burns at extremely high temperature.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_THRM::update;
+
}
//#TPT-Directive ElementHeader Element_THRM static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_THRM::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/TRON.cpp b/src/simulation/elements/TRON.cpp
index e31d77f..8ad0b4d 100644
--- a/src/simulation/elements/TRON.cpp
+++ b/src/simulation/elements/TRON.cpp
@@ -2,50 +2,50 @@
//#TPT-Directive ElementClass Element_TRON PT_TRON 143
Element_TRON::Element_TRON()
{
- Identifier = "DEFAULT_PT_TRON";
- Name = "TRON";
- Colour = PIXPACK(0xA9FF00);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = 0.0f;
- HeatConduct = 40;
- Description = "Smart particles, Travels in straight lines and avoids obstacles. Grows with time.";
-
- State = ST_NONE;
- Properties = TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_TRON::update;
- Graphics = &Element_TRON::graphics;
+ Identifier = "DEFAULT_PT_TRON";
+ Name = "TRON";
+ Colour = PIXPACK(0xA9FF00);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = 0.0f;
+ HeatConduct = 40;
+ Description = "Smart particles, Travels in straight lines and avoids obstacles. Grows with time.";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_TRON::update;
+ Graphics = &Element_TRON::graphics;
- Element_TRON::init_graphics();
+ Element_TRON::init_graphics();
}
/* TRON element is meant to resemble a tron bike (or worm) moving around and trying to avoid obstacles itself.
diff --git a/src/simulation/elements/TSNS.cpp b/src/simulation/elements/TSNS.cpp
index 0463a01..6e6461f 100644
--- a/src/simulation/elements/TSNS.cpp
+++ b/src/simulation/elements/TSNS.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_TSNS PT_TSNS 164
Element_TSNS::Element_TSNS()
{
- Identifier = "DEFAULT_PT_TSNS";
- Name = "TSNS";
- Colour = PIXPACK(0xFD9D18);
- MenuVisible = 1;
- MenuSection = SC_SENSOR;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Creates a spark when there's a nearby particle with a greater temperature";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_TSNS::update;
-
+ Identifier = "DEFAULT_PT_TSNS";
+ Name = "TSNS";
+ Colour = PIXPACK(0xFD9D18);
+ MenuVisible = 1;
+ MenuSection = SC_SENSOR;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Creates a spark when there's a nearby particle with a greater temperature";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_TSNS::update;
+
}
//#TPT-Directive ElementHeader Element_TSNS static int update(UPDATE_FUNC_ARGS)
@@ -56,7 +56,7 @@ int Element_TSNS::update(UPDATE_FUNC_ARGS)
parts[i].life = 0;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -75,7 +75,7 @@ int Element_TSNS::update(UPDATE_FUNC_ARGS)
}
for (rx=-rd; rx<rd+1; rx++)
for (ry=-rd; ry<rd+1; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if(!r)
diff --git a/src/simulation/elements/TTAN.cpp b/src/simulation/elements/TTAN.cpp
index c51319d..919c2b1 100644
--- a/src/simulation/elements/TTAN.cpp
+++ b/src/simulation/elements/TTAN.cpp
@@ -3,63 +3,63 @@
//#TPT-Directive ElementClass Element_TTAN PT_TTAN 144
Element_TTAN::Element_TTAN()
{
- Identifier = "DEFAULT_PT_TTAN";
- Name = "TTAN";
- Colour = PIXPACK(0x909090);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
+ Identifier = "DEFAULT_PT_TTAN";
+ Name = "TTAN";
+ Colour = PIXPACK(0x909090);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
- Flammable = 0;
- Explosive = 0;
- Meltable = 1;
- Hardness = 50;
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 1;
+ Hardness = 50;
- Weight = 100;
+ Weight = 100;
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Titanium, Higher melting temperature than other metals, blocks all air pressure";
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Titanium, Higher melting temperature than other metals, blocks all air pressure";
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_HOT_GLOW|PROP_LIFE_DEC;
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_HOT_GLOW|PROP_LIFE_DEC;
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 1941.0f;
- HighTemperatureTransition = PT_LAVA;
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 1941.0f;
+ HighTemperatureTransition = PT_LAVA;
- Update = &Element_TTAN::update;
-
+ Update = &Element_TTAN::update;
+
}
//#TPT-Directive ElementHeader Element_TTAN static int update(UPDATE_FUNC_ARGS)
int Element_TTAN::update(UPDATE_FUNC_ARGS)
{
- int nx, ny, ttan = 0;
+ int rx, ry, ttan = 0;
if(nt<=2)
ttan = 2;
else if(parts[i].tmp)
ttan = 2;
else if(nt<=6)
- for (nx=-1; nx<2; nx++) {
- for (ny=-1; ny<2; ny++) {
- if ((!nx != !ny) && x+nx>=0 && y+ny>=0 && x+nx<XRES && y+ny<YRES) {
- if((pmap[y+ny][x+nx]&0xFF)==PT_TTAN)
+ for (rx=-1; rx<2; rx++) {
+ for (ry=-1; ry<2; ry++) {
+ if ((!rx != !ry) && BOUNDS_CHECK) {
+ if((pmap[y+ry][x+rx]&0xFF)==PT_TTAN)
ttan++;
}
}
diff --git a/src/simulation/elements/URAN.cpp b/src/simulation/elements/URAN.cpp
index a988bf3..3ced8fe 100644
--- a/src/simulation/elements/URAN.cpp
+++ b/src/simulation/elements/URAN.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_URAN PT_URAN 32
Element_URAN::Element_URAN()
{
- Identifier = "DEFAULT_PT_URAN";
- Name = "URAN";
- Colour = PIXPACK(0x707020);
- MenuVisible = 1;
- MenuSection = SC_NUCLEAR;
- Enabled = 1;
-
- Advection = 0.4f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.4f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 90;
-
- Temperature = R_TEMP+30.0f+273.15f;
- HeatConduct = 251;
- Description = "Heavy particles. Generates heat under pressure.";
-
- State = ST_SOLID;
- Properties = TYPE_PART | PROP_RADIOACTIVE;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_URAN::update;
-
+ Identifier = "DEFAULT_PT_URAN";
+ Name = "URAN";
+ Colour = PIXPACK(0x707020);
+ MenuVisible = 1;
+ MenuSection = SC_NUCLEAR;
+ Enabled = 1;
+
+ Advection = 0.4f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.4f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 90;
+
+ Temperature = R_TEMP+30.0f+273.15f;
+ HeatConduct = 251;
+ Description = "Heavy particles. Generates heat under pressure.";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART | PROP_RADIOACTIVE;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_URAN::update;
+
}
//#TPT-Directive ElementHeader Element_URAN static int update(UPDATE_FUNC_ARGS)
diff --git a/src/simulation/elements/VIBR.cpp b/src/simulation/elements/VIBR.cpp
index a5ad8b1..ee57565 100644
--- a/src/simulation/elements/VIBR.cpp
+++ b/src/simulation/elements/VIBR.cpp
@@ -99,7 +99,7 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) {
int random = rand();
rx = random%7-3;
ry = (random>>3)%7-3;
- if(x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES)
+ if(BOUNDS_CHECK)
{
r = pmap[y+ry][x+rx];
if ((r&0xFF) && (r&0xFF)!=PT_VIBR && (r&0xFF)!=PT_BVBR && sim->elements[r&0xFF].HeatConduct && ((r&0xFF)!=PT_HSWC||parts[r>>8].life==10))
@@ -133,7 +133,7 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) {
//Neighbor check loop
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -166,7 +166,7 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) {
int random = rand();
rx = random%7-3;
ry = (random>>3)%7-3;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if ((r&0xFF) != PT_VIBR && (r&0xFF) != PT_BVBR)
diff --git a/src/simulation/elements/VINE.cpp b/src/simulation/elements/VINE.cpp
index 973aad6..798fe35 100644
--- a/src/simulation/elements/VINE.cpp
+++ b/src/simulation/elements/VINE.cpp
@@ -2,55 +2,55 @@
//#TPT-Directive ElementClass Element_VINE PT_VINE 114
Element_VINE::Element_VINE()
{
- Identifier = "DEFAULT_PT_VINE";
- Name = "VINE";
- Colour = PIXPACK(0x079A00);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.95f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 20;
- Explosive = 0;
- Meltable = 0;
- Hardness = 10;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 65;
- Description = "Vine, grows";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 573.0f;
- HighTemperatureTransition = PT_FIRE;
-
- Update = &Element_VINE::update;
-
+ Identifier = "DEFAULT_PT_VINE";
+ Name = "VINE";
+ Colour = PIXPACK(0x079A00);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.95f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 20;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 10;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 65;
+ Description = "Vine, grows";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 573.0f;
+ HighTemperatureTransition = PT_FIRE;
+
+ Update = &Element_VINE::update;
+
}
//#TPT-Directive ElementHeader Element_VINE static int update(UPDATE_FUNC_ARGS)
int Element_VINE::update(UPDATE_FUNC_ARGS)
{
int r, np, rx =(rand()%3)-1, ry=(rand()%3)-1;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!(rand()%15))
diff --git a/src/simulation/elements/VOID.cpp b/src/simulation/elements/VOID.cpp
index 05eb872..a21413a 100644
--- a/src/simulation/elements/VOID.cpp
+++ b/src/simulation/elements/VOID.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_VOID PT_VOID 22
Element_VOID::Element_VOID()
{
- Identifier = "DEFAULT_PT_VOID";
- Name = "VOID";
- Colour = PIXPACK(0x790B0B);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 1.00f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = -0.0003f* CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Hole, will drain away any particles.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_VOID";
+ Name = "VOID";
+ Colour = PIXPACK(0x790B0B);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 1.00f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = -0.0003f* CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Hole, will drain away any particles.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+
}
Element_VOID::~Element_VOID() {} \ No newline at end of file
diff --git a/src/simulation/elements/WARP.cpp b/src/simulation/elements/WARP.cpp
index 312e2e6..88fc24c 100644
--- a/src/simulation/elements/WARP.cpp
+++ b/src/simulation/elements/WARP.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_WARP PT_WARP 96
Element_WARP::Element_WARP()
{
- Identifier = "DEFAULT_PT_WARP";
- Name = "WARP";
- Colour = PIXPACK(0x101010);
- MenuVisible = 1;
- MenuSection = SC_NUCLEAR;
- Enabled = 1;
-
- Advection = 0.8f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.9f;
- Loss = 0.70f;
- Collision = -0.1f;
- Gravity = 0.0f;
- Diffusion = 3.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 30;
-
- Weight = 1;
-
- Temperature = R_TEMP +273.15f;
- HeatConduct = 100;
- Description = "Displaces other elements.";
-
- State = ST_GAS;
- Properties = TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_WARP::update;
- Graphics = &Element_WARP::graphics;
+ Identifier = "DEFAULT_PT_WARP";
+ Name = "WARP";
+ Colour = PIXPACK(0x101010);
+ MenuVisible = 1;
+ MenuSection = SC_NUCLEAR;
+ Enabled = 1;
+
+ Advection = 0.8f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.9f;
+ Loss = 0.70f;
+ Collision = -0.1f;
+ Gravity = 0.0f;
+ Diffusion = 3.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 1;
+
+ Temperature = R_TEMP +273.15f;
+ HeatConduct = 100;
+ Description = "Displaces other elements.";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_WARP::update;
+ Graphics = &Element_WARP::graphics;
}
//#TPT-Directive ElementHeader Element_WARP static int update(UPDATE_FUNC_ARGS)
@@ -61,7 +61,7 @@ int Element_WARP::update(UPDATE_FUNC_ARGS)
{
rx = rand()%3-1;
ry = rand()%3-1;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/WATR.cpp b/src/simulation/elements/WATR.cpp
index 4faf8dc..288c763 100644
--- a/src/simulation/elements/WATR.cpp
+++ b/src/simulation/elements/WATR.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_WATR PT_WATR 2
Element_WATR::Element_WATR()
{
- Identifier = "DEFAULT_PT_WATR";
- Name = "WATR";
- Colour = PIXPACK(0x2030D0);
- MenuVisible = 1;
- MenuSection = SC_LIQUID;
- Enabled = 1;
-
- Advection = 0.6f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.98f;
- Loss = 0.95f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 2;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 20;
-
- Weight = 30;
-
- Temperature = R_TEMP-2.0f +273.15f;
- HeatConduct = 29;
- Description = "Liquid. Conducts electricity. Freezes. Extinguishes fires.";
-
- State = ST_LIQUID;
- Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPASS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 273.15f;
- LowTemperatureTransition = PT_ICEI;
- HighTemperature = 373.0f;
- HighTemperatureTransition = PT_WTRV;
-
- Update = &Element_WATR::update;
-
+ Identifier = "DEFAULT_PT_WATR";
+ Name = "WATR";
+ Colour = PIXPACK(0x2030D0);
+ MenuVisible = 1;
+ MenuSection = SC_LIQUID;
+ Enabled = 1;
+
+ Advection = 0.6f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.98f;
+ Loss = 0.95f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 2;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 20;
+
+ Weight = 30;
+
+ Temperature = R_TEMP-2.0f +273.15f;
+ HeatConduct = 29;
+ Description = "Liquid. Conducts electricity. Freezes. Extinguishes fires.";
+
+ State = ST_LIQUID;
+ Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPASS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 273.15f;
+ LowTemperatureTransition = PT_ICEI;
+ HighTemperature = 373.0f;
+ HighTemperatureTransition = PT_WTRV;
+
+ Update = &Element_WATR::update;
+
}
//#TPT-Directive ElementHeader Element_WATR static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_WATR::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/WAX.cpp b/src/simulation/elements/WAX.cpp
index 5f9a113..2203b61 100644
--- a/src/simulation/elements/WAX.cpp
+++ b/src/simulation/elements/WAX.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_WAX PT_WAX 33
Element_WAX::Element_WAX()
{
- Identifier = "DEFAULT_PT_WAX";
- Name = "WAX";
- Colour = PIXPACK(0xF0F0BB);
- MenuVisible = 1;
- MenuSection = SC_SOLIDS;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 10;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 44;
- Description = "Wax. Melts at moderately high temperatures.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 319.0f;
- HighTemperatureTransition = PT_MWAX;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_WAX";
+ Name = "WAX";
+ Colour = PIXPACK(0xF0F0BB);
+ MenuVisible = 1;
+ MenuSection = SC_SOLIDS;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 10;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 44;
+ Description = "Wax. Melts at moderately high temperatures.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 319.0f;
+ HighTemperatureTransition = PT_MWAX;
+
+ Update = NULL;
+
}
Element_WAX::~Element_WAX() {} \ No newline at end of file
diff --git a/src/simulation/elements/WHOL.cpp b/src/simulation/elements/WHOL.cpp
index 3007960..aba4e19 100644
--- a/src/simulation/elements/WHOL.cpp
+++ b/src/simulation/elements/WHOL.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_WHOL PT_WHOL 40
Element_WHOL::Element_WHOL()
{
- Identifier = "DEFAULT_PT_WHOL";
- Name = "VENT";
- Colour = PIXPACK(0xEFEFEF);
- MenuVisible = 1;
- MenuSection = SC_SPECIAL;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.95f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.010f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP-16.0f+273.15f;
- HeatConduct = 255;
- Description = "Air vent, creates pressure and pushes other particles away.";
-
- State = ST_NONE;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = NULL;
-
+ Identifier = "DEFAULT_PT_WHOL";
+ Name = "VENT";
+ Colour = PIXPACK(0xEFEFEF);
+ MenuVisible = 1;
+ MenuSection = SC_SPECIAL;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.95f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.010f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP-16.0f+273.15f;
+ HeatConduct = 255;
+ Description = "Air vent, creates pressure and pushes other particles away.";
+
+ State = ST_NONE;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = NULL;
+
}
Element_WHOL::~Element_WHOL() {} \ No newline at end of file
diff --git a/src/simulation/elements/WIFI.cpp b/src/simulation/elements/WIFI.cpp
index 4cbf0d5..6b04040 100644
--- a/src/simulation/elements/WIFI.cpp
+++ b/src/simulation/elements/WIFI.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_WIFI PT_WIFI 124
Element_WIFI::Element_WIFI()
{
- Identifier = "DEFAULT_PT_WIFI";
- Name = "WIFI";
- Colour = PIXPACK(0x40A060);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 2;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 0;
- Description = "Wireless transmitter, color coded.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = 15.0f;
- HighPressureTransition = PT_BRMT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_WIFI::update;
- Graphics = &Element_WIFI::graphics;
+ Identifier = "DEFAULT_PT_WIFI";
+ Name = "WIFI";
+ Colour = PIXPACK(0x40A060);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 2;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 0;
+ Description = "Wireless transmitter, color coded.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = 15.0f;
+ HighPressureTransition = PT_BRMT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_WIFI::update;
+ Graphics = &Element_WIFI::graphics;
}
//#TPT-Directive ElementHeader Element_WIFI static int update(UPDATE_FUNC_ARGS)
@@ -55,7 +55,7 @@ int Element_WIFI::update(UPDATE_FUNC_ARGS)
else if (parts[i].tmp<0) parts[i].tmp = 0;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/WIRE.cpp b/src/simulation/elements/WIRE.cpp
index c4ccd25..41f2170 100644
--- a/src/simulation/elements/WIRE.cpp
+++ b/src/simulation/elements/WIRE.cpp
@@ -2,59 +2,59 @@
//#TPT-Directive ElementClass Element_WIRE PT_WIRE 156
Element_WIRE::Element_WIRE()
{
- Identifier = "DEFAULT_PT_WIRE";
- Name = "WWLD";
- Colour = PIXPACK(0xFFCC00);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.00f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 0;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 250;
- Description = "WireWorld wires, probably not what you want. For normal wires, use METL";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_WIRE::update;
- Graphics = &Element_WIRE::graphics;
+ Identifier = "DEFAULT_PT_WIRE";
+ Name = "WWLD";
+ Colour = PIXPACK(0xFFCC00);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.00f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 0;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 250;
+ Description = "WireWorld wires, probably not what you want. For normal wires, use METL";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_WIRE::update;
+ Graphics = &Element_WIRE::graphics;
}
//#TPT-Directive ElementHeader Element_WIRE static int update(UPDATE_FUNC_ARGS)
int Element_WIRE::update(UPDATE_FUNC_ARGS)
{
- int s,r,rx,ry,count;
+ int s,r,rx,ry,count=0;
/*
0: wire
1: spark head
2: spark tail
-
+
tmp is previous state, ctype is current state
*/
//parts[i].tmp=parts[i].ctype;
@@ -67,11 +67,10 @@ int Element_WIRE::update(UPDATE_FUNC_ARGS)
{
parts[i].ctype=0;
}
- count=0;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
{
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/WTRV.cpp b/src/simulation/elements/WTRV.cpp
index d58b371..027fd04 100644
--- a/src/simulation/elements/WTRV.cpp
+++ b/src/simulation/elements/WTRV.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_WTRV PT_WTRV 23
Element_WTRV::Element_WTRV()
{
- Identifier = "DEFAULT_PT_WTRV";
- Name = "WTRV";
- Colour = PIXPACK(0xA0A0FF);
- MenuVisible = 1;
- MenuSection = SC_GAS;
- Enabled = 1;
-
- Advection = 1.0f;
- AirDrag = 0.01f * CFDS;
- AirLoss = 0.99f;
- Loss = 0.30f;
- Collision = -0.1f;
- Gravity = -0.1f;
- Diffusion = 0.75f;
- HotAir = 0.0003f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 4;
-
- Weight = 1;
-
- Temperature = R_TEMP+100.0f+273.15f;
- HeatConduct = 48;
- Description = "Steam, heats up air, produced from hot water.";
-
- State = ST_GAS;
- Properties = TYPE_GAS;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = 371.0f;
- LowTemperatureTransition = ST;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_WTRV::update;
-
+ Identifier = "DEFAULT_PT_WTRV";
+ Name = "WTRV";
+ Colour = PIXPACK(0xA0A0FF);
+ MenuVisible = 1;
+ MenuSection = SC_GAS;
+ Enabled = 1;
+
+ Advection = 1.0f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.30f;
+ Collision = -0.1f;
+ Gravity = -0.1f;
+ Diffusion = 0.75f;
+ HotAir = 0.0003f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 4;
+
+ Weight = 1;
+
+ Temperature = R_TEMP+100.0f+273.15f;
+ HeatConduct = 48;
+ Description = "Steam, heats up air, produced from hot water.";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 371.0f;
+ LowTemperatureTransition = ST;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_WTRV::update;
+
}
//#TPT-Directive ElementHeader Element_WTRV static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_WTRV::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
diff --git a/src/simulation/elements/YEST.cpp b/src/simulation/elements/YEST.cpp
index f544192..facf189 100644
--- a/src/simulation/elements/YEST.cpp
+++ b/src/simulation/elements/YEST.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_YEST PT_YEST 63
Element_YEST::Element_YEST()
{
- Identifier = "DEFAULT_PT_YEST";
- Name = "YEST";
- Colour = PIXPACK(0xEEE0C0);
- MenuVisible = 1;
- MenuSection = SC_POWDERS;
- Enabled = 1;
-
- Advection = 0.7f;
- AirDrag = 0.02f * CFDS;
- AirLoss = 0.96f;
- Loss = 0.80f;
- Collision = 0.0f;
- Gravity = 0.1f;
- Diffusion = 0.00f;
- HotAir = 0.000f * CFDS;
- Falldown = 1;
-
- Flammable = 15;
- Explosive = 0;
- Meltable = 0;
- Hardness = 30;
-
- Weight = 80;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 70;
- Description = "Yeast, grows when warm (~37C).";
-
- State = ST_SOLID;
- Properties = TYPE_PART;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = 373.0f;
- HighTemperatureTransition = PT_DYST;
-
- Update = &Element_YEST::update;
-
+ Identifier = "DEFAULT_PT_YEST";
+ Name = "YEST";
+ Colour = PIXPACK(0xEEE0C0);
+ MenuVisible = 1;
+ MenuSection = SC_POWDERS;
+ Enabled = 1;
+
+ Advection = 0.7f;
+ AirDrag = 0.02f * CFDS;
+ AirLoss = 0.96f;
+ Loss = 0.80f;
+ Collision = 0.0f;
+ Gravity = 0.1f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 1;
+
+ Flammable = 15;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 80;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 70;
+ Description = "Yeast, grows when warm (~37C).";
+
+ State = ST_SOLID;
+ Properties = TYPE_PART;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 373.0f;
+ HighTemperatureTransition = PT_DYST;
+
+ Update = &Element_YEST::update;
+
}
//#TPT-Directive ElementHeader Element_YEST static int update(UPDATE_FUNC_ARGS)
@@ -52,7 +52,7 @@ int Element_YEST::update(UPDATE_FUNC_ARGS)
int r, rx, ry;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)