diff options
| author | jacob1 <jfu614@gmail.com> | 2013-07-13 16:06:43 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-07-13 16:06:43 (GMT) |
| commit | 864f0e6f4528e9cf4ecf225dd655c29a77de171e (patch) | |
| tree | b0a9ec1f8bccca857e00f8f7c1a017f20852dd2e /src | |
| parent | 34db317e446b918d5e388f9b01e64704e2cf9f31 (diff) | |
| download | powder-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')
| -rw-r--r-- | src/graphics/Renderer.cpp | 19 | ||||
| -rw-r--r-- | src/gui/interface/Engine.h | 2 | ||||
| -rwxr-xr-x | src/simulation/Gravity.cpp | 2 | ||||
| -rw-r--r-- | src/simulation/Simulation.cpp | 27 | ||||
| -rw-r--r-- | src/simulation/elements/WIFI.cpp | 2 |
5 files changed, 14 insertions, 38 deletions
diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index d732d18..d47b1ba 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -1123,7 +1123,6 @@ void Renderer::render_parts() int orbd[4] = {0, 0, 0, 0}, orbl[4] = {0, 0, 0, 0}; float gradv, flicker, fnx, fny; Particle * parts; - part_transition *ptransitions; Element *elements; if(!sim) return; @@ -1369,7 +1368,6 @@ void Renderer::render_parts() if(pixel_mode & PSPEC_STICKMAN) { char buff[4]; //Buffer for HP - int s; int legr, legg, legb; playerst *cplayer; if(t==PT_STKM) @@ -1857,7 +1855,6 @@ void Renderer::render_parts() int nxo = 0; int nyo = 0; int r; - int fire_rv = 0; float drad = 0.0f; float ddist = 0.0f; sim->orbitalparts_get(parts[i].life, parts[i].ctype, orbd, orbl); @@ -1875,7 +1872,6 @@ void Renderer::render_parts() int nxo = 0; int nyo = 0; int r; - int fire_bv = 0; float drad = 0.0f; float ddist = 0.0f; sim->orbitalparts_get(parts[i].life, parts[i].ctype, orbd, orbl); @@ -1890,19 +1886,24 @@ void Renderer::render_parts() } if (pixel_mode & EFFECT_DBGLINES) { - if (mousePos.X == nx && mousePos.Y == ny && debugLines)//draw lines connecting wifi/portal channels + if (mousePos.X == nx && mousePos.Y == ny && debugLines && !(display_mode&DISPLAY_PERS))//draw lines connecting wifi/portal channels { int z; - int type = parts[i].type; + int type = parts[i].type, tmp = (int)((parts[i].temp-73.15f)/100+1), othertmp; if (type == PT_PRTI) type = PT_PRTO; else if (type == PT_PRTO) type = PT_PRTI; - for (z = 0; z<NPART; z++) { + for (z = 0; z<NPART; z++) + { if (parts[z].type) { - if (parts[z].type==type&&parts[z].tmp==parts[i].tmp) - xor_line(nx,ny,(int)(parts[z].x+0.5f),(int)(parts[z].y+0.5f)); + if (parts[z].type==type) + { + othertmp = (int)((parts[z].temp-73.15f)/100+1); + if (tmp == othertmp) + xor_line(nx,ny,(int)(parts[z].x+0.5f),(int)(parts[z].y+0.5f)); + } } } } diff --git a/src/gui/interface/Engine.h b/src/gui/interface/Engine.h index fb110e4..6545b4c 100644 --- a/src/gui/interface/Engine.h +++ b/src/gui/interface/Engine.h @@ -53,7 +53,7 @@ namespace ui void Draw(); void SetFps(float fps); - inline float GetFps() { return fps; }; + inline float GetFps() { return fps; } inline int GetMouseButton() { return mouseb_; } inline int GetMouseX() { return mousex_; } 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; |
