increase handle limit to 16k

in 2008-02-09 meeting, decided to stick with a fixed-size array for
simplicity. (changing to vector would require modifying the m_refd
bitset optimization. there is a 32k handle limit due to serialization
code anyway, and no pressing need to justify changing either)

This was SVN commit r5612.
This commit is contained in:
janwas 2008-02-09 19:11:01 +00:00
parent df3198ce1e
commit bf31dd66b3
2 changed files with 3 additions and 3 deletions

View File

@ -155,9 +155,8 @@ const u8 *CEntityList::Deserialize(const u8* buffer, const u8* UNUSED(end))
handle = n & ~HANDLE_SENTINEL_BIT;
// We have to validate the data, or the HEntity constructor will debug_assert
// on us.
// FIXME 4096 shouldn't be hard-coded
// FIXME We should also check that the entity actually exists
if (handle < 4096 && handle != INVALID_HANDLE)
if (handle < MAX_HANDLES)
push_back(HEntity(handle));
}
return buffer;

View File

@ -30,7 +30,8 @@ class CStrW;
class CStr8;
class CVector3D;
#define MAX_HANDLES 4096
const size_t MAX_HANDLES = 16384;
cassert(MAX_HANDLES <= MAX_HANDLE+1);
// collision patch size, in graphics units, not tiles (1 tile = 4 units)
#define COLLISION_PATCH_SIZE 8