- preparations and annotations for places in SW where textures are stored in tags.

This commit is contained in:
Christoph Oelckers 2022-12-08 22:07:43 +01:00
parent 0ffeb2378a
commit f3e652da84
7 changed files with 17 additions and 9 deletions

View file

@ -64,9 +64,7 @@ void PreCacheOverride(void)
SWStatIterator it(STAT_CEILING_FLOOR_PIC_OVERRIDE);
while (auto actor = it.Next())
{
int j = SP_TAG2(actor); // picnum
if(j >= 0 && j <= MAXTILES)
markTextureForPrecache(tileGetTextureID(j), 0);
markTextureForPrecache(actor->texparam, 0);
}
}

View file

@ -1171,7 +1171,8 @@ void UpdateWallPortalState()
{
if (SP_TAG3(actor) == 0)
{
// back up ceilingpicnum and ceilingstat
// back up ceilingpic and ceilingstat
// std::swap(actor->sector->ceilingtexture, actor->texparam);
SP_TAG5(actor) = actor->sector()->ceilingpicnum;
actor->sector()->ceilingpicnum = SP_TAG2(actor);
SP_TAG4(actor) = actor->sector()->ceilingstat;
@ -1180,6 +1181,7 @@ void UpdateWallPortalState()
}
else if (SP_TAG3(actor) == 1)
{
// std::swap(actor->sector->floortexture, actor->texparam);
SP_TAG5(actor) = actor->sector()->floorpicnum;
actor->sector()->floorpicnum = SP_TAG2(actor);
SP_TAG4(actor) = actor->sector()->floorstat;
@ -1203,13 +1205,15 @@ void RestorePortalState()
{
if (SP_TAG3(actor) == 0)
{
// restore ceilingpicnum and ceilingstat
// restore ceilingpic and ceilingstat
// std::swap(actor->sector->ceilingtexture, actor->texparam);
actor->sector()->ceilingpicnum = SP_TAG5(actor);
actor->sector()->ceilingstat = ESectorFlags::FromInt(SP_TAG4(actor));
actor->sector()->ceilingstat &= ~(CSTAT_SECTOR_SKY);
}
else if (SP_TAG3(actor) == 1)
{
// std::swap(actor->sector->floortexture, actor->texparam);
actor->sector()->floorpicnum = SP_TAG5(actor);
actor->sector()->floorstat = ESectorFlags::FromInt(SP_TAG4(actor));
actor->sector()->floorstat &= ~(CSTAT_SECTOR_SKY);

View file

@ -279,7 +279,7 @@ void JS_InitMirrors(void)
if (mirrorcnt >= MAXMIRRORS)
{
Printf("MAXMIRRORS reached! Skipping mirror wall\n");
wal.overpicnum = sec->ceilingpicnum;
wal.overpicnum = legacyTileNum(sec->ceilingtexture());
continue;
}
@ -374,7 +374,7 @@ void JS_InitMirrors(void)
mirrorcnt++;
}
else
wal.overpicnum = sec->ceilingpicnum;
wal.overpicnum = legacyTileNum(sec->ceilingtexture());
}
}

View file

@ -1085,7 +1085,8 @@ void DSWActor::Serialize(FSerializer& arc)
Super::Serialize(arc);
arc("hasuser", hasUser)
("tempwall", tempwall)
("owner", ownerActor);
("owner", ownerActor)
("texparam", texparam);
if (hasUser) arc("user", user); // only write if defined.
}

View file

@ -1402,7 +1402,7 @@ void DoChangorMatch(short match)
if (TEST_BOOL1(actor))
{
sectp->ceilingpicnum = SP_TAG4(actor);
sectp->ceilingpicnum = SP_TAG4(actor); // sectp->ceilingtexture = actor->texparam;
sectp->addceilingz(SP_TAG5(actor));
sectp->ceilingheinum += SP_TAG6(actor);

View file

@ -2009,6 +2009,8 @@ 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.
change_actor_stat(actor, STAT_CEILING_FLOOR_PIC_OVERRIDE);
break;
}
@ -2022,6 +2024,8 @@ 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.
change_actor_stat(actor, STAT_CHANGOR);
break;
}

View file

@ -16,6 +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...
DSWActor() = default;