UpdateParticles takes a range that is inclusive on both ends
This commit is contained in:
parent
888e0f2065
commit
ca93e69b19
@ -34,7 +34,7 @@ void ParticleDebug::Debug(int mode, int x, int y)
|
||||
{
|
||||
if (x < 0 || x >= XRES || y < 0 || y >= YRES || !sim->pmap[y][x] || (i = ID(sim->pmap[y][x])) < debug_currentParticle)
|
||||
{
|
||||
i = NPART;
|
||||
i = NPART - 1;
|
||||
logmessage = String::Build("Updated particles from #", debug_currentParticle, " to end, updated sim");
|
||||
}
|
||||
else
|
||||
@ -88,7 +88,7 @@ bool ParticleDebug::KeyPress(int key, int scan, bool shift, bool ctrl, bool alt,
|
||||
return true;
|
||||
if (sim->debug_currentParticle > 0)
|
||||
{
|
||||
sim->UpdateParticles(sim->debug_currentParticle, NPART);
|
||||
sim->UpdateParticles(sim->debug_currentParticle, NPART - 1);
|
||||
sim->AfterSim();
|
||||
String logmessage = String::Build("Updated particles from #", sim->debug_currentParticle, " to end, updated sim");
|
||||
model->Log(logmessage, false);
|
||||
|
@ -891,7 +891,7 @@ void GameController::Update()
|
||||
sim->BeforeSim();
|
||||
if (!sim->sys_pause || sim->framerender)
|
||||
{
|
||||
sim->UpdateParticles(0, NPART);
|
||||
sim->UpdateParticles(0, NPART - 1);
|
||||
sim->AfterSim();
|
||||
}
|
||||
|
||||
|
@ -1236,7 +1236,7 @@ void GameModel::SetPaused(bool pauseState)
|
||||
if (!pauseState && sim->debug_currentParticle > 0)
|
||||
{
|
||||
String logmessage = String::Build("Updated particles from #", sim->debug_currentParticle, " to end due to unpause");
|
||||
sim->UpdateParticles(sim->debug_currentParticle, NPART);
|
||||
sim->UpdateParticles(sim->debug_currentParticle, NPART - 1);
|
||||
sim->AfterSim();
|
||||
sim->debug_currentParticle = 0;
|
||||
Log(logmessage, false);
|
||||
|
@ -162,7 +162,7 @@ public:
|
||||
void set_emap(int x, int y);
|
||||
int parts_avg(int ci, int ni, int t);
|
||||
void create_arc(int sx, int sy, int dx, int dy, int midpoints, int variance, int type, int flags);
|
||||
void UpdateParticles(int start, int end);
|
||||
void UpdateParticles(int start, int end); // range inclusive on both ends
|
||||
void SimulateGoL();
|
||||
void RecalcFreeParticles(bool do_life_dec);
|
||||
void CheckStacking();
|
||||
|
Reference in New Issue
Block a user