mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-23 20:42:45 +00:00
- eliminated many uses of wallpicnum.
The ones left require a bit more work on the data first.
This commit is contained in:
parent
ffb471666d
commit
837e4d1438
18 changed files with 61 additions and 73 deletions
|
@ -1862,8 +1862,8 @@ void destroyit(DDukeActor *actor)
|
|||
auto srcwal = srcsect->walls.Data();
|
||||
for (unsigned i = 0; i < destsect->walls.Size(); i++, srcwal++, destwal++)
|
||||
{
|
||||
destwal->wallpicnum = srcwal->wallpicnum;
|
||||
destwal->overpicnum = srcwal->overpicnum;
|
||||
destwal->setwalltexture(srcwal->walltexture());
|
||||
destwal->setovertexture(srcwal->overtexture());
|
||||
destwal->shade = srcwal->shade;
|
||||
destwal->xrepeat = srcwal->xrepeat;
|
||||
destwal->yrepeat = srcwal->yrepeat;
|
||||
|
|
|
@ -422,6 +422,7 @@ enum
|
|||
TFLAG_BLOCKDOOR = 1 << 4,
|
||||
TFLAG_NOBLOODSPLAT = 1 << 5,
|
||||
TFLAG_NOCIRCLEREFLECT = 1 << 6,
|
||||
TFLAG_INTERPOLATEWALL = 1 << 7,
|
||||
};
|
||||
|
||||
enum
|
||||
|
|
|
@ -565,13 +565,13 @@ void CallStandingOn(DDukeActor* actor, player_struct* p)
|
|||
CCMD(changewalltexture)
|
||||
{
|
||||
if (argv.argc() < 2) return;
|
||||
int tile = tileForName(argv[1]);
|
||||
if (tile < 0) tile = (int)strtol(argv[1], nullptr, 10);
|
||||
FTextureID tile = TexMan.CheckForTexture(argv[1], ETextureType::Any);
|
||||
if (!tile.isValid()) tile = tileGetTextureID((int)strtol(argv[1], nullptr, 10));
|
||||
HitInfoBase hit;
|
||||
hitscan(ps[0].actor->spr.pos, ps[0].cursector, DVector3(ps[0].actor->spr.Angles.Yaw.ToVector(), 0) * 1024, hit, CLIPMASK1);
|
||||
if (hit.hitWall)
|
||||
{
|
||||
hit.hitWall->wallpicnum = tile;
|
||||
hit.hitWall->setwalltexture(tile);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1090,7 +1090,7 @@ void enterlevel(MapRecord *mi, int gamemode)
|
|||
{
|
||||
for (auto& wal : wall)
|
||||
{
|
||||
if (wal.wallpicnum == 7873 || wal.wallpicnum == 7870)
|
||||
if (tileflags(wal.walltexture()) & TFLAG_INTERPOLATEWALL)
|
||||
StartInterpolation(&wal, Interp_Wall_PanX);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -283,7 +283,7 @@ void BuildDrip(DExhumedActor* nSprite);
|
|||
DExhumedActor* BuildEnergyBlock(sectortype* pSector);
|
||||
int BuildElevC(int arg1, int nChannel, sectortype* pSector, DExhumedActor* nWallSprite, int arg5, int arg6, int nCount, ...);
|
||||
int BuildElevF(int nChannel, sectortype* pSector, DExhumedActor* nWallSprite, int arg_4, int arg_5, int nCount, ...);
|
||||
int BuildWallFace(int nChannel, walltype* pWall, int nCount, ...);
|
||||
int BuildWallFace(int nChannel, walltype* pWall, FTextureID pic);
|
||||
int BuildSlide(int nChannel, walltype* edx, walltype* ebx, walltype* ecx, walltype* arg1, walltype* arg2, walltype* arg3);
|
||||
|
||||
// queen
|
||||
|
|
|
@ -465,7 +465,7 @@ HITSPRITE:
|
|||
else if (pHitWall != nullptr)
|
||||
{
|
||||
HITWALL:
|
||||
if (pHitWall->wallpicnum == kEnergy1)
|
||||
if (pHitWall->walltexture() == tileGetTextureID(kEnergy1))
|
||||
{
|
||||
if (pHitWall->twoSided())
|
||||
{
|
||||
|
|
|
@ -718,8 +718,6 @@ void AddFlow(walltype* pWall, int nSpeed, int b)
|
|||
// only moves up or down
|
||||
StartInterpolation(pWall, Interp_Wall_PanY);
|
||||
|
||||
int nPic = pWall->wallpicnum;
|
||||
|
||||
sFlowInfo[nFlow].angcos = 0;
|
||||
sFlowInfo[nFlow].angsin = b == 2 ? 1.f : -1.f;
|
||||
sFlowInfo[nFlow].pWall = pWall;
|
||||
|
|
|
@ -104,7 +104,7 @@ struct wallFace
|
|||
walltype* pWall;
|
||||
int16_t nChannel;
|
||||
int16_t count;
|
||||
int16_t piclist[8];
|
||||
FTextureID picList[2];
|
||||
};
|
||||
|
||||
struct slideData
|
||||
|
@ -136,8 +136,8 @@ struct Trap
|
|||
|
||||
int16_t nState;
|
||||
int16_t nType;
|
||||
int16_t nPicnum1;
|
||||
int16_t nPicnum2;
|
||||
FTextureID nPicnum1;
|
||||
FTextureID nPicnum2;
|
||||
int16_t nTrapInterval;
|
||||
|
||||
};
|
||||
|
@ -269,8 +269,8 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, wallFace& w, wallF
|
|||
{
|
||||
arc("channel", w.nChannel)
|
||||
("wall", w.pWall)
|
||||
("at4", w.count)
|
||||
.Array("at6", w.piclist, 8)
|
||||
("count", w.count)
|
||||
.Array("piclist", w.picList, 2)
|
||||
.EndObject();
|
||||
}
|
||||
return arc;
|
||||
|
@ -919,7 +919,7 @@ void InitWallFace()
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int BuildWallFace(int nChannel, walltype* pWall, int nCount, ...)
|
||||
int BuildWallFace(int nChannel, walltype* pWall, FTextureID pic)
|
||||
{
|
||||
auto WallFaceCount = WallFace.Reserve(1);
|
||||
|
||||
|
@ -927,21 +927,13 @@ int BuildWallFace(int nChannel, walltype* pWall, int nCount, ...)
|
|||
WallFace[WallFaceCount].pWall = pWall;
|
||||
WallFace[WallFaceCount].nChannel = nChannel;
|
||||
|
||||
if (nCount > 8) {
|
||||
nCount = 8;
|
||||
}
|
||||
|
||||
va_list piclist;
|
||||
va_start(piclist, nCount);
|
||||
|
||||
while (WallFace[WallFaceCount].count < nCount)
|
||||
while (WallFace[WallFaceCount].count < 2)
|
||||
{
|
||||
int i = WallFace[WallFaceCount].count;
|
||||
WallFace[WallFaceCount].count++;
|
||||
|
||||
WallFace[WallFaceCount].piclist[i] = (int16_t)va_arg(piclist, int);
|
||||
WallFace[WallFaceCount].picList[i] = pic + i;
|
||||
}
|
||||
va_end(piclist);
|
||||
|
||||
return WallFaceCount;
|
||||
}
|
||||
|
@ -963,7 +955,7 @@ void AIWallFace::ProcessChannel(RunListEvent* ev)
|
|||
|
||||
if ((si <= WallFace[nWallFace].count) && (si >= 0))
|
||||
{
|
||||
WallFace[nWallFace].pWall->wallpicnum = WallFace[nWallFace].piclist[si];
|
||||
WallFace[nWallFace].pWall->setwalltexture(WallFace[nWallFace].picList[si]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1241,8 +1233,8 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx)
|
|||
sTrap[nTrap].nTrapInterval = 5;
|
||||
}
|
||||
|
||||
sTrap[nTrap].nPicnum2 = 0;
|
||||
sTrap[nTrap].nPicnum1 = 0;
|
||||
sTrap[nTrap].nPicnum2 = FNullTextureID();
|
||||
sTrap[nTrap].nPicnum1 = FNullTextureID();
|
||||
|
||||
if (var_18 == -1) {
|
||||
return nTrap;
|
||||
|
@ -1257,13 +1249,13 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx)
|
|||
if (sTrap[nTrap].pWall1 != nullptr)
|
||||
{
|
||||
sTrap[nTrap].pWall2 = &wal;
|
||||
sTrap[nTrap].nPicnum2 = wal.wallpicnum;
|
||||
sTrap[nTrap].nPicnum2 = wal.walltexture();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
sTrap[nTrap].pWall1 = &wal;
|
||||
sTrap[nTrap].nPicnum1 = wal.wallpicnum;
|
||||
sTrap[nTrap].nPicnum1 = wal.walltexture();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1322,13 +1314,13 @@ void AITrap::Tick(RunListEvent* ev)
|
|||
auto pWall = sTrap[nTrap].pWall1;
|
||||
if (pWall)
|
||||
{
|
||||
pWall->wallpicnum = sTrap[nTrap].nPicnum1;
|
||||
pWall->setwalltexture(sTrap[nTrap].nPicnum1);
|
||||
}
|
||||
|
||||
pWall = sTrap[nTrap].pWall1;
|
||||
if (pWall)
|
||||
{
|
||||
pWall->wallpicnum = sTrap[nTrap].nPicnum2;
|
||||
pWall->setwalltexture(sTrap[nTrap].nPicnum2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1354,13 +1346,13 @@ void AITrap::Tick(RunListEvent* ev)
|
|||
auto pWall = sTrap[nTrap].pWall1;
|
||||
if (pWall)
|
||||
{
|
||||
pWall->wallpicnum = sTrap[nTrap].nPicnum1 + 1;
|
||||
pWall->setwalltexture(sTrap[nTrap].nPicnum1 + 1);
|
||||
}
|
||||
|
||||
pWall = sTrap[nTrap].pWall2;
|
||||
if (pWall)
|
||||
{
|
||||
pWall->wallpicnum = sTrap[nTrap].nPicnum2;
|
||||
pWall->setwalltexture(sTrap[nTrap].nPicnum2);
|
||||
}
|
||||
|
||||
D3PlayFX(StaticSound[kSound36], pBullet);
|
||||
|
@ -1621,7 +1613,7 @@ DExhumedActor* BuildEnergyBlock(sectortype* pSector)
|
|||
{
|
||||
apos += wal.pos;
|
||||
|
||||
wal.wallpicnum = kClockSymbol16;
|
||||
wal.setwalltexture(TexMan.CheckForTexture("ClockSymbol16", ETextureType::Any));
|
||||
wal.pal = 0;
|
||||
wal.shade = 50;
|
||||
}
|
||||
|
@ -2619,6 +2611,7 @@ void PostProcess()
|
|||
}
|
||||
else // nMap == kMap20)
|
||||
{
|
||||
auto texid3603 = tileGetTextureID(kTile3603);
|
||||
for(auto& sect: sector)
|
||||
{
|
||||
sect.pSoundSect = §
|
||||
|
@ -2626,7 +2619,7 @@ void PostProcess()
|
|||
|
||||
for(auto& wal : sect.walls)
|
||||
{
|
||||
if (wal.wallpicnum == kTile3603)
|
||||
if (wal.walltexture() == texid3603)
|
||||
{
|
||||
wal.pal = 1;
|
||||
auto pActor = insertActor(§, 407);
|
||||
|
@ -2638,7 +2631,7 @@ void PostProcess()
|
|||
ExhumedSpriteIterator it;
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->spr.statnum < kMaxStatus && act->spr.picnum == kTile3603)
|
||||
if (act->spr.statnum < kMaxStatus && act->spr.spritetexture() == texid3603)
|
||||
{
|
||||
ChangeActorStat(act, 407);
|
||||
act->spr.pal = 1;
|
||||
|
|
|
@ -1625,7 +1625,7 @@ void runlist_ProcessWallTag(walltype* pWall, int nLotag, int nHitag)
|
|||
|
||||
case 1:
|
||||
{
|
||||
int nWallFace = BuildWallFace(nChannel, pWall, 2, pWall->wallpicnum, pWall->wallpicnum + 1);
|
||||
int nWallFace = BuildWallFace(nChannel, pWall, pWall->walltexture());
|
||||
runlist_AddRunRec(sRunChannels[nChannel].a, nWallFace, 0x70000);
|
||||
|
||||
auto nSwitch = BuildSwPressWall(nChannel, BuildLink(2, nEffectTag, 0), pWall);
|
||||
|
@ -1643,7 +1643,7 @@ void runlist_ProcessWallTag(walltype* pWall, int nLotag, int nHitag)
|
|||
|
||||
case 7: // Regular switch
|
||||
{
|
||||
int nWallFace = BuildWallFace(nChannel, pWall, 2, pWall->wallpicnum, pWall->wallpicnum + 1);
|
||||
int nWallFace = BuildWallFace(nChannel, pWall, pWall->walltexture());
|
||||
runlist_AddRunRec(sRunChannels[nChannel].a, nWallFace, 0x70000);
|
||||
|
||||
auto nSwitch = BuildSwPressWall(nChannel, BuildLink(1, 1), pWall);
|
||||
|
@ -1653,7 +1653,7 @@ void runlist_ProcessWallTag(walltype* pWall, int nLotag, int nHitag)
|
|||
|
||||
case 8: // Reverse switch
|
||||
{
|
||||
int nWallFace = BuildWallFace(nChannel, pWall, 2, pWall->wallpicnum, pWall->wallpicnum + 1);
|
||||
int nWallFace = BuildWallFace(nChannel, pWall, pWall->walltexture());
|
||||
runlist_AddRunRec(sRunChannels[nChannel].a, nWallFace, 0x70000);
|
||||
|
||||
auto nSwitch = BuildSwPressWall(nChannel, BuildLink(2, -1, 0), pWall);
|
||||
|
|
|
@ -639,7 +639,7 @@ int AutoBreakWall(walltype* wallp, const DVector3& hit_pos, DAngle ang, int type
|
|||
else
|
||||
{
|
||||
if (break_info->breaknum == -1)
|
||||
wallp->wallpicnum = 594; // temporary break pic
|
||||
wallp->setwalltexture(FNullTextureID()); // temporary break pic
|
||||
else
|
||||
{
|
||||
wallp->wallpicnum = break_info->breaknum;
|
||||
|
@ -681,7 +681,7 @@ bool UserBreakWall(walltype* wp)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (wp->wallpicnum == SP_TAG5(actor))
|
||||
if (wp->walltexture() == actor->texparam)
|
||||
return true;
|
||||
|
||||
// make it BROKEN
|
||||
|
@ -692,7 +692,7 @@ bool UserBreakWall(walltype* wp)
|
|||
|
||||
if (SP_TAG8(actor) == 0)
|
||||
{
|
||||
wp->wallpicnum = SP_TAG5(actor);
|
||||
wp->setwalltexture(actor->texparam);
|
||||
// clear tags
|
||||
wp->hitag = wp->lotag = 0;
|
||||
if (wp->twoSided())
|
||||
|
@ -715,7 +715,7 @@ bool UserBreakWall(walltype* wp)
|
|||
else if (SP_TAG8(actor) == 2)
|
||||
{
|
||||
// set to broken pic
|
||||
wp->wallpicnum = SP_TAG5(actor);
|
||||
wp->setwalltexture(actor->texparam);
|
||||
|
||||
// clear flags
|
||||
wp->cstat &= ~(block_flags);
|
||||
|
@ -735,7 +735,7 @@ bool UserBreakWall(walltype* wp)
|
|||
else
|
||||
{
|
||||
// increment picnum
|
||||
wp->wallpicnum++;
|
||||
wp->setwalltexture(wp->walltexture() + 1);
|
||||
|
||||
DoSpawnSpotsForDamage(match);
|
||||
}
|
||||
|
|
|
@ -77,10 +77,10 @@ void CopySectorWalls(sectortype* dest_sect, sectortype* src_sect)
|
|||
{
|
||||
auto const dest_nextwall = dwall->nextWall();
|
||||
auto const src_nextwall = swall->nextWall();
|
||||
dest_nextwall->wallpicnum = src_nextwall->wallpicnum;
|
||||
dest_nextwall->setwalltexture(src_nextwall->walltexture());
|
||||
dest_nextwall->xrepeat = src_nextwall->xrepeat;
|
||||
dest_nextwall->yrepeat = src_nextwall->yrepeat;
|
||||
dest_nextwall->overpicnum = src_nextwall->overpicnum;
|
||||
dest_nextwall->setovertexture(src_nextwall->overtexture());
|
||||
dest_nextwall->pal = src_nextwall->pal;
|
||||
dest_nextwall->cstat = src_nextwall->cstat;
|
||||
dest_nextwall->shade = src_nextwall->shade;
|
||||
|
|
|
@ -375,17 +375,6 @@ void JS_InitMirrors(void)
|
|||
wal.overpicnum = legacyTileNum(sec->ceilingtexture);
|
||||
}
|
||||
}
|
||||
|
||||
// Invalidate textures in sector behind mirror
|
||||
for (i = 0; i < mirrorcnt; i++)
|
||||
{
|
||||
for (auto& wal : mirror[i].mirrorSector->walls)
|
||||
{
|
||||
wal.wallpicnum = MIRROR;
|
||||
wal.overpicnum = MIRROR;
|
||||
}
|
||||
}
|
||||
|
||||
} // InitMirrors
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
@ -1086,7 +1086,8 @@ void DSWActor::Serialize(FSerializer& arc)
|
|||
arc("hasuser", hasUser)
|
||||
("tempwall", tempwall)
|
||||
("owner", ownerActor)
|
||||
("texparam", texparam);
|
||||
("texparam", texparam)
|
||||
("texparam2", texparam2);
|
||||
if (hasUser) arc("user", user); // only write if defined.
|
||||
}
|
||||
|
||||
|
|
|
@ -1879,6 +1879,8 @@ void SpriteSetup(void)
|
|||
|
||||
case BREAKABLE:
|
||||
// used for wall info
|
||||
if (SP_TAG5(actor) >= 0 && !actor->texparam.isValid()) actor->texparam = tileGetTextureID(SP_TAG5(actor));
|
||||
|
||||
change_actor_stat(actor, STAT_BREAKABLE);
|
||||
break;
|
||||
|
||||
|
@ -2009,8 +2011,7 @@ void SpriteSetup(void)
|
|||
// copy tag 7 to tag 6 and pre-shift it
|
||||
SP_TAG6(actor) = SP_TAG7(actor);
|
||||
SP_TAG6(actor) <<= 7;
|
||||
if (SP_TAG2(actor) >= 0)
|
||||
actor->texparam = tileGetTextureID(SP_TAG2(actor)); // convert and copy to a safe place. A new map format cannot use the lotag to hold a named texture.
|
||||
if (SP_TAG2(actor) >= 0 && !actor->texparam.isValid()) actor->texparam = tileGetTextureID(SP_TAG2(actor));
|
||||
change_actor_stat(actor, STAT_CEILING_FLOOR_PIC_OVERRIDE);
|
||||
break;
|
||||
}
|
||||
|
@ -2024,8 +2025,7 @@ void SpriteSetup(void)
|
|||
|
||||
case SECT_CHANGOR:
|
||||
{
|
||||
if (SP_TAG4(actor) >= 0)
|
||||
actor->texparam = tileGetTextureID(SP_TAG4(actor)); // convert and copy to a safe place. A new map format cannot use the lotag to hold a named texture.
|
||||
if (SP_TAG4(actor) >= 0 && !actor->texparam.isValid()) actor->texparam = tileGetTextureID(SP_TAG4(actor));
|
||||
change_actor_stat(actor, STAT_CHANGOR);
|
||||
break;
|
||||
}
|
||||
|
@ -2532,6 +2532,8 @@ void SpriteSetup(void)
|
|||
|
||||
|
||||
case SECT_WALL_MOVE:
|
||||
if (SP_TAG5(actor) >= 0 && !actor->texparam.isValid()) actor->texparam = tileGetTextureID(SP_TAG5(actor));
|
||||
if (SP_TAG6(actor) >= 0 && !actor->texparam.isValid()) actor->texparam2 = tileGetTextureID(SP_TAG6(actor));
|
||||
change_actor_stat(actor, STAT_WALL_MOVE);
|
||||
break;
|
||||
case SECT_WALL_MOVE_CANSEE:
|
||||
|
@ -6096,7 +6098,7 @@ int StateControl(DSWActor* actor)
|
|||
if ((actor->user.State->Tics & SF_WALL_STATE))
|
||||
{
|
||||
ASSERT(actor->user.WallP);
|
||||
actor->user.WallP->wallpicnum = actor->user.State->Pic;
|
||||
actor->user.WallP->setwalltexture(tileGetTextureID(actor->user.State->Pic));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ public:
|
|||
USER user;
|
||||
walltype* tempwall; // transient, to replace a hack using a 16 bit sprite field.
|
||||
TObjPtr<DSWActor*> ownerActor;
|
||||
FTextureID texparam; // only one special variant of ST1 needs this...
|
||||
FTextureID texparam, texparam2; // some special variants of ST1 need this...
|
||||
|
||||
DSWActor() = default;
|
||||
|
||||
|
|
|
@ -88,14 +88,15 @@ void SOwallmove(SECTOR_OBJECT* sop, DSWActor* actor, walltype* find_wallp, doubl
|
|||
|
||||
int DoWallMove(DSWActor* actor)
|
||||
{
|
||||
short shade1,shade2,picnum1,picnum2;
|
||||
short shade1, shade2;
|
||||
FTextureID texid1, texid2;
|
||||
bool found = false;
|
||||
bool SOsprite = false;
|
||||
|
||||
double dist = SP_TAG13(actor) * maptoworld;
|
||||
DAngle ang = mapangle(SP_TAG4(actor));
|
||||
picnum1 = SP_TAG5(actor);
|
||||
picnum2 = SP_TAG6(actor);
|
||||
texid1 = actor->texparam;
|
||||
texid2 = actor->texparam2;
|
||||
shade1 = SP_TAG7(actor);
|
||||
shade2 = SP_TAG8(actor);
|
||||
int dang = ((int)SP_TAG10(actor)) << 3;
|
||||
|
@ -127,15 +128,15 @@ int DoWallMove(DSWActor* actor)
|
|||
|
||||
if (shade1)
|
||||
wal.shade = int8_t(shade1);
|
||||
if (picnum1)
|
||||
wal.wallpicnum = picnum1;
|
||||
if (texid1.isValid())
|
||||
wal.setwalltexture(texid1);
|
||||
|
||||
// find the previous wall
|
||||
auto prev_wall = PrevWall(&wal);
|
||||
if (shade2)
|
||||
prev_wall->shade = int8_t(shade2);
|
||||
if (picnum2)
|
||||
prev_wall->wallpicnum = picnum2;
|
||||
if (texid2.isValid())
|
||||
prev_wall->setwalltexture(texid2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ constants
|
|||
TFLAG_BLOCKDOOR = 16
|
||||
TFLAG_NOBLOODSPLAT = 32
|
||||
TFLAG_NOCIRCLEREFLECT = 64
|
||||
TFLAG_INTERPOLATEWALL = 128
|
||||
|
||||
// surface (terrain/environment) types
|
||||
TSURF_NONE = 0
|
||||
|
|
|
@ -32,6 +32,8 @@ textureflags
|
|||
RRTILE8380,
|
||||
RRTILE8565,
|
||||
RRTILE8605
|
||||
|
||||
TFLAG_INTERPOLATEWALL = RRTILE7873, RRTILE7870
|
||||
}
|
||||
|
||||
surfacetypes
|
||||
|
|
Loading…
Reference in a new issue