findpattern tool and clean up

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5141 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2010-06-04 19:50:03 +00:00
parent 28c9171015
commit 2e9c12bf65
4 changed files with 66 additions and 52 deletions
+3 -1
View File
@@ -14,7 +14,8 @@ float raycube(const vec &o, const vec &ray, vec &surface)
vec v = o;
float dist = 0, dx = 0, dy = 0, dz = 0;
for(int nr=0;nr<1024;nr++) // sam's suggestion
int nr;
for(nr=0;nr<512;nr++) // sam's suggestion :: I found no map which got nr > 350
{
int x = int(v.x), y = int(v.y);
if(x < 0 || y < 0 || x >= ssize || y >= ssize) return -1;
@@ -55,6 +56,7 @@ float raycube(const vec &o, const vec &ray, vec &surface)
v.add(vec(ray).mul(disttonext));
dist += disttonext;
}
if (nr == 512) return -1;
return dist;
}