(svn r16302) -Codechange: remove Vehicle::AllocateList

This commit is contained in:
smatz
2009-05-13 21:38:23 +00:00
parent c0ed9f779b
commit a1addc1d95
6 changed files with 47 additions and 94 deletions

View File

@@ -206,22 +206,6 @@ byte VehicleRandomBits()
return GB(Random(), 0, 8);
}
/* static */ bool Vehicle::AllocateList(Vehicle **vl, int num)
{
if (!Vehicle::CanAllocateItem(num)) return false;
if (vl == NULL) return true;
uint counter = _Vehicle_pool.first_free_index;
for (int i = 0; i != num; i++) {
vl[i] = new (AllocateRaw(counter)) InvalidVehicle();
counter++;
}
return true;
}
/* Size of the hash, 6 = 64 x 64, 7 = 128 x 128. Larger sizes will (in theory) reduce hash
* lookup times at the expense of memory usage. */
const int HASH_BITS = 7;