From 864f0e6f4528e9cf4ecf225dd655c29a77de171e Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 13 Jul 2013 12:06:43 -0400 Subject: [PATCH] WIFI lines aren't drawn in persistent mode, and are based on current temp, not tmp, so they work when paused --- src/graphics/Renderer.cpp | 19 ++++++++++--------- src/gui/interface/Engine.h | 2 +- src/simulation/Gravity.cpp | 2 +- src/simulation/Simulation.cpp | 27 +-------------------------- 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 d732d1832..d47b1bae9 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=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 81d4e602e..e6d41f61c 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;