mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
TROR related tweaks
# Conflicts: # source/blood/src/mirrors.cpp
This commit is contained in:
parent
388bf2665f
commit
8fd6e0e183
7 changed files with 36 additions and 8 deletions
|
@ -6527,7 +6527,8 @@ bool actCanSplatWall(int nWall)
|
|||
return 0;
|
||||
if (pWall->cstat & 32768)
|
||||
return 0;
|
||||
if (pWall->lotag >= 500 && pWall->lotag < 512)
|
||||
int nType = GetWallType(nWall);
|
||||
if (nType >= 500 && nType < 512)
|
||||
return 0;
|
||||
if (pWall->nextsector != -1)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -269,6 +269,22 @@ extern unsigned short nextXSprite[kMaxXSprites];
|
|||
extern unsigned short nextXWall[kMaxXWalls];
|
||||
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 RemoveSpriteSect(int nSprite);
|
||||
void InsertSpriteStat(int nSprite, int nStat);
|
||||
|
|
|
@ -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
|
||||
sfxSetReverb(0);
|
||||
ambInit();
|
||||
#ifdef YAX_ENABLE
|
||||
yax_update(numyaxbunches > 0 ? 2 : 1);
|
||||
#endif
|
||||
memset(myMinLag, 0, sizeof(myMinLag));
|
||||
otherMinLag = 0;
|
||||
myMaxLag = 0;
|
||||
|
@ -303,6 +306,9 @@ void MyLoadSave::Load(void)
|
|||
Read(&gMapRev, sizeof(gMapRev));
|
||||
Read(&gSongId, sizeof(gSkyCount));
|
||||
Read(&gFogMode, sizeof(gFogMode));
|
||||
#ifdef YAX_ENABLE
|
||||
Read(&numyaxbunches, sizeof(numyaxbunches));
|
||||
#endif
|
||||
gCheatMgr.sub_5BCF4();
|
||||
}
|
||||
|
||||
|
@ -404,6 +410,9 @@ void MyLoadSave::Save(void)
|
|||
Write(&gMapRev, sizeof(gMapRev));
|
||||
Write(&gSongId, sizeof(gSkyCount));
|
||||
Write(&gFogMode, sizeof(gFogMode));
|
||||
#ifdef YAX_ENABLE
|
||||
Write(&numyaxbunches, sizeof(numyaxbunches));
|
||||
#endif
|
||||
}
|
||||
|
||||
void LoadSavedInfo(void)
|
||||
|
|
|
@ -99,7 +99,7 @@ void InitMirrors(void)
|
|||
int nTile = 4080+mirrorcnt;
|
||||
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;
|
||||
mirror[mirrorcnt].at14 = i;
|
||||
|
@ -111,7 +111,7 @@ void InitMirrors(void)
|
|||
{
|
||||
if (j == i)
|
||||
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)
|
||||
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].ceilingz = sector[nSector].ceilingz;
|
||||
int cx, cy, ca;
|
||||
if (pWall->lotag == 501)
|
||||
if (GetWallType(nWall) == 501)
|
||||
{
|
||||
cx = x - (wall[pWall->hitag].x-wall[pWall->point2].x);
|
||||
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);
|
||||
viewProcessSprites(cx,cy,z);
|
||||
renderDrawMasks();
|
||||
if (pWall->lotag != 501)
|
||||
if (GetWallType(nWall) != 501)
|
||||
renderCompleteMirror();
|
||||
if (wall[nWall].pal != 0 || wall[nWall].shade != 0)
|
||||
TranslateMirrorColors(wall[nWall].shade, wall[nWall].pal);
|
||||
|
|
|
@ -1191,7 +1191,7 @@ void OperateWall(int nWall, XWALL *pXWall, EVENT a3)
|
|||
pXWall->locked ^= 1;
|
||||
return;
|
||||
}
|
||||
if (pWall->lotag == 511)
|
||||
if (GetWallType(nWall) == 511)
|
||||
{
|
||||
char bStatus;
|
||||
switch (a3.cmd)
|
||||
|
|
|
@ -177,7 +177,7 @@ void yax_updategrays(int32_t posze);
|
|||
# define YAX_NEXTWALLDEFAULT(Cf) (-1)
|
||||
# else
|
||||
// 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)
|
||||
extern int16_t yax_bunchnum[MAXSECTORS][2];
|
||||
extern int16_t yax_nextwall[MAXWALLS][2];
|
||||
|
|
Loading…
Reference in a new issue