Revert "LUT for bmapwidth imul instructions."

This reverts commit e45a7f911f0d156b7cc38675bec1a14a2080c367.
This commit is contained in:
Alug committed 2024-03-13 08:35:30 +01:00
1 parent d88cc3251f
commit 360df11aa6
3 files changed
+3 -30

No files matched your search

-1
View File
@@ -386,7 +386,6 @@ extern INT32 bmapheight; // in mapblocks
extern fixed_t bmaporgx;
extern fixed_t bmaporgy; // origin of block map
extern mobj_t **blocklinks; // for thing chains
extern int *bmapwidthmuls; // LUT bmapwidth muls
//
// P_INTER
+3 -3
View File
@@ -824,7 +824,7 @@ void P_SetThingPosition(mobj_t *thing)
// pointer-to-pointer prev pointers --
// allows head nodes to be treated like everything else
mobj_t **link = &blocklinks[bmapwidthmuls[blocky] + blockx];
mobj_t **link = &blocklinks[blocky*bmapwidth + blockx];
mobj_t *bnext = *link;
if ((thing->bnext = bnext) != NULL)
bnext->bprev = &thing->bnext;
@@ -928,7 +928,7 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
return true;
offset = bmapwidthmuls[y] + x;
offset = y*bmapwidth + x;
// haleyjd 02/22/06: consider polyobject lines
plink = polyblocklinks[offset];
@@ -984,7 +984,7 @@ boolean P_BlockThingsIterator(INT32 x, INT32 y, boolean (*func)(mobj_t *))
return true;
// Check interaction with the objects in the blockmap.
for (mobj = blocklinks[bmapwidthmuls[y] + x]; mobj; mobj = bnext)
for (mobj = blocklinks[y*bmapwidth + x]; mobj; mobj = bnext)
{
P_SetTarget(&bnext, mobj->bnext); // We want to note our reference to bnext here incase it is MF_NOTHINK and gets removed!
if (!func(mobj))
-26
View File
@@ -127,8 +127,6 @@ INT32 *blockmaplump; // Big blockmap
fixed_t bmaporgx, bmaporgy;
// for thing chains
mobj_t **blocklinks;
// LUT bmapwidth muls
int *bmapwidthmuls;
// REJECT
// For fast sight rejection.
@@ -1945,14 +1943,6 @@ static void P_CreateBlockMap(void)
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
blockmap = blockmaplump + 4;
// LUT bmapwidth muls
count = sizeof(int) * bmapheight;
bmapwidthmuls = Z_Calloc(count, PU_LEVEL, NULL);
for (int f = 0; f < bmapheight; f++){
bmapwidthmuls[f] = f * bmapwidth;
}
// haleyjd 2/22/06: setup polyobject blockmap
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
@@ -2027,14 +2017,6 @@ static boolean P_LoadBlockMap(lumpnum_t lumpnum)
count = sizeof (*blocklinks)* bmapwidth*bmapheight;
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
blockmap = blockmaplump+4;
// LUT bmapwidth muls
count = sizeof(int) * bmapheight;
bmapwidthmuls = Z_Calloc(count, PU_LEVEL, NULL);
for (int i = 0; i < bmapheight; i++){
bmapwidthmuls[i] = i * bmapwidth;
}
// haleyjd 2/22/06: setup polyobject blockmap
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
@@ -2099,14 +2081,6 @@ static boolean P_LoadRawBlockMap(UINT8 *data, size_t count, const char *lumpname
count = sizeof (*blocklinks)* bmapwidth*bmapheight;
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
blockmap = blockmaplump+4;
// LUT bmapwidth muls
count = sizeof(int) * bmapheight;
bmapwidthmuls = Z_Calloc(count, PU_LEVEL, NULL);
for (int i = 0; i < bmapheight; i++){
bmapwidthmuls[i] = i * bmapwidth;
}
// haleyjd 2/22/06: setup polyobject blockmap
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;