summaryrefslogtreecommitdiff
path: root/src/simulation/elements/ACEL.cpp
diff options
context:
space:
mode:
authorcracker64 <cracker642@gmail.com>2013-02-26 23:59:37 (GMT)
committer cracker64 <cracker642@gmail.com>2013-02-26 23:59:37 (GMT)
commit8250515e97db5ace3e87c612d855f09235b73969 (patch)
treeddbc36591a9043334b2fc684722ffd334894da83 /src/simulation/elements/ACEL.cpp
parente700ff29883fcc3479ad8d9fce9805fbb0d31dfa (diff)
downloadpowder-8250515e97db5ace3e87c612d855f09235b73969.zip
powder-8250515e97db5ace3e87c612d855f09235b73969.tar.gz
Lots of small optimizations and things, nothing should be functionally different.
Only gotten through a few elements, more later.
Diffstat (limited to 'src/simulation/elements/ACEL.cpp')
-rw-r--r--src/simulation/elements/ACEL.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/simulation/elements/ACEL.cpp b/src/simulation/elements/ACEL.cpp
index 143e195..12f408c 100644
--- a/src/simulation/elements/ACEL.cpp
+++ b/src/simulation/elements/ACEL.cpp
@@ -60,18 +60,18 @@ int Element_ACEL::update(UPDATE_FUNC_ARGS)
{
multiplier = 1.1f;
}
- 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))
- {
- r = pmap[y+ry][x+rx];
- if(!r)
- r = sim->photons[y+ry][x+rx];
- if ((r>>8)>=NPART || !r)
- continue;
- if(sim->elements[r&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY))
- {
+ 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))
+ {
+ r = pmap[y+ry][x+rx];
+ if(!r)
+ r = sim->photons[y+ry][x+rx];
+ if (!r)
+ continue;
+ if(sim->elements[r&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY))
+ {
parts[r>>8].vx *= multiplier;
parts[r>>8].vy *= multiplier;
parts[i].tmp = 1;