Removed unneeded addCandidate function.

This commit is contained in:
Steve 2016-02-21 09:41:32 +00:00
parent 4d3b2f10a1
commit 9ced1e75c8
1 changed files with 1 additions and 22 deletions

View File

@ -28,7 +28,6 @@ static int memory;
static int getIndex(Quadtree *root, int x, int y, int w, int h); static int getIndex(Quadtree *root, int x, int y, int w, int h);
static void removeEntity(Entity *e, Quadtree *root); static void removeEntity(Entity *e, Quadtree *root);
static void addCandidate(Entity *e);
static int candidatesComparator(const void *a, const void *b); static int candidatesComparator(const void *a, const void *b);
static void getAllEntsWithinNode(int x, int y, int w, int h, Entity *ignore, Quadtree *root); static void getAllEntsWithinNode(int x, int y, int w, int h, Entity *ignore, Quadtree *root);
static void destroyQuadtreeNode(Quadtree *root); static void destroyQuadtreeNode(Quadtree *root);
@ -249,7 +248,7 @@ static void getAllEntsWithinNode(int x, int y, int w, int h, Entity *ignore, Qua
for (i = 0 ; i < root->numEnts ; i++) for (i = 0 ; i < root->numEnts ; i++)
{ {
addCandidate(root->ents[i]); candidates[cIndex++] = root->ents[i];
if (cIndex == cCapacity) if (cIndex == cCapacity)
{ {
@ -302,26 +301,6 @@ static void resizeCandidates(void)
cCapacity = n; cCapacity = n;
} }
static void addCandidate(Entity *e)
{
int i;
for (i = 0 ; i <= cIndex ; i++)
{
/* already added */
if (candidates[i] == e)
{
return;
}
if (!candidates[i])
{
candidates[cIndex++] = e;
return;
}
}
}
void destroyQuadtree(void) void destroyQuadtree(void)
{ {
destroyQuadtreeNode(&battle.quadtree); destroyQuadtreeNode(&battle.quadtree);