PEWNWU7TD3LETUMWCCI365KH7PVV2XCUOIFTPBH2LK2ZPGS4URZAC
const int signx = ((targetx - sourcex >= 0) ? 1 : -1);
const int signy = ((targety - sourcey >= 0) ? 1 : -1);
const int absx = signx * (targetx - sourcex);
const int absy = signy * (targety - sourcey);
const int signx = ((target.x - source.x >= 0) ? 1 : -1);
const int signy = ((target.y - source.y >= 0) ? 1 : -1);
const int absx = signx * (target.x - source.x);
const int absy = signy * (target.y - source.y);
if (lray[cellray] == abs)
if (lray[cellray] != abs)
continue;
if (find_shortest)
{
unaliased_ray.clear();
unaliased_ray.push_back(coord_def(0, 0));
}
// Check if we're blocked so far.
bool blocked = false;
coord_def c1, c3;
int real_length = 0;
for (inray = 0; inray <= cellray; ++inray)
const int xi = signx * ray_coords[inray + fullrays[fray].start].x;
const int yi = signy * ray_coords[inray + fullrays[fray].start].y;
if (inray < cellray && !ignore_solid
&& grid_is_solid(grd[sourcex + xi][sourcey + yi]))
{
blocked = true;
break;
}
c3 = coord_def(xi, yi);
// Check for a perpendicular corner on the ray and
// pretend that it's a diagonal.
if ((c3 - c1).abs() != 2)
++real_length;
else
{
// c2 was a dud move, pop it off
unaliased_ray.pop_back();
}
// c2 was a dud move, pop it off
unaliased_ray.pop_back();
// If this ray is a candidate for shortest, calculate
// the imbalance.
int cimbalance = 0;
if (!blocked && find_shortest && shortest >= real_length)
cimbalance = _imbalance(unaliased_ray);
// If this ray is a candidate for shortest, calculate
// the imbalance.
int cimbalance = 0;
if (!blocked && find_shortest && shortest >= real_length)
cimbalance = _imbalance(unaliased_ray);