- ZDBSP update:

* Fixed: Polyobject detection was disabled for UDMF maps due to an incorrect
    namespace check.
  * Fixed: The polyobject spawn type PO_SPAWNHURT_TYPE (9303) was not recognized
    as a valid spawn spot, so split avoidance would not be enabled for any polyobjects
    that used them.
  * Added a -c (--comments) command line option to write entity numbers in comments
    next to each entity in UDMF maps (ala the upcoming Doom Builder 2).

SVN r1702 (trunk)
This commit is contained in:
Randy Heit 2009-07-04 00:12:14 +00:00
parent 5649bdb356
commit c512b642a8
6 changed files with 86 additions and 45 deletions

View file

@ -99,6 +99,7 @@ bool ConformNodes = false;
bool NoPrune = false; bool NoPrune = false;
EBlockmapMode BlockmapMode = EBM_Rebuild; EBlockmapMode BlockmapMode = EBM_Rebuild;
ERejectMode RejectMode = ERM_DontTouch; ERejectMode RejectMode = ERM_DontTouch;
bool WriteComments = false;
int MaxSegs = 64; int MaxSegs = 64;
int SplitCost = 8; int SplitCost = 8;
int AAPreference = 16; int AAPreference = 16;
@ -144,10 +145,11 @@ static option long_opts[] =
{"gl-v5", no_argument, 0, '5'}, {"gl-v5", no_argument, 0, '5'},
{"no-sse", no_argument, 0, 1002}, {"no-sse", no_argument, 0, 1002},
{"no-sse2", no_argument, 0, 1003}, {"no-sse2", no_argument, 0, 1003},
{"comments", no_argument, 0, 'c'},
{0,0,0,0} {0,0,0,0}
}; };
static const char short_opts[] = "wVgGvbNrReEm:o:f:p:s:d:PqtzZx5"; static const char short_opts[] = "wVgGvbNrReEm:o:f:p:s:d:PqtzZx5c";
// CODE -------------------------------------------------------------------- // CODE --------------------------------------------------------------------
@ -400,6 +402,9 @@ static void ParseArgs (int argc, char **argv)
case 't': case 't':
NoTiming = true; NoTiming = true;
break; break;
case 'c':
WriteComments = true;
break;
case 'V': case 'V':
ShowVersion (); ShowVersion ();
exit (0); exit (0);
@ -473,29 +478,28 @@ static void ShowUsage ()
static void ShowVersion () static void ShowVersion ()
{ {
printf ("ZDBSP " ZDBSP_VERSION printf ("ZDBSP " ZDBSP_VERSION " ("
#if defined(__GNUC__) #if defined(__GNUC__)
" (GCC" "GCC"
#if defined(__i386__) #if defined(__i386__)
"-x86" "-x86 : "
#elif defined(__amd64__) #elif defined(__amd64__)
"-amd64" "-amd64 : "
#endif #endif
")"
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
" (VC" " (VC"
#if defined(_M_X86) #if defined(_M_X86)
"-x86" "-x86 : "
#elif defined(_M_X64) #elif defined(_M_X64)
"-x64" "-x64 : "
#endif #endif
")"
#endif #endif
"\n");
__DATE__ ")\n");
} }
//========================================================================== //==========================================================================

View file

