- fixed: The internal blockmap builder still used 16 bit WORDs to reference linedefs so it failed on USMF maps which exceed this value.

SVN r3092 (trunk)
This commit is contained in:
Christoph Oelckers 2011-01-09 11:01:04 +00:00
parent 5ddd2ecffa
commit 5d79cfd303
1 changed files with 13 additions and 13 deletions

View File

@ -2483,10 +2483,10 @@ void P_LoadSideDefs2 (MapData * map)
// as possible from its ZDBSP incarnation. // as possible from its ZDBSP incarnation.
// //
static unsigned int BlockHash (TArray<WORD> *block) static unsigned int BlockHash (TArray<int> *block)
{ {
int hash = 0; int hash = 0;
WORD *ar = &(*block)[0]; int *ar = &(*block)[0];
for (size_t i = 0; i < block->Size(); ++i) for (size_t i = 0; i < block->Size(); ++i)
{ {
hash = hash * 12235 + ar[i]; hash = hash * 12235 + ar[i];
@ -2494,7 +2494,7 @@ static unsigned int BlockHash (TArray<WORD> *block)
return hash & 0x7fffffff; return hash & 0x7fffffff;
} }
static bool BlockCompare (TArray<WORD> *block1, TArray<WORD> *block2) static bool BlockCompare (TArray<int> *block1, TArray<int> *block2)
{ {
size_t size = block1->Size(); size_t size = block1->Size();
@ -2506,8 +2506,8 @@ static bool BlockCompare (TArray<WORD> *block1, TArray<WORD> *block2)
{ {
return true; return true;
} }
WORD *ar1 = &(*block1)[0]; int *ar1 = &(*block1)[0];
WORD *ar2 = &(*block2)[0]; int *ar2 = &(*block2)[0];
for (size_t i = 0; i < size; ++i) for (size_t i = 0; i < size; ++i)
{ {
if (ar1[i] != ar2[i]) if (ar1[i] != ar2[i])
@ -2518,20 +2518,20 @@ static bool BlockCompare (TArray<WORD> *block1, TArray<WORD> *block2)
return true; return true;
} }
static void CreatePackedBlockmap (TArray<int> &BlockMap, TArray<WORD> *blocks, int bmapwidth, int bmapheight) static void CreatePackedBlockmap (TArray<int> &BlockMap, TArray<int> *blocks, int bmapwidth, int bmapheight)
{ {
int buckets[4096]; int buckets[4096];
int *hashes, hashblock; int *hashes, hashblock;
TArray<WORD> *block; TArray<int> *block;
int zero = 0; int zero = 0;
int terminator = -1; int terminator = -1;
WORD *array; int *array;
int i, hash; int i, hash;
int hashed = 0, nothashed = 0; int hashed = 0, nothashed = 0;
hashes = new int[bmapwidth * bmapheight]; hashes = new int[bmapwidth * bmapheight];
memset (hashes, 0xff, sizeof(WORD)*bmapwidth*bmapheight); memset (hashes, 0xff, sizeof(int)*bmapwidth*bmapheight);
memset (buckets, 0xff, sizeof(buckets)); memset (buckets, 0xff, sizeof(buckets));
for (i = 0; i < bmapwidth * bmapheight; ++i) for (i = 0; i < bmapwidth * bmapheight; ++i)
@ -2578,12 +2578,12 @@ static void CreatePackedBlockmap (TArray<int> &BlockMap, TArray<WORD> *blocks, i
static void P_CreateBlockMap () static void P_CreateBlockMap ()
{ {
TArray<WORD> *BlockLists, *block, *endblock; TArray<int> *BlockLists, *block, *endblock;
WORD adder; int adder;
int bmapwidth, bmapheight; int bmapwidth, bmapheight;
int minx, maxx, miny, maxy; int minx, maxx, miny, maxy;
int i; int i;
WORD line; int line;
if (numvertexes <= 0) if (numvertexes <= 0)
return; return;
@ -2615,7 +2615,7 @@ static void P_CreateBlockMap ()
adder = bmapwidth; BlockMap.Push (adder); adder = bmapwidth; BlockMap.Push (adder);
adder = bmapheight; BlockMap.Push (adder); adder = bmapheight; BlockMap.Push (adder);
BlockLists = new TArray<WORD>[bmapwidth * bmapheight]; BlockLists = new TArray<int>[bmapwidth * bmapheight];
for (line = 0; line < numlines; ++line) for (line = 0; line < numlines; ++line)
{ {