engine.c: amend r4292, which introduced an even worse oob for NPOT xsize texs.

git-svn-id: https://svn.eduke32.com/eduke32@4293 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2014-02-02 15:56:09 +00:00
parent 546a112741
commit c85feff063
1 changed files with 3 additions and 1 deletions

View File

@ -2751,7 +2751,7 @@ static WSHELPER_DECL void calc_bufplc(intptr_t *bufplc, int32_t lw, int32_t tsiz
// if (i >= tsizx)
{
if (tsizx < 0)
i = (uint32_t)i % tsizx;
i = (uint32_t)i % -tsizx;
else
i &= tsizx;
}
@ -2761,6 +2761,8 @@ static WSHELPER_DECL void calc_bufplc(intptr_t *bufplc, int32_t lw, int32_t tsiz
else
i <<= tsizy;
// Bassert(i >= 0 && i < tilesizx[globalpicnum]*tilesizy[globalpicnum]);
// Address is at the first row of tile storage (which is column-major).
*bufplc = waloff[globalpicnum] + i;
}