qbsp: exit with error if vertices exceed 65535

Unable to represent this in the bsp29 format, so let the user know instead
of silently corrupting the bsp.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-08-18 16:11:41 +09:30
parent 0bf7fc3374
commit ad25768498
1 changed files with 3 additions and 0 deletions

View File

@ -488,6 +488,9 @@ MakeFaceEdges(mapentity_t *entity, node_t *headnode)
edges->count = edges->index;
}
if (map.cTotal[BSPVERTEX] > 65535)
Error("Too many vertices (%d > 65535)", map.cTotal[BSPVERTEX]);
surfedges->data = AllocMem(BSPSURFEDGE, surfedges->count, true);
faces->data = AllocMem(BSPFACE, faces->count, true);