mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-21 02:11:19 +00:00
Purge uninformative comments
This commit is contained in:
parent
b82c3c2089
commit
8ae635c7ba
1 changed files with 4 additions and 147 deletions
151
src/p_polyobj.c
151
src/p_polyobj.c
|
@ -140,11 +140,6 @@ FUNCINLINE static ATTRINLINE void Polyobj_vecSub2(vertex_t *dst, vertex_t *v1, v
|
|||
dst->y = v1->y - v2->y;
|
||||
}
|
||||
|
||||
//
|
||||
// P_PointInsidePolyobj
|
||||
//
|
||||
// Returns TRUE if the XY point is inside the polyobject
|
||||
//
|
||||
boolean P_PointInsidePolyobj(polyobj_t *po, fixed_t x, fixed_t y)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -158,11 +153,6 @@ boolean P_PointInsidePolyobj(polyobj_t *po, fixed_t x, fixed_t y)
|
|||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// P_MobjTouchingPolyobj
|
||||
//
|
||||
// Returns TRUE if the mobj is touching the edge of a polyobject
|
||||
//
|
||||
boolean P_MobjTouchingPolyobj(polyobj_t *po, mobj_t *mo)
|
||||
{
|
||||
fixed_t mbbox[4];
|
||||
|
@ -182,11 +172,6 @@ boolean P_MobjTouchingPolyobj(polyobj_t *po, mobj_t *mo)
|
|||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// P_MobjInsidePolyobj
|
||||
//
|
||||
// Returns TRUE if the mobj is inside the polyobject
|
||||
//
|
||||
boolean P_MobjInsidePolyobj(polyobj_t *po, mobj_t *mo)
|
||||
{
|
||||
fixed_t mbbox[4];
|
||||
|
@ -206,11 +191,6 @@ boolean P_MobjInsidePolyobj(polyobj_t *po, mobj_t *mo)
|
|||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// P_BBoxInsidePolyobj
|
||||
//
|
||||
// Returns TRUE if the bbox is inside the polyobject
|
||||
//
|
||||
boolean P_BBoxInsidePolyobj(polyobj_t *po, fixed_t *bbox)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -224,12 +204,8 @@ boolean P_BBoxInsidePolyobj(polyobj_t *po, fixed_t *bbox)
|
|||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_GetInfo
|
||||
//
|
||||
// Finds the 'polyobject settings' linedef for a polyobject
|
||||
// the polyobject's id should be set as its tag
|
||||
//
|
||||
static void Polyobj_GetInfo(polyobj_t *po)
|
||||
{
|
||||
INT32 i = P_FindSpecialLineFromTag(POLYINFO_SPECIALNUM, po->id, -1);
|
||||
|
@ -266,15 +242,11 @@ static void Polyobj_GetInfo(polyobj_t *po)
|
|||
|
||||
// Reallocating array maintenance
|
||||
|
||||
//
|
||||
// Polyobj_addVertex
|
||||
//
|
||||
// Adds a vertex to a polyobject's reallocating vertex arrays, provided
|
||||
// that such a vertex isn't already in the array. Each vertex must only
|
||||
// be translated once during polyobject movement. Keeping track of them
|
||||
// this way results in much more clear and efficient code than what
|
||||
// Hexen used.
|
||||
//
|
||||
static void Polyobj_addVertex(polyobj_t *po, vertex_t *v)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -310,14 +282,10 @@ static void Polyobj_addVertex(polyobj_t *po, vertex_t *v)
|
|||
po->numVertices++;
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_addLine
|
||||
//
|
||||
// Adds a linedef to a polyobject's reallocating linedefs array, provided
|
||||
// that such a linedef isn't already in the array. Each linedef must only
|
||||
// be adjusted once during polyobject movement. Keeping track of them
|
||||
// this way provides the same benefits as for vertices.
|
||||
//
|
||||
static void Polyobj_addLine(polyobj_t *po, line_t *l)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -342,14 +310,10 @@ static void Polyobj_addLine(polyobj_t *po, line_t *l)
|
|||
po->lines[po->numLines++] = l;
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_addSeg
|
||||
//
|
||||
// Adds a single seg to a polyobject's reallocating seg pointer array.
|
||||
// Most polyobjects will have between 4 and 16 segs, so the array size
|
||||
// begins much smaller than usual. Calls Polyobj_addVertex and Polyobj_addLine
|
||||
// to add those respective structures for this seg, as well.
|
||||
//
|
||||
static void Polyobj_addSeg(polyobj_t *po, seg_t *seg)
|
||||
{
|
||||
if (po->segCount >= po->numSegsAlloc)
|
||||
|
@ -375,14 +339,10 @@ static void Polyobj_addSeg(polyobj_t *po, seg_t *seg)
|
|||
|
||||
// Seg-finding functions
|
||||
|
||||
//
|
||||
// Polyobj_findSegs
|
||||
//
|
||||
// This method adds segs to a polyobject by following segs from vertex to
|
||||
// vertex. The process stops when the original starting point is reached
|
||||
// or if a particular search ends unexpectedly (ie, the polyobject is not
|
||||
// closed).
|
||||
//
|
||||
static void Polyobj_findSegs(polyobj_t *po, seg_t *seg)
|
||||
{
|
||||
fixed_t startx, starty;
|
||||
|
@ -494,11 +454,6 @@ newseg:
|
|||
|
||||
// Setup functions
|
||||
|
||||
//
|
||||
// Polyobj_spawnPolyObj
|
||||
//
|
||||
// Sets up a Polyobject.
|
||||
//
|
||||
static void Polyobj_spawnPolyObj(INT32 num, mobj_t *spawnSpot, INT32 id)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -586,12 +541,8 @@ static void Polyobj_spawnPolyObj(INT32 num, mobj_t *spawnSpot, INT32 id)
|
|||
|
||||
static void Polyobj_attachToSubsec(polyobj_t *po);
|
||||
|
||||
//
|
||||
// Polyobj_moveToSpawnSpot
|
||||
//
|
||||
// Translates the polyobject's vertices with respect to the difference between
|
||||
// the anchor and spawn spots. Updates linedef bounding boxes as well.
|
||||
//
|
||||
static void Polyobj_moveToSpawnSpot(mapthing_t *anchor)
|
||||
{
|
||||
polyobj_t *po;
|
||||
|
@ -638,11 +589,7 @@ static void Polyobj_moveToSpawnSpot(mapthing_t *anchor)
|
|||
Polyobj_attachToSubsec(po);
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_attachToSubsec
|
||||
//
|
||||
// Attaches a polyobject to its appropriate subsector.
|
||||
//
|
||||
static void Polyobj_attachToSubsec(polyobj_t *po)
|
||||
{
|
||||
subsector_t *ss;
|
||||
|
@ -677,11 +624,7 @@ static void Polyobj_attachToSubsec(polyobj_t *po)
|
|||
po->attached = true;
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_removeFromSubsec
|
||||
//
|
||||
// Removes a polyobject from the subsector to which it is attached.
|
||||
//
|
||||
static void Polyobj_removeFromSubsec(polyobj_t *po)
|
||||
{
|
||||
if (po->attached)
|
||||
|
@ -693,11 +636,7 @@ static void Polyobj_removeFromSubsec(polyobj_t *po)
|
|||
|
||||
// Blockmap Functions
|
||||
|
||||
//
|
||||
// Polyobj_getLink
|
||||
//
|
||||
// Retrieves a polymaplink object from the free list or creates a new one.
|
||||
//
|
||||
static polymaplink_t *Polyobj_getLink(void)
|
||||
{
|
||||
polymaplink_t *l;
|
||||
|
@ -716,11 +655,7 @@ static polymaplink_t *Polyobj_getLink(void)
|
|||
return l;
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_putLink
|
||||
//
|
||||
// Puts a polymaplink object into the free list.
|
||||
//
|
||||
static void Polyobj_putLink(polymaplink_t *l)
|
||||
{
|
||||
memset(l, 0, sizeof(*l));
|
||||
|
@ -728,14 +663,10 @@ static void Polyobj_putLink(polymaplink_t *l)
|
|||
bmap_freelist = l;
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_linkToBlockmap
|
||||
//
|
||||
// Inserts a polyobject into the polyobject blockmap. Unlike, mobj_t's,
|
||||
// polyobjects need to be linked into every blockmap cell which their
|
||||
// bounding box intersects. This ensures the accurate level of clipping
|
||||
// which is present with linedefs but absent from most mobj interactions.
|
||||
//
|
||||
static void Polyobj_linkToBlockmap(polyobj_t *po)
|
||||
{
|
||||
fixed_t *blockbox = po->blockbox;
|
||||
|
@ -780,12 +711,8 @@ static void Polyobj_linkToBlockmap(polyobj_t *po)
|
|||
po->linked = true;
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_removeFromBlockmap
|
||||
//
|
||||
// Unlinks a polyobject from all blockmap cells it intersects and returns
|
||||
// its polymaplink objects to the free list.
|
||||
//
|
||||
static void Polyobj_removeFromBlockmap(polyobj_t *po)
|
||||
{
|
||||
polymaplink_t *rover;
|
||||
|
@ -824,13 +751,9 @@ static void Polyobj_removeFromBlockmap(polyobj_t *po)
|
|||
|
||||
// Movement functions
|
||||
|
||||
//
|
||||
// Polyobj_untouched
|
||||
//
|
||||
// A version of Lee's routine from p_maputl.c that accepts an mobj pointer
|
||||
// argument instead of using tmthing. Returns true if the line isn't contacted
|
||||
// and false otherwise.
|
||||
//
|
||||
static inline boolean Polyobj_untouched(line_t *ld, mobj_t *mo)
|
||||
{
|
||||
fixed_t x, y, ptmbbox[4];
|
||||
|
@ -843,13 +766,9 @@ static inline boolean Polyobj_untouched(line_t *ld, mobj_t *mo)
|
|||
P_BoxOnLineSide(ptmbbox, ld) != -1;
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_pushThing
|
||||
//
|
||||
// Inflicts thrust and possibly damage on a thing which has been found to be
|
||||
// blocking the motion of a polyobject. The default thrust amount is only one
|
||||
// unit, but the motion of the polyobject can be used to change this.
|
||||
//
|
||||
static void Polyobj_pushThing(polyobj_t *po, line_t *line, mobj_t *mo)
|
||||
{
|
||||
angle_t lineangle;
|
||||
|
@ -884,11 +803,7 @@ static void Polyobj_pushThing(polyobj_t *po, line_t *line, mobj_t *mo)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_slideThing
|
||||
//
|
||||
// Moves an object resting on top of a polyobject by (x, y). Template function to make alteration easier.
|
||||
//
|
||||
static void Polyobj_slideThing(mobj_t *mo, fixed_t dx, fixed_t dy)
|
||||
{
|
||||
if (mo->player) { // Finally this doesn't suck eggs -fickle
|
||||
|
@ -936,11 +851,7 @@ static void Polyobj_slideThing(mobj_t *mo, fixed_t dx, fixed_t dy)
|
|||
P_TryMove(mo, mo->x+dx, mo->y+dy, true);
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_carryThings
|
||||
//
|
||||
// Causes objects resting on top of the polyobject to 'ride' with its movement.
|
||||
//
|
||||
static void Polyobj_carryThings(polyobj_t *po, fixed_t dx, fixed_t dy)
|
||||
{
|
||||
static INT32 pomovecount = 0;
|
||||
|
@ -992,12 +903,8 @@ static void Polyobj_carryThings(polyobj_t *po, fixed_t dx, fixed_t dy)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_clipThings
|
||||
//
|
||||
// Checks for things that are in the way of a polyobject line move.
|
||||
// Returns true if something was hit.
|
||||
//
|
||||
static INT32 Polyobj_clipThings(polyobj_t *po, line_t *line)
|
||||
{
|
||||
INT32 hitflags = 0;
|
||||
|
@ -1059,11 +966,8 @@ static INT32 Polyobj_clipThings(polyobj_t *po, line_t *line)
|
|||
return hitflags;
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_moveXY
|
||||
//
|
||||
|
||||
// Moves a polyobject on the x-y plane.
|
||||
//
|
||||
static boolean Polyobj_moveXY(polyobj_t *po, fixed_t x, fixed_t y, boolean checkmobjs)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -1119,14 +1023,10 @@ static boolean Polyobj_moveXY(polyobj_t *po, fixed_t x, fixed_t y, boolean check
|
|||
return !(hitflags & 2);
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_rotatePoint
|
||||
//
|
||||
// Rotates a point and then translates it relative to point c.
|
||||
// The formula for this can be found here:
|
||||
// http://www.inversereality.org/tutorials/graphics%20programming/2dtransformations.html
|
||||
// It is, of course, just a vector-matrix multiplication.
|
||||
//
|
||||
static inline void Polyobj_rotatePoint(vertex_t *v, const vertex_t *c, angle_t ang)
|
||||
{
|
||||
vertex_t tmp = *v;
|
||||
|
@ -1138,12 +1038,8 @@ static inline void Polyobj_rotatePoint(vertex_t *v, const vertex_t *c, angle_t a
|
|||
v->y += c->y;
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_rotateLine
|
||||
//
|
||||
// Taken from P_LoadLineDefs; simply updates the linedef's dx, dy, slopetype,
|
||||
// and bounding box to be consistent with its vertices.
|
||||
//
|
||||
static void Polyobj_rotateLine(line_t *ld)
|
||||
{
|
||||
vertex_t *v1, *v2;
|
||||
|
@ -1183,11 +1079,7 @@ static void Polyobj_rotateLine(line_t *ld)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_rotateThings
|
||||
//
|
||||
// Causes objects resting on top of the rotating polyobject to 'ride' with its movement.
|
||||
//
|
||||
static void Polyobj_rotateThings(polyobj_t *po, vertex_t origin, angle_t delta, UINT8 turnthings)
|
||||
{
|
||||
static INT32 pomovecount = 10000;
|
||||
|
@ -1263,11 +1155,7 @@ static void Polyobj_rotateThings(polyobj_t *po, vertex_t origin, angle_t delta,
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_rotate
|
||||
//
|
||||
// Rotates a polyobject around its start point.
|
||||
//
|
||||
static boolean Polyobj_rotate(polyobj_t *po, angle_t delta, UINT8 turnthings, boolean checkmobjs)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -1341,12 +1229,8 @@ static boolean Polyobj_rotate(polyobj_t *po, angle_t delta, UINT8 turnthings, bo
|
|||
// Global Functions
|
||||
//
|
||||
|
||||
//
|
||||
// Polyobj_GetForNum
|
||||
//
|
||||
// Retrieves a polyobject by its numeric id using hashing.
|
||||
// Returns NULL if no such polyobject exists.
|
||||
//
|
||||
polyobj_t *Polyobj_GetForNum(INT32 id)
|
||||
{
|
||||
INT32 curidx = PolyObjects[id % numPolyObjects].first;
|
||||
|
@ -1357,12 +1241,9 @@ polyobj_t *Polyobj_GetForNum(INT32 id)
|
|||
return curidx == numPolyObjects ? NULL : &PolyObjects[curidx];
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_GetParent
|
||||
//
|
||||
|
||||
// Retrieves the parenting polyobject if one exists. Returns NULL
|
||||
// otherwise.
|
||||
//
|
||||
#if 0 //unused function
|
||||
static polyobj_t *Polyobj_GetParent(polyobj_t *po)
|
||||
{
|
||||
|
@ -1370,12 +1251,8 @@ static polyobj_t *Polyobj_GetParent(polyobj_t *po)
|
|||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Polyobj_GetChild
|
||||
//
|
||||
// Iteratively retrieves the children POs of a parent,
|
||||
// sorta like P_FindSectorSpecialFromTag.
|
||||
//
|
||||
static polyobj_t *Polyobj_GetChild(polyobj_t *po, INT32 *start)
|
||||
{
|
||||
for (; *start < numPolyObjects; (*start)++)
|
||||
|
@ -1394,12 +1271,8 @@ typedef struct mobjqitem_s
|
|||
mobj_t *mo;
|
||||
} mobjqitem_t;
|
||||
|
||||
//
|
||||
// Polyobj_InitLevel
|
||||
//
|
||||
// Called at the beginning of each map after all other line and thing
|
||||
// processing is finished.
|
||||
//
|
||||
void Polyobj_InitLevel(void)
|
||||
{
|
||||
thinker_t *th;
|
||||
|
@ -1518,9 +1391,6 @@ void Polyobj_InitLevel(void)
|
|||
M_QueueFree(&anchorqueue);
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_MoveOnLoad
|
||||
//
|
||||
// Called when a savegame is being loaded. Rotates and translates an
|
||||
// existing polyobject to its position when the game was saved.
|
||||
//
|
||||
|
@ -1545,11 +1415,7 @@ void Polyobj_MoveOnLoad(polyobj_t *po, angle_t angle, fixed_t x, fixed_t y)
|
|||
|
||||
// Thinker Functions
|
||||
|
||||
//
|
||||
// T_PolyObjRotate
|
||||
//
|
||||
// Thinker function for PolyObject rotation.
|
||||
//
|
||||
void T_PolyObjRotate(polyrotate_t *th)
|
||||
{
|
||||
polyobj_t *po = Polyobj_GetForNum(th->polyObjNum);
|
||||
|
@ -1610,11 +1476,7 @@ void T_PolyObjRotate(polyrotate_t *th)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Polyobj_componentSpeed
|
||||
//
|
||||
// Calculates the speed components from the desired resultant velocity.
|
||||
//
|
||||
FUNCINLINE static ATTRINLINE void Polyobj_componentSpeed(INT32 resVel, INT32 angle,
|
||||
fixed_t *xVel, fixed_t *yVel)
|
||||
{
|
||||
|
@ -1695,11 +1557,6 @@ void T_PolyObjMove(polymove_t *th)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// T_PolyObjWaypoint
|
||||
//
|
||||
// Kinda like 'Zoom Tubes for PolyObjects'
|
||||
//
|
||||
void T_PolyObjWaypoint(polywaypoint_t *th)
|
||||
{
|
||||
mobj_t *mo2;
|
||||
|
@ -2193,7 +2050,7 @@ void T_PolyDoorSwing(polyswingdoor_t *th)
|
|||
}
|
||||
}
|
||||
|
||||
// T_PolyObjDisplace: shift a polyobject based on a control sector's heights.
|
||||
// Shift a polyobject based on a control sector's heights.
|
||||
void T_PolyObjDisplace(polydisplace_t *th)
|
||||
{
|
||||
polyobj_t *po = Polyobj_GetForNum(th->polyObjNum);
|
||||
|
@ -2233,7 +2090,7 @@ void T_PolyObjDisplace(polydisplace_t *th)
|
|||
th->oldHeights = newheights;
|
||||
}
|
||||
|
||||
// T_PolyObjRotDisplace: rotate a polyobject based on a control sector's heights.
|
||||
// Rotate a polyobject based on a control sector's heights.
|
||||
void T_PolyObjRotDisplace(polyrotdisplace_t *th)
|
||||
{
|
||||
polyobj_t *po = Polyobj_GetForNum(th->polyObjNum);
|
||||
|
|
Loading…
Reference in a new issue