TROR related tweaks

# Conflicts:
#	source/blood/src/mirrors.cpp
This commit is contained in:
nukeykt 2019-06-26 23:02:01 +09:00 committed by Christoph Oelckers
parent 388bf2665f
commit 8fd6e0e183
7 changed files with 36 additions and 8 deletions

View File

@ -6527,7 +6527,8 @@ bool actCanSplatWall(int nWall)
return 0; return 0;
if (pWall->cstat & 32768) if (pWall->cstat & 32768)
return 0; return 0;
if (pWall->lotag >= 500 && pWall->lotag < 512) int nType = GetWallType(nWall);
if (nType >= 500 && nType < 512)
return 0; return 0;
if (pWall->nextsector != -1) if (pWall->nextsector != -1)
{ {

View File

@ -1238,5 +1238,7 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor
} }
} }
yax_update(1); #ifdef YAX_ENABLE
yax_update(numyaxbunches > 0 ? 2 : 1);
#endif
} }

View File

@ -269,6 +269,22 @@ extern unsigned short nextXSprite[kMaxXSprites];
extern unsigned short nextXWall[kMaxXWalls]; extern unsigned short nextXWall[kMaxXWalls];
extern unsigned short nextXSector[kMaxXSectors]; extern unsigned short nextXSector[kMaxXSectors];
#ifdef YAX_ENABLE
static inline bool yax_hasnextwall(int nWall)
{
return yax_getnextwall(nWall, YAX_CEILING) >= 0 || yax_getnextwall(nWall, YAX_FLOOR);
}
#endif
static inline int GetWallType(int nWall)
{
#ifdef YAX_ENABLE
if (yax_hasnextwall(nWall))
return 0;
#endif
return wall[nWall].lotag;
}
void InsertSpriteSect(int nSprite, int nSector); void InsertSpriteSect(int nSprite, int nSector);
void RemoveSpriteSect(int nSprite); void RemoveSpriteSect(int nSprite);
void InsertSpriteStat(int nSprite, int nStat); void InsertSpriteStat(int nSprite, int nStat);

View File

@ -127,6 +127,9 @@ void LoadSave::LoadGame(char *pzFile)
if (!bVanilla && !gMe->packInfo[1].at0) // if diving suit is not active, turn off reverb sound effect if (!bVanilla && !gMe->packInfo[1].at0) // if diving suit is not active, turn off reverb sound effect
sfxSetReverb(0); sfxSetReverb(0);
ambInit(); ambInit();
#ifdef YAX_ENABLE
yax_update(numyaxbunches > 0 ? 2 : 1);
#endif
memset(myMinLag, 0, sizeof(myMinLag)); memset(myMinLag, 0, sizeof(myMinLag));
otherMinLag = 0; otherMinLag = 0;
myMaxLag = 0; myMaxLag = 0;
@ -303,6 +306,9 @@ void MyLoadSave::Load(void)
Read(&gMapRev, sizeof(gMapRev)); Read(&gMapRev, sizeof(gMapRev));
Read(&gSongId, sizeof(gSkyCount)); Read(&gSongId, sizeof(gSkyCount));
Read(&gFogMode, sizeof(gFogMode)); Read(&gFogMode, sizeof(gFogMode));
#ifdef YAX_ENABLE
Read(&numyaxbunches, sizeof(numyaxbunches));
#endif
gCheatMgr.sub_5BCF4(); gCheatMgr.sub_5BCF4();
} }
@ -404,6 +410,9 @@ void MyLoadSave::Save(void)
Write(&gMapRev, sizeof(gMapRev)); Write(&gMapRev, sizeof(gMapRev));
Write(&gSongId, sizeof(gSkyCount)); Write(&gSongId, sizeof(gSkyCount));
Write(&gFogMode, sizeof(gFogMode)); Write(&gFogMode, sizeof(gFogMode));
#ifdef YAX_ENABLE
Write(&numyaxbunches, sizeof(numyaxbunches));
#endif
} }
void LoadSavedInfo(void) void LoadSavedInfo(void)

View File

