Purge uninformative comments

This commit is contained in:
MascaraSnake 2020-05-04 00:17:05 +02:00
parent 9fa267f247
commit 3d9bf8335e

View file

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