From 388bf2665f997d7c25cd753baed9d4934233e2f1 Mon Sep 17 00:00:00 2001 From: nukeykt Date: Wed, 26 Jun 2019 22:20:03 +0900 Subject: [PATCH] Enable TROR code and rotated wall cstat bit for blood --- source/blood/src/actor.cpp | 8 ++++---- source/blood/src/db.cpp | 2 ++ source/blood/src/map2d.cpp | 2 +- source/blood/src/view.cpp | 4 ++-- source/build/src/engine.cpp | 33 +++++++++++++-------------------- 5 files changed, 22 insertions(+), 27 deletions(-) diff --git a/source/blood/src/actor.cpp b/source/blood/src/actor.cpp index 888d08a39..42e79d505 100644 --- a/source/blood/src/actor.cpp +++ b/source/blood/src/actor.cpp @@ -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; diff --git a/source/blood/src/db.cpp b/source/blood/src/db.cpp index 97c9308f2..f4e6cf70b 100644 --- a/source/blood/src/db.cpp +++ b/source/blood/src/db.cpp @@ -1237,4 +1237,6 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor } } + + yax_update(1); } diff --git a/source/blood/src/map2d.cpp b/source/blood/src/map2d.cpp index 7e6d89fe7..8199a3c8c 100644 --- a/source/blood/src/map2d.cpp +++ b/source/blood/src/map2d.cpp @@ -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); diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 71812b023..0614b693f 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -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; diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 2e1b36cda..ae567290c 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -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]); } } }