@ -99,7 +99,7 @@ void InitMirrors(void)
int nTile = 4080+mirrorcnt; int nTile = 4080+mirrorcnt;
if (wall[i].overpicnum == 504) if (wall[i].overpicnum == 504)
{ {
if (wall[i].extra > 0 && wall[i].lotag == 501) if (wall[i].extra > 0 && GetWallType(i) == 501)
{ {
wall[i].overpicnum = nTile; wall[i].overpicnum = nTile;
mirror[mirrorcnt].at14 = i; mirror[mirrorcnt].at14 = i;
@ -111,7 +111,7 @@ void InitMirrors(void)
{ {
if (j == i) if (j == i)
continue; continue;
if (wall[j].extra > 0 && wall[j].lotag == 501) if (wall[j].extra > 0 && GetWallType(i) == 501)
{ {
if (tmp != xwall[wall[j].extra].data) if (tmp != xwall[wall[j].extra].data)
continue; continue;
@ -374,7 +374,7 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz)
sector[mirrorsector].floorz = sector[nSector].floorz; sector[mirrorsector].floorz = sector[nSector].floorz;
sector[mirrorsector].ceilingz = sector[nSector].ceilingz; sector[mirrorsector].ceilingz = sector[nSector].ceilingz;
int cx, cy, ca; int cx, cy, ca;
if (pWall->lotag == 501) if (GetWallType(nWall) == 501)
{ {
cx = x - (wall[pWall->hitag].x-wall[pWall->point2].x); cx = x - (wall[pWall->hitag].x-wall[pWall->point2].x);
cy = y - (wall[pWall->hitag].y-wall[pWall->point2].y); cy = y - (wall[pWall->hitag].y-wall[pWall->point2].y);
@ -387,7 +387,7 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz)
renderDrawRoomsQ16(cx, cy, z, ca,horiz,mirrorsector|MAXSECTORS); renderDrawRoomsQ16(cx, cy, z, ca,horiz,mirrorsector|MAXSECTORS);
viewProcessSprites(cx,cy,z); viewProcessSprites(cx,cy,z);
renderDrawMasks(); renderDrawMasks();
if (pWall->lotag != 501) if (GetWallType(nWall) != 501)
renderCompleteMirror(); renderCompleteMirror();
if (wall[nWall].pal != 0 || wall[nWall].shade != 0) if (wall[nWall].pal != 0 || wall[nWall].shade != 0)
TranslateMirrorColors(wall[nWall].shade, wall[nWall].pal); TranslateMirrorColors(wall[nWall].shade, wall[nWall].pal);

View File

@ -1191,7 +1191,7 @@ void OperateWall(int nWall, XWALL *pXWall, EVENT a3)
pXWall->locked ^= 1; pXWall->locked ^= 1;
return; return;
} }
if (pWall->lotag == 511) if (GetWallType(nWall) == 511)
{ {
char bStatus; char bStatus;
switch (a3.cmd) switch (a3.cmd)

View File

@ -177,7 +177,7 @@ void yax_updategrays(int32_t posze);
# define YAX_NEXTWALLDEFAULT(Cf) (-1) # define YAX_NEXTWALLDEFAULT(Cf) (-1)
# else # else
// More user tag hijacking: lotag/extra. :/ // More user tag hijacking: lotag/extra. :/
# define YAX_PTRNEXTWALL(Ptr, Wall, Cf) (*(int16_t *)(&Ptr[Wall].lotag + 2*Cf)) # define YAX_PTRNEXTWALL(Ptr, Wall, Cf) (*(int16_t *)(&Ptr[Wall].lotag + (bloodhack ? 1 : 2)*Cf))
# define YAX_NEXTWALLDEFAULT(Cf) (((Cf)==YAX_CEILING) ? 0 : -1) # define YAX_NEXTWALLDEFAULT(Cf) (((Cf)==YAX_CEILING) ? 0 : -1)
extern int16_t yax_bunchnum[MAXSECTORS][2]; extern int16_t yax_bunchnum[MAXSECTORS][2];
extern int16_t yax_nextwall[MAXWALLS][2]; extern int16_t yax_nextwall[MAXWALLS][2];