From cf3b1bfd6e3bf4b4887cb39c0ce0919fb8af2541 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 24 Aug 2006 19:19:15 +0000 Subject: [PATCH] - Removed the 64 seg limit for polyobjects defined with Polyobj_ExplicitLine. - Polyobj_StartLine and Polyobj_ExplicitLine can now set a line's ID. This is the fourth parameter for Polyobj_StartLine and the fifth parameter for Polyobj_ExplicitLine. SVN r310 (trunk) --- docs/rh-log.txt | 4 ++++ src/p_setup.cpp | 27 ++++++++++++++++++--------- src/po_man.cpp | 17 +++++------------ 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index f7f471264..81b34ced9 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,8 @@ August 24, 2006 +- Removed the 64 seg limit for polyobjects defined with Polyobj_ExplicitLine. +- Polyobj_StartLine and Polyobj_ExplicitLine can now set a line's ID. This is + the fourth parameter for Polyobj_StartLine and the fifth parameter for + Polyobj_ExplicitLine. - Added support for DDS textures compressed with DXT1, DXT3, or DXT5. August 23, 2006 diff --git a/src/p_setup.cpp b/src/p_setup.cpp index c5ecb0e22..1ede3bac5 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1649,21 +1649,30 @@ void P_AdjustLine (line_t *ld) // the tag doesn't always go into the first arg. if (level.flags & LEVEL_HEXENFORMAT) { - if (ld->special == Line_SetIdentification) + switch (ld->special) { + case Line_SetIdentification: ld->id = ld->args[0]; ld->flags |= ld->args[1]<<16; - } - else if (ld->special == TranslucentLine) - { + break; + + case TranslucentLine: ld->id = ld->args[0]; ld->flags |= ld->args[3]<<16; - } - else if ( - ld->special == Teleport_Line || - ld->special == Scroll_Texture_Model) - { + break; + + case Teleport_Line: + case Scroll_Texture_Model: ld->id = ld->args[0]; + break; + + case Polyobj_StartLine: + ld->id = ld->args[3]; + break; + + case Polyobj_ExplicitLine: + ld->id = ld->args[4]; + break; } } } diff --git a/src/po_man.cpp b/src/po_man.cpp index 33c1d5382..2846128eb 100644 --- a/src/po_man.cpp +++ b/src/po_man.cpp @@ -1260,9 +1260,6 @@ static void SpawnPolyobj (int index, int tag, int type) unsigned int ii; int i; int j; - int psIndex; - int psIndexOld; - seg_t *polySegList[PO_MAXPOLYSEGS]; for (ii = 0; ii < KnownPolySegs.Size(); ++ii) { @@ -1302,11 +1299,12 @@ static void SpawnPolyobj (int index, int tag, int type) } if (!polyobjs[index].segs) { // didn't find a polyobj through PO_LINE_START - psIndex = 0; + TArray polySegList; + unsigned int psIndexOld; polyobjs[index].numsegs = 0; for (j = 1; j < PO_MAXPOLYSEGS; j++) { - psIndexOld = psIndex; + psIndexOld = polySegList.Size(); for (ii = 0; ii < KnownPolySegs.Size(); ++ii) { i = KnownPolySegs[ii]; @@ -1322,13 +1320,8 @@ static void SpawnPolyobj (int index, int tag, int type) } if (segs[i].linedef->args[1] == j) { - polySegList[psIndex] = &segs[i]; + polySegList.Push (&segs[i]); polyobjs[index].numsegs++; - psIndex++; - if (psIndex > PO_MAXPOLYSEGS) - { - I_Error ("SpawnPolyobj: psIndex > PO_MAXPOLYSEGS\n"); - } } } } @@ -1347,7 +1340,7 @@ static void SpawnPolyobj (int index, int tag, int type) KnownPolySegs[ii] = -1; } } - if (psIndex == psIndexOld) + if (polySegList.Size() == psIndexOld) { // Check if an explicit line order has been skipped. // A line has been skipped if there are any more explicit // lines with the current tag value. [RH] Can this actually happen?