diff --git a/src/p_map.c b/src/p_map.c index 2321cd96..5706e6d3 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1294,10 +1294,10 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) // based on their origin point, and can overlap // into adjacent blocks by up to MAXRADIUS units. - xl = (tmbbox[BOXLEFT] - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT; - xh = (tmbbox[BOXRIGHT] - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT; - yl = (tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT; - yh = (tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT; + xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT; + xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT; + yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT; + yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT; #ifdef POLYOBJECTS // Check polyobjects and see if tmfloorz/tmceilingz need to be altered @@ -1511,10 +1511,10 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam) // based on their origin point, and can overlap // into adjacent blocks by up to MAXRADIUS units. - xl = (tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; - xh = (tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; - yl = (tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; - yh = (tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; + xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; + xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; + yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; + yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; #ifdef POLYOBJECTS // Check polyobjects and see if tmfloorz/tmceilingz need to be altered @@ -1938,10 +1938,10 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) { INT32 bx, by, xl, xh, yl, yh; - yh = (thing->y + MAXRADIUS - bmaporgy)>>MAPBLOCKSHIFT; - yl = (thing->y - MAXRADIUS - bmaporgy)>>MAPBLOCKSHIFT; - xh = (thing->x + MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT; - xl = (thing->x - MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT; + yh = (unsigned)(thing->y + MAXRADIUS - bmaporgy)>>MAPBLOCKSHIFT; + yl = (unsigned)(thing->y - MAXRADIUS - bmaporgy)>>MAPBLOCKSHIFT; + xh = (unsigned)(thing->x + MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT; + xl = (unsigned)(thing->x - MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT; stand = thing; standx = x; @@ -3024,10 +3024,10 @@ void P_RadiusAttack(mobj_t *spot, mobj_t *source, fixed_t damagedist) fixed_t dist; dist = FixedMul(damagedist, spot->scale) + MAXRADIUS; - yh = (spot->y + dist - bmaporgy)>>MAPBLOCKSHIFT; - yl = (spot->y - dist - bmaporgy)>>MAPBLOCKSHIFT; - xh = (spot->x + dist - bmaporgx)>>MAPBLOCKSHIFT; - xl = (spot->x - dist - bmaporgx)>>MAPBLOCKSHIFT; + yh = (unsigned)(spot->y + dist - bmaporgy)>>MAPBLOCKSHIFT; + yl = (unsigned)(spot->y - dist - bmaporgy)>>MAPBLOCKSHIFT; + xh = (unsigned)(spot->x + dist - bmaporgx)>>MAPBLOCKSHIFT; + xl = (unsigned)(spot->x - dist - bmaporgx)>>MAPBLOCKSHIFT; bombspot = spot; bombsource = source; @@ -3645,10 +3645,10 @@ void P_CreateSecNodeList(mobj_t *thing, fixed_t x, fixed_t y) validcount++; // used to make sure we only process a line once - xl = (tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; - xh = (tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; - yl = (tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; - yh = (tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; + xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; + xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; + yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; + yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; for (bx = xl; bx <= xh; bx++) for (by = yl; by <= yh; by++) @@ -3722,10 +3722,10 @@ void P_CreatePrecipSecNodeList(precipmobj_t *thing,fixed_t x,fixed_t y) validcount++; // used to make sure we only process a line once - xl = (preciptmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; - xh = (preciptmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; - yl = (preciptmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; - yh = (preciptmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; + xl = (unsigned)(preciptmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; + xh = (unsigned)(preciptmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; + yl = (unsigned)(preciptmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; + yh = (unsigned)(preciptmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; for (bx = xl; bx <= xh; bx++) for (by = yl; by <= yh; by++) diff --git a/src/p_maputl.c b/src/p_maputl.c index c8bf420e..a65d2fa7 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -814,8 +814,8 @@ void P_SetThingPosition(mobj_t *thing) if (!(thing->flags & MF_NOBLOCKMAP)) { // inert things don't need to be in blockmap - const INT32 blockx = (thing->x - bmaporgx)>>MAPBLOCKSHIFT; - const INT32 blocky = (thing->y - bmaporgy)>>MAPBLOCKSHIFT; + const INT32 blockx = (unsigned)(thing->x - bmaporgx)>>MAPBLOCKSHIFT; + const INT32 blocky = (unsigned)(thing->y - bmaporgy)>>MAPBLOCKSHIFT; if (blockx >= 0 && blockx < bmapwidth && blocky >= 0 && blocky < bmapheight) { @@ -1317,10 +1317,10 @@ boolean P_RadiusLinesCheck(fixed_t radius, fixed_t x, fixed_t y, tmbbox[BOXLEFT] = x - radius; // check lines - xl = (tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; - xh = (tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; - yl = (tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; - yh = (tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; + xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; + xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; + yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; + yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; for (bx = xl; bx <= xh; bx++) for (by = yl; by <= yh; by++) diff --git a/src/p_polyobj.c b/src/p_polyobj.c index bec59ae2..9c955c97 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -851,10 +851,10 @@ static void Polyobj_linkToBlockmap(polyobj_t *po) M_AddToBox(blockbox, po->vertices[i]->x, po->vertices[i]->y); // adjust bounding box relative to blockmap - blockbox[BOXRIGHT] = (blockbox[BOXRIGHT] - bmaporgx) >> MAPBLOCKSHIFT; - blockbox[BOXLEFT] = (blockbox[BOXLEFT] - bmaporgx) >> MAPBLOCKSHIFT; - blockbox[BOXTOP] = (blockbox[BOXTOP] - bmaporgy) >> MAPBLOCKSHIFT; - blockbox[BOXBOTTOM] = (blockbox[BOXBOTTOM] - bmaporgy) >> MAPBLOCKSHIFT; + blockbox[BOXRIGHT] = (unsigned)(blockbox[BOXRIGHT] - bmaporgx) >> MAPBLOCKSHIFT; + blockbox[BOXLEFT] = (unsigned)(blockbox[BOXLEFT] - bmaporgx) >> MAPBLOCKSHIFT; + blockbox[BOXTOP] = (unsigned)(blockbox[BOXTOP] - bmaporgy) >> MAPBLOCKSHIFT; + blockbox[BOXBOTTOM] = (unsigned)(blockbox[BOXBOTTOM] - bmaporgy) >> MAPBLOCKSHIFT; // link polyobject to every block its bounding box intersects for (y = blockbox[BOXBOTTOM]; y <= blockbox[BOXTOP]; ++y) @@ -1081,10 +1081,10 @@ static INT32 Polyobj_clipThings(polyobj_t *po, line_t *line) return hitflags; // adjust linedef bounding box to blockmap, extend by MAXRADIUS - linebox[BOXLEFT] = (line->bbox[BOXLEFT] - bmaporgx - MAXRADIUS) >> MAPBLOCKSHIFT; - linebox[BOXRIGHT] = (line->bbox[BOXRIGHT] - bmaporgx + MAXRADIUS) >> MAPBLOCKSHIFT; - linebox[BOXBOTTOM] = (line->bbox[BOXBOTTOM] - bmaporgy - MAXRADIUS) >> MAPBLOCKSHIFT; - linebox[BOXTOP] = (line->bbox[BOXTOP] - bmaporgy + MAXRADIUS) >> MAPBLOCKSHIFT; + linebox[BOXLEFT] = (unsigned)(line->bbox[BOXLEFT] - bmaporgx - MAXRADIUS) >> MAPBLOCKSHIFT; + linebox[BOXRIGHT] = (unsigned)(line->bbox[BOXRIGHT] - bmaporgx + MAXRADIUS) >> MAPBLOCKSHIFT; + linebox[BOXBOTTOM] = (unsigned)(line->bbox[BOXBOTTOM] - bmaporgy - MAXRADIUS) >> MAPBLOCKSHIFT; + linebox[BOXTOP] = (unsigned)(line->bbox[BOXTOP] - bmaporgy + MAXRADIUS) >> MAPBLOCKSHIFT; // check all mobj blockmap cells the line contacts for (y = linebox[BOXBOTTOM]; y <= linebox[BOXTOP]; ++y) diff --git a/src/p_spec.c b/src/p_spec.c index 96ecf83b..68060628 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7401,10 +7401,10 @@ void T_Pusher(pusher_t *p) tmbbox[BOXRIGHT] = p->x + radius; tmbbox[BOXLEFT] = p->x - radius; - xl = (tmbbox[BOXLEFT] - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT; - xh = (tmbbox[BOXRIGHT] - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT; - yl = (tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT; - yh = (tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT; + xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT; + xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT; + yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT; + yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT; for (bx = xl; bx <= xh; bx++) for (by = yl; by <= yh; by++) P_BlockThingsIterator(bx,by, PIT_PushThing); diff --git a/src/p_user.c b/src/p_user.c index 54361e5b..6270d789 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2958,10 +2958,10 @@ static void P_DoTeeter(player_t *player) { INT32 bx, by, xl, xh, yl, yh; - yh = (player->mo->y + player->mo->radius - bmaporgy)>>MAPBLOCKSHIFT; - yl = (player->mo->y - player->mo->radius - bmaporgy)>>MAPBLOCKSHIFT; - xh = (player->mo->x + player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT; - xl = (player->mo->x - player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT; + yh = (unsigned)(player->mo->y + player->mo->radius - bmaporgy)>>MAPBLOCKSHIFT; + yl = (unsigned)(player->mo->y - player->mo->radius - bmaporgy)>>MAPBLOCKSHIFT; + xh = (unsigned)(player->mo->x + player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT; + xl = (unsigned)(player->mo->x - player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT; // Polyobjects #ifdef POLYOBJECTS @@ -8094,10 +8094,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall INT32 xl, xh, yl, yh, bx, by; validcount++; - xl = (tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; - xh = (tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; - yl = (tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; - yh = (tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; + xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; + xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; + yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; + yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; for (by = yl; by <= yh; by++) for (bx = xl; bx <= xh; bx++)