diff --git a/src/p_doors.cpp b/src/p_doors.cpp index 43deaeaf87..abfe81722c 100644 --- a/src/p_doors.cpp +++ b/src/p_doors.cpp @@ -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]; diff --git a/src/r_defs.h b/src/r_defs.h index 1ac282cf92..02da2ac0ee 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -1139,7 +1139,15 @@ struct side_t double yScale; TObjPtr 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.