Enable TROR code and rotated wall cstat bit for blood

This commit is contained in:
nukeykt 2019-06-26 22:20:03 +09:00 committed by Christoph Oelckers
parent d7865bfab4
commit 388bf2665f
5 changed files with 22 additions and 27 deletions

View file

@ -4654,7 +4654,7 @@ void MoveDude(spritetype *pSprite)
{
short bakCstat = pSprite->cstat;
pSprite->cstat &= ~257;
gSpriteHit[nXSprite].hit = ClipMove((int*)&pSprite->x, (int*)&pSprite->y, (int*)&pSprite->z, &nSector, xvel[nSprite]>>12, yvel[nSprite]>>12, wd, tz, bz, 0x13001);
gSpriteHit[nXSprite].hit = ClipMove((int*)&pSprite->x, (int*)&pSprite->y, (int*)&pSprite->z, &nSector, xvel[nSprite]>>12, yvel[nSprite]>>12, wd, tz, bz, CLIPMASK0);
if (nSector == -1)
{
nSector = pSprite->sectnum;
@ -4776,7 +4776,7 @@ void MoveDude(spritetype *pSprite)
if (zvel[nSprite])
pSprite->z += zvel[nSprite]>>8;
int ceilZ, ceilHit, floorZ, floorHit;
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, wd, 0x13001);
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, wd, CLIPMASK0);
GetSpriteExtents(pSprite, &top, &bottom);
if (pSprite->hitag & 2)
{
@ -4819,7 +4819,7 @@ void MoveDude(spritetype *pSprite)
int nLink = CheckLink(pSprite);
if (nLink)
{
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, wd, 0x13001);
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, wd, CLIPMASK0);
if (pPlayer)
playerResetInertia(pPlayer);
switch (nLink)
@ -5027,7 +5027,7 @@ void MoveDude(spritetype *pSprite)
{
int floorZ2 = floorZ;
int floorHit2 = floorHit;
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, pSprite->clipdist<<2, 0x13001);
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, pSprite->clipdist<<2, CLIPMASK0);
if (bottom <= floorZ && pSprite->z - floorZ2 < bz)
{
floorZ = floorZ2;

View file

@ -1237,4 +1237,6 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor
}
}
yax_update(1);
}

View file

@ -150,7 +150,7 @@ void sub_2541C(int x, int y, int z, short a)
{
int nTile = pSprite->picnum;
int ceilZ, ceilHit, floorZ, floorHit;
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, (pSprite->clipdist<<2)+16, 0x13001);
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, (pSprite->clipdist<<2)+16, CLIPMASK0);
int nTop, nBottom;
GetSpriteExtents(pSprite, &nTop, &nBottom);
int nScale = mulscale((pSprite->yrepeat+((floorZ-nBottom)>>8))*z, yxaspect, 16);

View file

@ -598,7 +598,7 @@ void fakeMoveDude(spritetype *pSprite)
{
short bakCstat = pSprite->cstat;
pSprite->cstat &= ~257;
predict.at75.hit = ClipMove(&predict.at50, &predict.at54, &predict.at58, &nSector, predict.at5c >> 12, predict.at60 >> 12, wd, tz, bz, 0x13001);
predict.at75.hit = ClipMove(&predict.at50, &predict.at54, &predict.at58, &nSector, predict.at5c >> 12, predict.at60 >> 12, wd, tz, bz, CLIPMASK0);
if (nSector == -1)
nSector = predict.at68;
@ -708,7 +708,7 @@ void fakeMoveDude(spritetype *pSprite)
{
int floorZ2 = floorZ;
int floorHit2 = floorHit;
GetZRange(pTempSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, pSprite->clipdist<<2, 0x13001);
GetZRange(pTempSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, pSprite->clipdist<<2, CLIPMASK0);
if (bottom <= floorZ && predict.at58-floorZ2 < bz)
{
floorZ = floorZ2;

View file

@ -359,8 +359,6 @@ static FORCE_INLINE int32_t yax_islockededge(int32_t line, int32_t cf)
//// bunch getters/setters
int16_t yax_getbunch(int16_t i, int16_t cf)
{
if (bloodhack)
return -1;
if (editstatus==0)
return yax_bunchnum[i][cf];
@ -437,8 +435,6 @@ void yax_setbunches(int16_t i, int16_t cb, int16_t fb)
//// nextwall getters/setters
int16_t yax_getnextwall(int16_t wal, int16_t cf)
{
if (bloodhack)
return -1;
if (editstatus==0)
return yax_nextwall[wal][cf];
@ -8464,28 +8460,25 @@ int32_t renderDrawRoomsQ16(int32_t daposx, int32_t daposy, int32_t daposz,
dmost[0] = shortptr2[0]-windowxy1.y;
}
if (!bloodhack)
for (int i = 0; i < numwalls; ++i)
{
for (int i = 0; i < numwalls; ++i)
if (wall[i].cstat & CSTAT_WALL_ROTATE_90)
{
if (wall[i].cstat & CSTAT_WALL_ROTATE_90)
auto &w = wall[i];
auto &tile = rottile[w.picnum+animateoffs(w.picnum,16384)];
if (tile.newtile == -1 && tile.owner == -1)
{
auto &w = wall[i];
auto &tile = rottile[w.picnum+animateoffs(w.picnum,16384)];
tile.newtile = findUnusedTile();
Bassert(tile.newtile != -1);
if (tile.newtile == -1 && tile.owner == -1)
{
tile.newtile = findUnusedTile();
Bassert(tile.newtile != -1);
rottile[tile.newtile].owner = w.picnum+animateoffs(w.picnum,16384);
rottile[tile.newtile].owner = w.picnum+animateoffs(w.picnum,16384);
auto &siz = tilesiz[w.picnum+animateoffs(w.picnum,16384)];
tileSetSize(tile.newtile, siz.x, siz.y);
auto &siz = tilesiz[w.picnum+animateoffs(w.picnum,16384)];
tileSetSize(tile.newtile, siz.x, siz.y);
tileLoad(tile.newtile);
// Bassert(waloff[tile.newtile]);
}
tileLoad(tile.newtile);
// Bassert(waloff[tile.newtile]);
}
}
}