Fix the west/south blockmap issue without fucking up huge maps
This commit is contained in:
parent
09345ce929
commit
d2c74e1b13
|
@ -38,6 +38,9 @@
|
||||||
#define MAPBMASK (MAPBLOCKSIZE-1)
|
#define MAPBMASK (MAPBLOCKSIZE-1)
|
||||||
#define MAPBTOFRAC (MAPBLOCKSHIFT-FRACBITS)
|
#define MAPBTOFRAC (MAPBLOCKSHIFT-FRACBITS)
|
||||||
|
|
||||||
|
// Convenience macro to fix issue with collision along bottom/left edges of blockmap -Red
|
||||||
|
#define BMBOUNDFIX(xl, xh, yl, yh) {if (xl > xh) xl = 0; if (yl > yh) yl = 0;}
|
||||||
|
|
||||||
// player radius used only in am_map.c
|
// player radius used only in am_map.c
|
||||||
#define PLAYERRADIUS (16*FRACUNIT)
|
#define PLAYERRADIUS (16*FRACUNIT)
|
||||||
|
|
||||||
|
|
12
src/p_map.c
12
src/p_map.c
|
@ -1299,6 +1299,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
||||||
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT;
|
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT;
|
||||||
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT;
|
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT;
|
||||||
|
|
||||||
|
BMBOUNDFIX(xl, xh, yl, yh);
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
#ifdef POLYOBJECTS
|
||||||
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
|
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
|
||||||
{
|
{
|
||||||
|
@ -1516,6 +1518,8 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||||
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
|
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||||
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
|
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||||
|
|
||||||
|
BMBOUNDFIX(xl, xh, yl, yh);
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
#ifdef POLYOBJECTS
|
||||||
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
|
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
|
||||||
{
|
{
|
||||||
|
@ -1943,6 +1947,8 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||||
xh = (unsigned)(thing->x + MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT;
|
xh = (unsigned)(thing->x + MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT;
|
||||||
xl = (unsigned)(thing->x - MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT;
|
xl = (unsigned)(thing->x - MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT;
|
||||||
|
|
||||||
|
BMBOUNDFIX(xl, xh, yl, yh);
|
||||||
|
|
||||||
stand = thing;
|
stand = thing;
|
||||||
standx = x;
|
standx = x;
|
||||||
standy = y;
|
standy = y;
|
||||||
|
@ -3029,6 +3035,8 @@ void P_RadiusAttack(mobj_t *spot, mobj_t *source, fixed_t damagedist)
|
||||||
xh = (unsigned)(spot->x + dist - bmaporgx)>>MAPBLOCKSHIFT;
|
xh = (unsigned)(spot->x + dist - bmaporgx)>>MAPBLOCKSHIFT;
|
||||||
xl = (unsigned)(spot->x - dist - bmaporgx)>>MAPBLOCKSHIFT;
|
xl = (unsigned)(spot->x - dist - bmaporgx)>>MAPBLOCKSHIFT;
|
||||||
|
|
||||||
|
BMBOUNDFIX(xl, xh, yl, yh);
|
||||||
|
|
||||||
bombspot = spot;
|
bombspot = spot;
|
||||||
bombsource = source;
|
bombsource = source;
|
||||||
bombdamage = FixedMul(damagedist, spot->scale);
|
bombdamage = FixedMul(damagedist, spot->scale);
|
||||||
|
@ -3650,6 +3658,8 @@ void P_CreateSecNodeList(mobj_t *thing, fixed_t x, fixed_t y)
|
||||||
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
|
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||||
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
|
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||||
|
|
||||||
|
BMBOUNDFIX(xl, xh, yl, yh);
|
||||||
|
|
||||||
for (bx = xl; bx <= xh; bx++)
|
for (bx = xl; bx <= xh; bx++)
|
||||||
for (by = yl; by <= yh; by++)
|
for (by = yl; by <= yh; by++)
|
||||||
P_BlockLinesIterator(bx, by, PIT_GetSectors);
|
P_BlockLinesIterator(bx, by, PIT_GetSectors);
|
||||||
|
@ -3727,6 +3737,8 @@ void P_CreatePrecipSecNodeList(precipmobj_t *thing,fixed_t x,fixed_t y)
|
||||||
yl = (unsigned)(preciptmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
|
yl = (unsigned)(preciptmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||||
yh = (unsigned)(preciptmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
|
yh = (unsigned)(preciptmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||||
|
|
||||||
|
BMBOUNDFIX(xl, xh, yl, yh);
|
||||||
|
|
||||||
for (bx = xl; bx <= xh; bx++)
|
for (bx = xl; bx <= xh; bx++)
|
||||||
for (by = yl; by <= yh; by++)
|
for (by = yl; by <= yh; by++)
|
||||||
P_BlockLinesIterator(bx, by, PIT_GetPrecipSectors);
|
P_BlockLinesIterator(bx, by, PIT_GetPrecipSectors);
|
||||||
|
|
|
@ -2963,6 +2963,8 @@ static void P_DoTeeter(player_t *player)
|
||||||
xh = (unsigned)(player->mo->x + player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT;
|
xh = (unsigned)(player->mo->x + player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT;
|
||||||
xl = (unsigned)(player->mo->x - player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT;
|
xl = (unsigned)(player->mo->x - player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT;
|
||||||
|
|
||||||
|
BMBOUNDFIX(xl, xh, yl, yh);
|
||||||
|
|
||||||
// Polyobjects
|
// Polyobjects
|
||||||
#ifdef POLYOBJECTS
|
#ifdef POLYOBJECTS
|
||||||
validcount++;
|
validcount++;
|
||||||
|
@ -8099,6 +8101,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
|
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||||
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
|
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||||
|
|
||||||
|
BMBOUNDFIX(xl, xh, yl, yh);
|
||||||
|
|
||||||
for (by = yl; by <= yh; by++)
|
for (by = yl; by <= yh; by++)
|
||||||
for (bx = xl; bx <= xh; bx++)
|
for (bx = xl; bx <= xh; bx++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue