- Added support for loading ZGL3/XGL3 nodes.

- Added additional debug spew for the nodebuilder.
- Restore the nodebuilder's debug spew that was present in ZDBSP but not the internal version.
  Use the CRT's printf for this output to ensure that it is identical to ZDBSP's output for the
  same input.

SVN r3980 (trunk)
This commit is contained in:
Randy Heit 2012-12-07 06:16:07 +00:00
commit d77297e969
8 changed files with 92 additions and 23 deletions

View file

@ -892,7 +892,7 @@ void P_LoadGLZSegs (FileReaderBase &data, int type)
BYTE side;
data >> v1 >> partner;
if (type == 2)
if (type >= 2)
{
data >> line;
}
@ -1045,13 +1045,20 @@ void LoadZNodes(FileReaderBase &data, int glnodes)
for (i = 0; i < numNodes; ++i)
{
SWORD x, y, dx, dy;
if (glnodes < 3)
{
SWORD x, y, dx, dy;
data >> x >> y >> dx >> dy;
nodes[i].x = x << FRACBITS;
nodes[i].y = y << FRACBITS;
nodes[i].dx = dx << FRACBITS;
nodes[i].dy = dy << FRACBITS;
data >> x >> y >> dx >> dy;
nodes[i].x = x << FRACBITS;
nodes[i].y = y << FRACBITS;
nodes[i].dx = dx << FRACBITS;
nodes[i].dy = dy << FRACBITS;
}
else
{
data >> nodes[i].x >> nodes[i].y >> nodes[i].dx >> nodes[i].dy;
}
for (int j = 0; j < 2; ++j)
{
for (int k = 0; k < 4; ++k)
@ -1100,6 +1107,11 @@ void P_LoadZNodes (FileReader &dalump, DWORD id)
compressed = true;
break;
case MAKE_ID('Z','G','L','3'):
type = 3;
compressed = true;
break;
case MAKE_ID('X','N','O','D'):
type = 0;
compressed = false;
@ -1115,6 +1127,11 @@ void P_LoadZNodes (FileReader &dalump, DWORD id)
compressed = false;
break;
case MAKE_ID('X','G','L','3'):
type = 3;
compressed = false;
break;
default:
return;
}
@ -3680,7 +3697,7 @@ void P_SetupLevel (char *lumpname, int position)
{
// Check for compressed nodes first, then uncompressed nodes
FWadLump test;
DWORD id = MAKE_ID('X','x','X','x'), idcheck = 0, idcheck2 = 0, idcheck3 = 0, idcheck4 = 0;
DWORD id = MAKE_ID('X','x','X','x'), idcheck = 0, idcheck2 = 0, idcheck3 = 0, idcheck4 = 0, idcheck5 = 0, idcheck6 = 0;
if (map->Size(ML_ZNODES) != 0)
{
@ -3694,8 +3711,10 @@ void P_SetupLevel (char *lumpname, int position)
map->Seek(ML_GLZNODES);
idcheck = MAKE_ID('Z','G','L','N');
idcheck2 = MAKE_ID('Z','G','L','2');
idcheck3 = MAKE_ID('X','G','L','N');
idcheck4 = MAKE_ID('X','G','L','2');
idcheck3 = MAKE_ID('Z','G','L','3');
idcheck4 = MAKE_ID('X','G','L','N');
idcheck5 = MAKE_ID('X','G','L','2');
idcheck6 = MAKE_ID('X','G','L','3');
}
map->file->Read (&id, 4);