Skip to content

Commit

Permalink
that .5f should have been ouside the remainder_p
Browse files Browse the repository at this point in the history
also fix random compile warning (error?)
  • Loading branch information
jacob1 committed Mar 12, 2016
1 parent d334209 commit ccec5fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/simulation/Simulation.cpp
Expand Up @@ -2406,9 +2406,9 @@ int Simulation::do_move(int i, int x, int y, float nxf, float nyf)
bool x_ok = (nx >= CELL && nx < XRES-CELL);
bool y_ok = (ny >= CELL && ny < YRES-CELL);
if (!x_ok)
nxf = remainder_p(nxf-CELL, XRES-CELL*2.5f)+CELL;
nxf = remainder_p(nxf-CELL, XRES-CELL*2.0f)+CELL-.5f;
if (!y_ok)
nyf = remainder_p(nyf-CELL, YRES-CELL*2.5f)+CELL;
nyf = remainder_p(nyf-CELL, YRES-CELL*2.0f)+CELL-.5f;
nx = (int)(nxf+0.5f);
ny = (int)(nyf+0.5f);

Expand Down Expand Up @@ -4079,9 +4079,9 @@ void Simulation::UpdateParticles(int start, int end)
bool x_ok = (fin_x >= CELL && fin_x < XRES-CELL);
bool y_ok = (fin_y >= CELL && fin_y < YRES-CELL);
if (!x_ok)
fin_xf = remainder_p(fin_xf-CELL, XRES-CELL*2.5f)+CELL;
fin_xf = remainder_p(fin_xf-CELL, XRES-CELL*2.0f)+CELL-.5f;
if (!y_ok)
fin_yf = remainder_p(fin_yf-CELL, YRES-CELL*2.5f)+CELL;
fin_yf = remainder_p(fin_yf-CELL, YRES-CELL*2.0f)+CELL-.5f;
fin_x = (int)(fin_xf+0.5f);
fin_y = (int)(fin_yf+0.5f);
}
Expand Down Expand Up @@ -4132,12 +4132,12 @@ void Simulation::UpdateParticles(int start, int end)
int oldnx = nx, oldny = ny;
if (!x_ok)
{
parts[i].x = remainder_p(parts[i].x-CELL, XRES-CELL*2.5f)+CELL;
parts[i].x = remainder_p(parts[i].x-CELL, XRES-CELL*2.0f)+CELL-.5f;
nx = (int)((float)parts[i].x+0.5f);
}
if (!y_ok)
{
parts[i].y = remainder_p(parts[i].y-CELL, YRES-CELL*2.5f)+CELL;
parts[i].y = remainder_p(parts[i].y-CELL, YRES-CELL*2.0f)+CELL-.5f;
ny = (int)((float)parts[i].y+0.5f);
}

Expand Down
2 changes: 1 addition & 1 deletion src/tasks/Task.h
Expand Up @@ -2,7 +2,7 @@
#define TASK_H_

#include <string>
#include "common/tpt-thread.h"s
#include "common/tpt-thread.h"
#include "TaskListener.h"
#include "Config.h"

Expand Down

0 comments on commit ccec5fb

Please sign in to comment.