From 8e550cd423e622995f5d416bb73aa857edda98ca Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 5 May 2020 21:34:10 +0200 Subject: [PATCH] Adapt setup of polyobject door actions --- extras/conf/udb/Includes/SRB222_linedefs.cfg | 51 ++++++++++++++++++++ src/p_setup.c | 7 +++ src/p_spec.c | 24 +++------ 3 files changed, 66 insertions(+), 16 deletions(-) diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index 513325225..b534f52de 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -1739,6 +1739,57 @@ udmf } } + linedefexecpoly + { + title = "Linedef Executor (polyobject)"; + + 480 + { + title = "Door Slide"; + prefix = "(480)"; + arg0 + { + title = "PolyObject ID"; + type = 14; + } + arg1 + { + title = "Speed"; + } + arg2 + { + title = "Distance"; + } + arg3 + { + title = "Return delay"; + } + } + 481 + { + title = "Door Swing"; + prefix = "(481)"; + arg0 + { + title = "PolyObject ID"; + type = 14; + } + arg1 + { + title = "Speed"; + } + arg2 + { + title = "Angle"; + type = 8; + } + arg3 + { + title = "Return delay"; + } + } + + light { 606 diff --git a/src/p_setup.c b/src/p_setup.c index 4ff9e6117..f814f0948 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2917,6 +2917,13 @@ static void P_ConvertBinaryMap(void) case 456: //Stop fading colormap lines[i].args[0] = lines[i].tag; break; + case 480: // PolyObject: Door slide + case 481: // PolyObject: Door swing + lines[i].args[0] = lines[i].tag; + lines[i].args[1] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS; + lines[i].args[2] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS; + lines[i].args[3] = (lines[i].sidenum[1] == 0xffff) ? 0 : (sides[lines[i].sidenum[1]].textureoffset >> FRACBITS); + break; case 606: //Colormap lines[i].args[0] = lines[i].tag; break; diff --git a/src/p_spec.c b/src/p_spec.c index e54a1d694..59821b684 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1079,33 +1079,25 @@ static boolean PolyDoor(line_t *line) { polydoordata_t pdd; - pdd.polyObjNum = line->tag; // polyobject id + pdd.polyObjNum = line->args[0]; // polyobject id switch(line->special) { case 480: // Polyobj_DoorSlide pdd.doorType = POLY_DOOR_SLIDE; - pdd.speed = sides[line->sidenum[0]].textureoffset / 8; + pdd.speed = line->args[1] << (FRACBITS - 3); pdd.angle = R_PointToAngle2(line->v1->x, line->v1->y, line->v2->x, line->v2->y); // angle of motion - pdd.distance = sides[line->sidenum[0]].rowoffset; - - if (line->sidenum[1] != 0xffff) - pdd.delay = sides[line->sidenum[1]].textureoffset >> FRACBITS; // delay in tics - else - pdd.delay = 0; + pdd.distance = line->args[2] << FRACBITS; + pdd.delay = line->args[3]; // delay in tics break; case 481: // Polyobj_DoorSwing pdd.doorType = POLY_DOOR_SWING; - pdd.speed = sides[line->sidenum[0]].textureoffset >> FRACBITS; // angular speed - pdd.distance = sides[line->sidenum[0]].rowoffset >> FRACBITS; // angular distance - - if (line->sidenum[1] != 0xffff) - pdd.delay = sides[line->sidenum[1]].textureoffset >> FRACBITS; // delay in tics - else - pdd.delay = 0; + pdd.speed = line->args[1]; // angular speed + pdd.distance = line->args[2]; // angular distance + pdd.delay = line->args[3]; // delay in tics break; default: - return 0; // ??? + return false; // ??? } return EV_DoPolyDoor(&pdd);