summaryrefslogtreecommitdiff
path: root/src/simulation
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-07-13 16:06:43 (GMT)
committer jacob1 <jfu614@gmail.com>2013-07-13 16:06:43 (GMT)
commit864f0e6f4528e9cf4ecf225dd655c29a77de171e (patch)
treeb0a9ec1f8bccca857e00f8f7c1a017f20852dd2e /src/simulation
parent34db317e446b918d5e388f9b01e64704e2cf9f31 (diff)
downloadpowder-864f0e6f4528e9cf4ecf225dd655c29a77de171e.zip
powder-864f0e6f4528e9cf4ecf225dd655c29a77de171e.tar.gz
WIFI lines aren't drawn in persistent mode, and are based on current temp, not tmp, so they work when paused
Diffstat (limited to 'src/simulation')
-rwxr-xr-xsrc/simulation/Gravity.cpp2
-rw-r--r--src/simulation/Simulation.cpp27
-rw-r--r--src/simulation/elements/WIFI.cpp2
3 files changed, 3 insertions, 28 deletions
diff --git a/src/simulation/Gravity.cpp b/src/simulation/Gravity.cpp
index 4fccbd3..4d5bbe4 100755
--- a/src/simulation/Gravity.cpp
+++ b/src/simulation/Gravity.cpp
@@ -458,7 +458,7 @@ void Gravity::mask_free(mask_el *c_mask_el){
void Gravity::gravity_mask()
{
char checkmap[YRES/CELL][XRES/CELL];
- int x = 0, y = 0, i, j;
+ int x = 0, y = 0;
unsigned maskvalue;
mask_el *t_mask_el = NULL;
mask_el *c_mask_el = NULL;
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index 90b4d81..c26d17c 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -4603,8 +4603,7 @@ int Simulation::GetParticleType(std::string type)
void Simulation::update_particles()//doesn't update the particles themselves, but some other things
{
- int i, j, x, y, t, nx, ny, r, cr,cg,cb, l = -1;
- float lx, ly;
+ int i, x, y, t;
int lastPartUsed = 0;
int lastPartUnused = -1;
#ifdef MT
@@ -4708,30 +4707,6 @@ void Simulation::update_particles()//doesn't update the particles themselves, bu
if(framerender)
framerender--;
- // this should probably be elsewhere
- /*for (y=0; y<YRES/CELL; y++)
- for (x=0; x<XRES/CELL; x++)
- if (bmap[y][x]==WL_STREAM)
- {
- lx = x*CELL + CELL*0.5f;
- ly = y*CELL + CELL*0.5f;
- for (t=0; t<1024; t++)
- {
- nx = (int)(lx+0.5f);
- ny = (int)(ly+0.5f);
- if (nx<0 || nx>=XRES || ny<0 || ny>=YRES)
- break;
- addpixel(vid, nx, ny, 255, 255, 255, 64);
- i = nx/CELL;
- j = ny/CELL;
- lx += vx[j][i]*0.125f;
- ly += vy[j][i]*0.125f;
- if (bmap[j][i]==WL_STREAM && i!=x && j!=y)
- break;
- }
- drawtext(vid, x*CELL, y*CELL-2, "\x8D", 255, 255, 255, 128);
- }
-*/
}
Simulation::~Simulation()
diff --git a/src/simulation/elements/WIFI.cpp b/src/simulation/elements/WIFI.cpp
index 81d4e60..e6d41f6 100644
--- a/src/simulation/elements/WIFI.cpp
+++ b/src/simulation/elements/WIFI.cpp
@@ -89,7 +89,7 @@ int Element_WIFI::graphics(GRAPHICS_FUNC_ARGS)
{
float frequency = 0.0628;
- int q = cpart->tmp;
+ int q = (int)((cpart->temp-73.15f)/100+1);
*colr = sin(frequency*q + 0) * 127 + 128;
*colg = sin(frequency*q + 2) * 127 + 128;
*colb = sin(frequency*q + 4) * 127 + 128;