Applied texture offsets and scales on animated doors

https://forum.zdoom.org/viewtopic.php?t=58892
This commit is contained in:
alexey.lysiuk 2017-12-29 11:47:30 +02:00
parent 996bddd602
commit a670e79b8a
2 changed files with 16 additions and 4 deletions

View File

@ -711,9 +711,13 @@ DAnimatedDoor::DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay,
}
picnum = m_Line1->sidedef[0]->GetTexture(side_t::top);
m_Line1->sidedef[0]->SetTexture(side_t::mid, picnum);
m_Line2->sidedef[0]->SetTexture(side_t::mid, picnum);
auto &tex1 = m_Line1->sidedef[0]->textures;
tex1[side_t::mid].InitFrom(tex1[side_t::top]);
auto &tex2 = m_Line2->sidedef[0]->textures;
tex2[side_t::mid].InitFrom(tex2[side_t::top]);
picnum = tex1[side_t::top].texture;
// don't forget texture scaling here!
FTexture *tex = TexMan[picnum];

View File

@ -1139,7 +1139,15 @@ struct side_t
double yScale;
TObjPtr<DInterpolation*> interpolation;
FTextureID texture;
//int Light;
void InitFrom(const part &other)
{
if (texture.isNull()) texture = other.texture;
if (0.0 == xOffset) xOffset = other.xOffset;
if (0.0 == yOffset) yOffset = other.yOffset;
if (1.0 == xScale && 0.0 != other.xScale) xScale = other.xScale;
if (1.0 == yScale && 0.0 != other.yScale) yScale = other.yScale;
}
};
sector_t* sector; // Sector the SideDef is facing.