mirror of
https://github.com/ZDoom/zdbsp.git
synced 2024-11-10 06:31:35 +00:00
- 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:
parent
5649bdb356
commit
c512b642a8
6 changed files with 86 additions and 45 deletions
24
main.cpp
24
main.cpp
|
@ -99,6 +99,7 @@ bool ConformNodes = false;
|
|||
bool NoPrune = false;
|
||||
EBlockmapMode BlockmapMode = EBM_Rebuild;
|
||||
ERejectMode RejectMode = ERM_DontTouch;
|
||||
bool WriteComments = false;
|
||||
int MaxSegs = 64;
|
||||
int SplitCost = 8;
|
||||
int AAPreference = 16;
|
||||
|
@ -144,10 +145,11 @@ static option long_opts[] =
|
|||
{"gl-v5", no_argument, 0, '5'},
|
||||
{"no-sse", no_argument, 0, 1002},
|
||||
{"no-sse2", no_argument, 0, 1003},
|
||||
{"comments", no_argument, 0, 'c'},
|
||||
{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 --------------------------------------------------------------------
|
||||
|
||||
|
@ -400,6 +402,9 @@ static void ParseArgs (int argc, char **argv)
|
|||
case 't':
|
||||
NoTiming = true;
|
||||
break;
|
||||
case 'c':
|
||||
WriteComments = true;
|
||||
break;
|
||||
case 'V':
|
||||
ShowVersion ();
|
||||
exit (0);
|
||||
|
@ -473,29 +478,28 @@ static void ShowUsage ()
|
|||
|
||||
static void ShowVersion ()
|
||||
{
|
||||
printf ("ZDBSP " ZDBSP_VERSION
|
||||
printf ("ZDBSP " ZDBSP_VERSION " ("
|
||||
#if defined(__GNUC__)
|
||||
|
||||
" (GCC"
|
||||
"GCC"
|
||||
#if defined(__i386__)
|
||||
"-x86"
|
||||
"-x86 : "
|
||||
#elif defined(__amd64__)
|
||||
"-amd64"
|
||||
"-amd64 : "
|
||||
#endif
|
||||
")"
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
|
||||
" (VC"
|
||||
#if defined(_M_X86)
|
||||
"-x86"
|
||||
"-x86 : "
|
||||
#elif defined(_M_X64)
|
||||
"-x64"
|
||||
"-x64 : "
|
||||
#endif
|
||||
")"
|
||||
|
||||
#endif
|
||||
"\n");
|
||||
|
||||
__DATE__ ")\n");
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -33,7 +33,8 @@ enum
|
|||
// Thing numbers used in Doom and Heretic maps
|
||||
PO_ANCHOR_TYPE = 9300,
|
||||
PO_SPAWN_TYPE,
|
||||
PO_SPAWNCRUSH_TYPE
|
||||
PO_SPAWNCRUSH_TYPE,
|
||||
PO_SPAWNHURT_TYPE
|
||||
};
|
||||
|
||||
FLevel::FLevel ()
|
||||
|
@ -487,6 +488,7 @@ void FProcessor::GetPolySpots ()
|
|||
{
|
||||
if (Level.Things[i].type == spot1 ||
|
||||
Level.Things[i].type == spot2 ||
|
||||
Level.Things[i].type == PO_SPAWNHURT_TYPE ||
|
||||
Level.Things[i].type == anchor)
|
||||
{
|
||||
FNodeBuilder::FPolyStart newvert;
|
||||
|
|
10
processor.h
10
processor.h
|
@ -99,11 +99,11 @@ private:
|
|||
|
||||
void WriteProps(FWadWriter &out, TArray<UDMFKey> &props);
|
||||
void WriteIntProp(FWadWriter &out, const char *key, int value);
|
||||
void WriteThingUDMF(FWadWriter &out, IntThing *th);
|
||||
void WriteLinedefUDMF(FWadWriter &out, IntLineDef *ld);
|
||||
void WriteSidedefUDMF(FWadWriter &out, IntSideDef *sd);
|
||||
void WriteSectorUDMF(FWadWriter &out, IntSector *sec);
|
||||
void WriteVertexUDMF(FWadWriter &out, IntVertex *vt);
|
||||
void WriteThingUDMF(FWadWriter &out, IntThing *th, int num);
|
||||
void WriteLinedefUDMF(FWadWriter &out, IntLineDef *ld, int num);
|
||||
void WriteSidedefUDMF(FWadWriter &out, IntSideDef *sd, int num);
|
||||
void WriteSectorUDMF(FWadWriter &out, IntSector *sec, int num);
|
||||
void WriteVertexUDMF(FWadWriter &out, IntVertex *vt, int num);
|
||||
void WriteTextMap(FWadWriter &out);
|
||||
void WriteUDMF(FWadWriter &out);
|
||||
|
||||
|
|
|
@ -311,7 +311,7 @@ void FProcessor::ParseMapProperties()
|
|||
if (!stricmp(key, "namespace"))
|
||||
{
|
||||
// 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
|
||||
|
@ -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);
|
||||
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, "v2", ld->v2);
|
||||
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);
|
||||
WriteProps(out, sd->props);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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++)
|
||||
|
@ -514,22 +549,22 @@ void FProcessor::WriteTextMap(FWadWriter &out)
|
|||
// not valid!
|
||||
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++)
|
||||
{
|
||||
WriteLinedefUDMF(out, &Level.Lines[i]);
|
||||
WriteLinedefUDMF(out, &Level.Lines[i], 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++)
|
||||
{
|
||||
WriteSectorUDMF(out, &Level.Sectors[i]);
|
||||
WriteSectorUDMF(out, &Level.Sectors[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
10
resource.rc
10
resource.rc
|
@ -90,8 +90,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,12,0,0
|
||||
PRODUCTVERSION 1,12,0,0
|
||||
FILEVERSION 1,13,0,0
|
||||
PRODUCTVERSION 1,13,0,0
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -107,12 +107,12 @@ BEGIN
|
|||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "ZDBSP Node Builder"
|
||||
VALUE "FileVersion", "1.12"
|
||||
VALUE "FileVersion", "1.13"
|
||||
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 "ProductName", "ZDBSP"
|
||||
VALUE "ProductVersion", "1.12"
|
||||
VALUE "ProductVersion", "1.13"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
4
zdbsp.h
4
zdbsp.h
|
@ -16,7 +16,7 @@ typedef __int32 int32_t;
|
|||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#define ZDBSP_VERSION "1.12"
|
||||
#define ZDBSP_VERSION "1.13"
|
||||
|
||||
enum EBlockmapMode
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ enum ERejectMode
|
|||
extern const char *Map;
|
||||
extern const char *InName;
|
||||
extern const char *OutName;
|
||||
extern bool BuildNodes, BuildGLNodes, ConformNodes, GLOnly;
|
||||
extern bool BuildNodes, BuildGLNodes, ConformNodes, GLOnly, WriteComments;
|
||||
extern bool NoPrune;
|
||||
extern EBlockmapMode BlockmapMode;
|
||||
extern ERejectMode RejectMode;
|
||||
|
|
Loading…
Reference in a new issue