Linedef Types 21 and 30

Status
Not open for further replies.

Fawfulfan

The Tortured Planet guy
I'm really curious as to what all of these linedefs do:

Linedef Type 21: PolyObject - Explicitly Include Line
Linedef Type 30: PolyObject - Waving Flag

Obviously, it's something to do with PolyObjects...but what?
 
I started looking at it and wrote what I know about it on the wiki, but I haven't found out much yet, especially not how it actually makes CEZ's flags wave. Just look at map11 in SRB2DB, it doesn't seem all too complicated.
 
I'm still puzzled at what the "Explicitly Include Line" effect does. Maybe someone could look it up in the source code. (My knowledge of coding is pretty basic, so that someone can't be me).
 
You don't need to know any coding language to grasp the basics of linedef specials in the source code. In most cases, it's rather easy to decipher. My main problem is that I don't quite know where to look for this. It's probably defined in "p_polyobj.c", but where?

EDIT: Uhh, guess I found it:

//
// Polyobj_findExplicit
//
// Searches for segs to put into a polyobject in an explicitly provided order.
//
static void Polyobj_findExplicit(polyobj_t *po)
{
// temporary dynamic seg array
segitem_t *segitems = NULL;
size_t numSegItems = 0;
size_t numSegItemsAlloc = 0;

size_t i;

// first loop: save off all segs with polyobject's id number
for (i = 0; i < numsegs; ++i)
{
int polyID, parentID;

if (segs.linedef->special != POLYOBJ_EXPLICIT_LINE)
continue;

Polyobj_GetInfo(segs.linedef->tag, &polyID, &parentID, NULL);

if (polyID == po->id && parentID > 0)
{
if (numSegItems >= numSegItemsAlloc)
{
numSegItemsAlloc = numSegItemsAlloc ? numSegItemsAlloc*2 : 4;
segitems = realloc(segitems, numSegItemsAlloc*sizeof(segitem_t));
}
segitems[numSegItems].seg = &segs;
segitems[numSegItems].num = parentID;
++numSegItems;
}
}

// make sure array isn't empty
if (numSegItems == 0)
{
po->isBad = true;
CONS_Printf("polyobject %d is empty\n", po->id);
return;
}

// sort the array if necessary
if (numSegItems >= 2)
qsort(segitems, numSegItems, sizeof(segitem_t), Polyobj_segCompare);

// second loop: put the sorted segs into the polyobject
for (i = 0; i < numSegItems; ++i)
Polyobj_addSeg(po, segitems.seg);

// free the temporary array
free(segitems);
}
I haven't yet taken a look at it, but if someone can decipher this, it would be appreciated.
 
Last edited:
Easy. See ZDoom/Hexen's documentation on the Explicit Polyobj line.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top