remove useless and laggy lightning_recreate check
This commit is contained in:
parent
332aa25bf6
commit
074a2226e1
@ -3230,34 +3230,12 @@ void Simulation::update_particles_i(int start, int inc)
|
||||
int h_count = 0;
|
||||
int surround[8];
|
||||
int surround_hconduct[8];
|
||||
int lighting_ok=1;
|
||||
unsigned int elem_properties;
|
||||
float pGravX, pGravY, pGravD;
|
||||
int excessive_stacking_found = 0;
|
||||
|
||||
currentTick++;
|
||||
|
||||
if (lighting_recreate>0)
|
||||
{
|
||||
for (i=0; i<=parts_lastActiveIndex; i++)
|
||||
{
|
||||
if (parts[i].type==PT_LIGH && parts[i].tmp2>0)
|
||||
{
|
||||
lighting_ok=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (lighting_ok)
|
||||
lighting_recreate--;
|
||||
|
||||
if (lighting_recreate<0)
|
||||
lighting_recreate=1;
|
||||
|
||||
if (lighting_recreate>21)
|
||||
lighting_recreate=21;
|
||||
|
||||
//if (sys_pause&&!framerender)//do nothing if paused
|
||||
// return;
|
||||
|
||||
@ -3815,7 +3793,7 @@ void Simulation::update_particles_i(int start, int inc)
|
||||
if ((t==PT_ICEI || t==PT_SNOW) && (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM || parts[i].ctype==PT_ICEI || parts[i].ctype==PT_SNOW || !elements[parts[i].ctype].Enabled))
|
||||
parts[i].ctype = PT_WATR;
|
||||
|
||||
if (ctemph>elements[t].HighTemperature && elements[t].HighTemperatureTransition>-1)
|
||||
if (elements[t].HighTemperatureTransition>-1 && ctemph>elements[t].HighTemperature)
|
||||
{
|
||||
// particle type change due to high temperature
|
||||
#ifdef REALISTIC
|
||||
@ -3911,7 +3889,7 @@ void Simulation::update_particles_i(int start, int inc)
|
||||
else
|
||||
s = 0;
|
||||
}
|
||||
else if (ctempl<elements[t].LowTemperature && elements[t].LowTemperatureTransition > -1)
|
||||
else if (elements[t].LowTemperatureTransition > -1 && ctempl<elements[t].LowTemperature)
|
||||
{
|
||||
// particle type change due to low temperature
|
||||
#ifdef REALISTIC
|
||||
@ -4095,7 +4073,7 @@ void Simulation::update_particles_i(int start, int inc)
|
||||
|
||||
s = 1;
|
||||
gravtot = fabs(gravy[(y/CELL)*(XRES/CELL)+(x/CELL)])+fabs(gravx[(y/CELL)*(XRES/CELL)+(x/CELL)]);
|
||||
if (pv[y/CELL][x/CELL]>elements[t].HighPressure&&elements[t].HighPressureTransition>-1) {
|
||||
if (elements[t].HighPressureTransition>-1 && pv[y/CELL][x/CELL]>elements[t].HighPressure) {
|
||||
// particle type change due to high pressure
|
||||
if (elements[t].HighPressureTransition!=PT_NUM)
|
||||
t = elements[t].HighPressureTransition;
|
||||
@ -4107,12 +4085,12 @@ void Simulation::update_particles_i(int start, int inc)
|
||||
else s = 0;
|
||||
}
|
||||
else s = 0;
|
||||
} else if (pv[y/CELL][x/CELL]<elements[t].LowPressure&&elements[t].LowPressureTransition>-1) {
|
||||
} else if (elements[t].LowPressureTransition>-1 && pv[y/CELL][x/CELL]<elements[t].LowPressure) {
|
||||
// particle type change due to low pressure
|
||||
if (elements[t].LowPressureTransition!=PT_NUM)
|
||||
t = elements[t].LowPressureTransition;
|
||||
else s = 0;
|
||||
} else if (gravtot>(elements[t].HighPressure/4.0f)&&elements[t].HighPressureTransition>-1) {
|
||||
} else if (elements[t].HighPressureTransition>-1 && gravtot>(elements[t].HighPressure/4.0f)) {
|
||||
// particle type change due to high gravity
|
||||
if (elements[t].HighPressureTransition!=PT_NUM)
|
||||
t = elements[t].HighPressureTransition;
|
||||
@ -4125,12 +4103,16 @@ void Simulation::update_particles_i(int start, int inc)
|
||||
}
|
||||
else s = 0;
|
||||
} else s = 0;
|
||||
if (s) { // particle type change occurred
|
||||
|
||||
// particle type change occurred
|
||||
if (s)
|
||||
{
|
||||
parts[i].life = 0;
|
||||
part_change_type(i,x,y,t);
|
||||
if (t==PT_FIRE)
|
||||
parts[i].life = rand()%50+120;
|
||||
if (t==PT_NONE) {
|
||||
if (t==PT_NONE)
|
||||
{
|
||||
kill_part(i);
|
||||
goto killed;
|
||||
}
|
||||
@ -4781,7 +4763,6 @@ Simulation::Simulation():
|
||||
pretty_powder(0),
|
||||
sandcolour_frame(0),
|
||||
emp_decor(0),
|
||||
lighting_recreate(0),
|
||||
force_stacking_check(0),
|
||||
ISWIRE(0),
|
||||
gravWallChanged(false),
|
||||
|
@ -66,7 +66,6 @@ public:
|
||||
playerst player2;
|
||||
playerst fighters[256]; //255 is the maximum number of fighters
|
||||
unsigned char fighcount; //Contains the number of fighters
|
||||
int lighting_recreate;
|
||||
bool gravWallChanged;
|
||||
//Portals and Wifi
|
||||
Particle portalp[CHANNELS][8][80];
|
||||
|
Loading…
Reference in New Issue
Block a user