summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamuel Villareal2010-08-30 02:32:28 +0000
committerSamuel Villareal2010-08-30 02:32:28 +0000
commit543d06e80da825cb5630501035c479dc36e2a9df (patch)
tree0520beb5fc6e69a28414f76106289a760b4a9e60 /src
parent9563371e9ad296eded19008a26382ad311182dbc (diff)
downloadchocolate-doom-543d06e80da825cb5630501035c479dc36e2a9df.tar.gz
chocolate-doom-543d06e80da825cb5630501035c479dc36e2a9df.tar.bz2
chocolate-doom-543d06e80da825cb5630501035c479dc36e2a9df.zip
+ Implementation of line type 666 'P_MoveWall'
Subversion-branch: /branches/strife-branch Subversion-revision: 1974
Diffstat (limited to 'src')
-rw-r--r--src/strife/p_switch.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/strife/p_switch.c b/src/strife/p_switch.c
index 862e1598..b8d29e72 100644
--- a/src/strife/p_switch.c
+++ b/src/strife/p_switch.c
@@ -42,6 +42,7 @@
// State.
#include "doomstat.h"
#include "r_state.h"
+#include "m_bbox.h" // villsa [STRIFE]
//
@@ -264,7 +265,77 @@ P_ChangeSwitchTexture
}
}
+//
+// P_MoveWall
+//
+// villsa [STRIFE]
+// Dynamically move a solid line. Unused in Strife
+//
+static void P_MoveWall(line_t *line, mobj_t *thing)
+{
+ vertex_t *v2;
+ vertex_t *v1;
+ fixed_t x;
+ fixed_t y;
+
+ v1 = line->v1;
+ v2 = line->v2;
+ //S_StartSound(thing, sfx_stnmov); [STRIFE] TODO - add sound
+
+ if (line->dx)
+ {
+ if (thing->x >= v1->x)
+ {
+ v1->y -= (8 * FRACUNIT);
+ v2->y -= (8 * FRACUNIT);
+ }
+ else
+ {
+ v1->y += (8 * FRACUNIT);
+ v2->y += (8 * FRACUNIT);
+ }
+ }
+ else
+ {
+ if (thing->y >= v1->y)
+ {
+ v1->x -= (8 * FRACUNIT);
+ v2->x -= (8 * FRACUNIT);
+ }
+ else
+ {
+ v1->x += (8 * FRACUNIT);
+ v2->x += (8 * FRACUNIT);
+ }
+ }
+
+ if (v1->x >= v2->x)
+ {
+ line->bbox[BOXLEFT] = v2->x;
+ x = v1->x;
+ }
+ else
+ {
+ line->bbox[BOXLEFT] = v1->x;
+ x = v2->x;
+ }
+
+ line->bbox[BOXRIGHT] = x;
+
+ if (v1->y >= v2->y)
+ {
+ line->bbox[BOXBOTTOM] = v2->y;
+ y = v1->y;
+ }
+ else
+ {
+ line->bbox[BOXBOTTOM] = v1->y;
+ y = v2->y;
+ }
+
+ line->bbox[BOXTOP] = y;
+}
@@ -648,6 +719,11 @@ P_UseSpecialLine
EV_LightTurnOn(line,35);
P_ChangeSwitchTexture(line,1);
break;
+
+ case 666: // villsa [STRIFE]
+ // Move wall
+ P_MoveWall(line, thing);
+ break;
}