mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 13:11:33 +00:00
Applied texture offsets and scales on animated doors
https://forum.zdoom.org/viewtopic.php?t=58892
This commit is contained in:
parent
996bddd602
commit
a670e79b8a
2 changed files with 16 additions and 4 deletions
|
@ -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);
|
auto &tex1 = m_Line1->sidedef[0]->textures;
|
||||||
m_Line1->sidedef[0]->SetTexture(side_t::mid, picnum);
|
tex1[side_t::mid].InitFrom(tex1[side_t::top]);
|
||||||
m_Line2->sidedef[0]->SetTexture(side_t::mid, picnum);
|
|
||||||
|
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!
|
// don't forget texture scaling here!
|
||||||
FTexture *tex = TexMan[picnum];
|
FTexture *tex = TexMan[picnum];
|
||||||
|
|
10
src/r_defs.h
10
src/r_defs.h
|
@ -1139,7 +1139,15 @@ struct side_t
|
||||||
double yScale;
|
double yScale;
|
||||||
TObjPtr<DInterpolation*> interpolation;
|
TObjPtr<DInterpolation*> interpolation;
|
||||||
FTextureID texture;
|
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.
|
sector_t* sector; // Sector the SideDef is facing.
|
||||||
|
|
Loading…
Reference in a new issue