WIFI lines aren't drawn in persistent mode, and are based on current temp, not tmp, so they work when paused

This commit is contained in:
jacob1 2013-07-13 12:06:43 -04:00
parent 34db317e44
commit 864f0e6f45
5 changed files with 14 additions and 38 deletions

View File

@ -1123,7 +1123,6 @@ void Renderer::render_parts()
int orbd[4] = {0, 0, 0, 0}, orbl[4] = {0, 0, 0, 0}; int orbd[4] = {0, 0, 0, 0}, orbl[4] = {0, 0, 0, 0};
float gradv, flicker, fnx, fny; float gradv, flicker, fnx, fny;
Particle * parts; Particle * parts;
part_transition *ptransitions;
Element *elements; Element *elements;
if(!sim) if(!sim)
return; return;
@ -1369,7 +1368,6 @@ void Renderer::render_parts()
if(pixel_mode & PSPEC_STICKMAN) if(pixel_mode & PSPEC_STICKMAN)
{ {
char buff[4]; //Buffer for HP char buff[4]; //Buffer for HP
int s;
int legr, legg, legb; int legr, legg, legb;
playerst *cplayer; playerst *cplayer;
if(t==PT_STKM) if(t==PT_STKM)
@ -1857,7 +1855,6 @@ void Renderer::render_parts()
int nxo = 0; int nxo = 0;
int nyo = 0; int nyo = 0;
int r; int r;
int fire_rv = 0;
float drad = 0.0f; float drad = 0.0f;
float ddist = 0.0f; float ddist = 0.0f;
sim->orbitalparts_get(parts[i].life, parts[i].ctype, orbd, orbl); sim->orbitalparts_get(parts[i].life, parts[i].ctype, orbd, orbl);
@ -1875,7 +1872,6 @@ void Renderer::render_parts()
int nxo = 0; int nxo = 0;
int nyo = 0; int nyo = 0;
int r; int r;
int fire_bv = 0;
float drad = 0.0f; float drad = 0.0f;
float ddist = 0.0f; float ddist = 0.0f;
sim->orbitalparts_get(parts[i].life, parts[i].ctype, orbd, orbl); sim->orbitalparts_get(parts[i].life, parts[i].ctype, orbd, orbl);
@ -1890,23 +1886,28 @@ void Renderer::render_parts()
} }
if (pixel_mode & EFFECT_DBGLINES) 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 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) if (type == PT_PRTI)
type = PT_PRTO; type = PT_PRTO;
else if (type == PT_PRTO) else if (type == PT_PRTO)
type = PT_PRTI; type = PT_PRTI;
for (z = 0; z<NPART; z++) { for (z = 0; z<NPART; z++)
{
if (parts[z].type) if (parts[z].type)
{ {
if (parts[z].type==type&&parts[z].tmp==parts[i].tmp) 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)); xor_line(nx,ny,(int)(parts[z].x+0.5f),(int)(parts[z].y+0.5f));
} }
} }
} }
} }
}
//Fire effects //Fire effects
if(firea && (pixel_mode & FIRE_BLEND)) if(firea && (pixel_mode & FIRE_BLEND))
{ {

View File

@ -53,7 +53,7 @@ namespace ui
void Draw(); void Draw();
void SetFps(float fps); void SetFps(float fps);
inline float GetFps() { return fps; }; inline float GetFps() { return fps; }
inline int GetMouseButton() { return mouseb_; } inline int GetMouseButton() { return mouseb_; }
inline int GetMouseX() { return mousex_; } inline int GetMouseX() { return mousex_; }

View File

@ -458,7 +458,7 @@ void Gravity::mask_free(mask_el *c_mask_el){
void Gravity::gravity_mask() void Gravity::gravity_mask()
{ {
char checkmap[YRES/CELL][XRES/CELL]; char checkmap[YRES/CELL][XRES/CELL];
int x = 0, y = 0, i, j; int x = 0, y = 0;
unsigned maskvalue; unsigned maskvalue;
mask_el *t_mask_el = NULL; mask_el *t_mask_el = NULL;
mask_el *c_mask_el = NULL; mask_el *c_mask_el = NULL;

View File

@ -4603,8 +4603,7 @@ int Simulation::GetParticleType(std::string type)
void Simulation::update_particles()//doesn't update the particles themselves, but some other things 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; int i, x, y, t;
float lx, ly;
int lastPartUsed = 0; int lastPartUsed = 0;
int lastPartUnused = -1; int lastPartUnused = -1;
#ifdef MT #ifdef MT
@ -4708,30 +4707,6 @@ void Simulation::update_particles()//doesn't update the particles themselves, bu
if(framerender) if(framerender)
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() Simulation::~Simulation()

View File

@ -89,7 +89,7 @@ int Element_WIFI::graphics(GRAPHICS_FUNC_ARGS)
{ {
float frequency = 0.0628; float frequency = 0.0628;
int q = cpart->tmp; int q = (int)((cpart->temp-73.15f)/100+1);
*colr = sin(frequency*q + 0) * 127 + 128; *colr = sin(frequency*q + 0) * 127 + 128;
*colg = sin(frequency*q + 2) * 127 + 128; *colg = sin(frequency*q + 2) * 127 + 128;
*colb = sin(frequency*q + 4) * 127 + 128; *colb = sin(frequency*q + 4) * 127 + 128;