@ -33,7 +33,8 @@ enum
// Thing numbers used in Doom and Heretic maps // Thing numbers used in Doom and Heretic maps
PO_ANCHOR_TYPE = 9300, PO_ANCHOR_TYPE = 9300,
PO_SPAWN_TYPE, PO_SPAWN_TYPE,
PO_SPAWNCRUSH_TYPE PO_SPAWNCRUSH_TYPE,
PO_SPAWNHURT_TYPE
}; };
FLevel::FLevel () FLevel::FLevel ()
@ -487,6 +488,7 @@ void FProcessor::GetPolySpots ()
{ {
if (Level.Things[i].type == spot1 || if (Level.Things[i].type == spot1 ||
Level.Things[i].type == spot2 || Level.Things[i].type == spot2 ||
Level.Things[i].type == PO_SPAWNHURT_TYPE ||
Level.Things[i].type == anchor) Level.Things[i].type == anchor)
{ {
FNodeBuilder::FPolyStart newvert; FNodeBuilder::FPolyStart newvert;

View file

@ -99,11 +99,11 @@ private:
void WriteProps(FWadWriter &out, TArray<UDMFKey> &props); void WriteProps(FWadWriter &out, TArray<UDMFKey> &props);
void WriteIntProp(FWadWriter &out, const char *key, int value); void WriteIntProp(FWadWriter &out, const char *key, int value);
void WriteThingUDMF(FWadWriter &out, IntThing *th); void WriteThingUDMF(FWadWriter &out, IntThing *th, int num);
void WriteLinedefUDMF(FWadWriter &out, IntLineDef *ld); void WriteLinedefUDMF(FWadWriter &out, IntLineDef *ld, int num);
void WriteSidedefUDMF(FWadWriter &out, IntSideDef *sd); void WriteSidedefUDMF(FWadWriter &out, IntSideDef *sd, int num);
void WriteSectorUDMF(FWadWriter &out, IntSector *sec); void WriteSectorUDMF(FWadWriter &out, IntSector *sec, int num);
void WriteVertexUDMF(FWadWriter &out, IntVertex *vt); void WriteVertexUDMF(FWadWriter &out, IntVertex *vt, int num);
void WriteTextMap(FWadWriter &out); void WriteTextMap(FWadWriter &out);
void WriteUDMF(FWadWriter &out); void WriteUDMF(FWadWriter &out);

View file

@ -311,7 +311,7 @@ void FProcessor::ParseMapProperties()
if (!stricmp(key, "namespace")) if (!stricmp(key, "namespace"))
{ {
// all unknown namespaces are assumed to be standard. // all unknown namespaces are assumed to be standard.
Extended = !stricmp(value, "ZDoom") || !stricmp(value, "Hexen") || !stricmp(value, "Vavoom"); Extended = !stricmp(value, "\"ZDoom\"") || !stricmp(value, "\"Hexen\"") || !stricmp(value, "\"Vavoom\"");
} }
// now store the key in its unprocessed form // now store the key in its unprocessed form
@ -423,26 +423,40 @@ void FProcessor::WriteIntProp(FWadWriter &out, const char *key, int value)
//=========================================================================== //===========================================================================
// //
// writes an UDMF thing // writes a UDMF thing
// //
//=========================================================================== //===========================================================================
void FProcessor::WriteThingUDMF(FWadWriter &out, IntThing *th) void FProcessor::WriteThingUDMF(FWadWriter &out, IntThing *th, int num)
{ {
out.AddToLump("thing\n{\n", 8); out.AddToLump("thing", 5);
if (WriteComments)
{
char buffer[32];
int len = sprintf(buffer, " // %d", num);
out.AddToLump(buffer, len);
}
out.AddToLump("\n{\n", 3);
WriteProps(out, th->props); WriteProps(out, th->props);
out.AddToLump("}\n\n", 3); out.AddToLump("}\n\n", 3);
} }
//=========================================================================== //===========================================================================
// //
// writes an UDMF linedef // writes a UDMF linedef
// //
//=========================================================================== //===========================================================================
void FProcessor::WriteLinedefUDMF(FWadWriter &out, IntLineDef *ld) void FProcessor::WriteLinedefUDMF(FWadWriter &out, IntLineDef *ld, int num)
{ {
out.AddToLump("linedef\n{\n", 10); out.AddToLump("linedef", 7);
if (WriteComments)
{
char buffer[32];
int len = sprintf(buffer, " // %d", num);
out.AddToLump(buffer, len);
}
out.AddToLump("\n{\n", 3);
WriteIntProp(out, "v1", ld->v1); WriteIntProp(out, "v1", ld->v1);
WriteIntProp(out, "v2", ld->v2); WriteIntProp(out, "v2", ld->v2);
if (ld->sidenum[0] != NO_INDEX) WriteIntProp(out, "sidefront", ld->sidenum[0]); if (ld->sidenum[0] != NO_INDEX) WriteIntProp(out, "sidefront", ld->sidenum[0]);
@ -453,13 +467,20 @@ void FProcessor::WriteLinedefUDMF(FWadWriter &out, IntLineDef *ld)
//=========================================================================== //===========================================================================
// //
// writes an UDMF sidedef // writes a UDMF sidedef
// //
//=========================================================================== //===========================================================================
void FProcessor::WriteSidedefUDMF(FWadWriter &out, IntSideDef *sd) void FProcessor::WriteSidedefUDMF(FWadWriter &out, IntSideDef *sd, int num)
{ {
out.AddToLump("sidedef\n{\n", 10); out.AddToLump("sidedef", 7);
if (WriteComments)
{
char buffer[32];
int len = sprintf(buffer, " // %d", num);
out.AddToLump(buffer, len);
}
out.AddToLump("\n{\n", 3);
WriteIntProp(out, "sector", sd->sector); WriteIntProp(out, "sector", sd->sector);
WriteProps(out, sd->props); WriteProps(out, sd->props);
out.AddToLump("}\n\n", 3); out.AddToLump("}\n\n", 3);
@ -467,33 +488,47 @@ void FProcessor::WriteSidedefUDMF(FWadWriter &out, IntSideDef *sd)
//=========================================================================== //===========================================================================
// //
// writes an UDMF sector // writes a UDMF sector
// //
//=========================================================================== //===========================================================================
void FProcessor::WriteSectorUDMF(FWadWriter &out, IntSector *sec) void FProcessor::WriteSectorUDMF(FWadWriter &out, IntSector *sec, int num)
{ {
out.AddToLump("sector\n{\n", 9); out.AddToLump("sector", 6);
if (WriteComments)
{
char buffer[32];
int len = sprintf(buffer, " // %d", num);
out.AddToLump(buffer, len);
}
out.AddToLump("\n{\n", 3);
WriteProps(out, sec->props); WriteProps(out, sec->props);
out.AddToLump("}\n\n", 3); out.AddToLump("}\n\n", 3);
} }
//=========================================================================== //===========================================================================
// //
// writes an UDMF vertex // writes a UDMF vertex
// //
//=========================================================================== //===========================================================================
void FProcessor::WriteVertexUDMF(FWadWriter &out, IntVertex *vt) void FProcessor::WriteVertexUDMF(FWadWriter &out, IntVertex *vt, int num)
{ {
out.AddToLump("vertex\n{\n", 9); out.AddToLump("vertex", 6);
if (WriteComments)
{
char buffer[32];
int len = sprintf(buffer, " // %d", num);
out.AddToLump(buffer, len);
}
out.AddToLump("\n{\n", 3);
WriteProps(out, vt->props); WriteProps(out, vt->props);
out.AddToLump("}\n\n", 3); out.AddToLump("}\n\n", 3);
} }
//=========================================================================== //===========================================================================
// //
// writes an UDMF text map // writes a UDMF text map
// //
//=========================================================================== //===========================================================================
@ -503,7 +538,7 @@ void FProcessor::WriteTextMap(FWadWriter &out)
WriteProps(out, Level.props); WriteProps(out, Level.props);
for(int i = 0; i < Level.NumThings(); i++) for(int i = 0; i < Level.NumThings(); i++)
{ {
WriteThingUDMF(out, &Level.Things[i]); WriteThingUDMF(out, &Level.Things[i], i);
} }
for(int i = 0; i < Level.NumOrgVerts; i++) for(int i = 0; i < Level.NumOrgVerts; i++)
@ -514,22 +549,22 @@ void FProcessor::WriteTextMap(FWadWriter &out)
// not valid! // not valid!
throw std::runtime_error("Invalid vertex data."); throw std::runtime_error("Invalid vertex data.");
} }
WriteVertexUDMF(out, &Level.VertexProps[vt->index-1]); WriteVertexUDMF(out, &Level.VertexProps[vt->index-1], i);
} }
for(int i = 0; i < Level.NumLines(); i++) for(int i = 0; i < Level.NumLines(); i++)
{ {
WriteLinedefUDMF(out, &Level.Lines[i]); WriteLinedefUDMF(out, &Level.Lines[i], i);
} }
for(int i = 0; i < Level.NumSides(); i++) for(int i = 0; i < Level.NumSides(); i++)
{ {
WriteSidedefUDMF(out, &Level.Sides[i]); WriteSidedefUDMF(out, &Level.Sides[i], i);
} }
for(int i = 0; i < Level.NumSectors(); i++) for(int i = 0; i < Level.NumSectors(); i++)
{ {
WriteSectorUDMF(out, &Level.Sectors[i]); WriteSectorUDMF(out, &Level.Sectors[i], i);
} }
} }

View file

@ -90,8 +90,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,12,0,0 FILEVERSION 1,13,0,0
PRODUCTVERSION 1,12,0,0 PRODUCTVERSION 1,13,0,0
FILEFLAGSMASK 0x17L FILEFLAGSMASK 0x17L
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -107,12 +107,12 @@ BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "FileDescription", "ZDBSP Node Builder" VALUE "FileDescription", "ZDBSP Node Builder"
VALUE "FileVersion", "1.12" VALUE "FileVersion", "1.13"
VALUE "InternalName", "zdbsp" VALUE "InternalName", "zdbsp"
VALUE "LegalCopyright", "Copyright (C) 2002-2009 Randy Heit" VALUE "LegalCopyright", "Copyright (C) 2002-2009 Randy Heit, 2009 Christoph Oelckers"
VALUE "OriginalFilename", "zdbsp.exe" VALUE "OriginalFilename", "zdbsp.exe"
VALUE "ProductName", "ZDBSP" VALUE "ProductName", "ZDBSP"
VALUE "ProductVersion", "1.12" VALUE "ProductVersion", "1.13"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -16,7 +16,7 @@ typedef __int32 int32_t;
#include <stdint.h> #include <stdint.h>
#endif #endif
#define ZDBSP_VERSION "1.12" #define ZDBSP_VERSION "1.13"
enum EBlockmapMode enum EBlockmapMode
{ {
@ -35,7 +35,7 @@ enum ERejectMode
extern const char *Map; extern const char *Map;
extern const char *InName; extern const char *InName;
extern const char *OutName; extern const char *OutName;
extern bool BuildNodes, BuildGLNodes, ConformNodes, GLOnly; extern bool BuildNodes, BuildGLNodes, ConformNodes, GLOnly, WriteComments;
extern bool NoPrune; extern bool NoPrune;
extern EBlockmapMode BlockmapMode; extern EBlockmapMode BlockmapMode;
extern ERejectMode RejectMode; extern ERejectMode RejectMode;