Skip to content

Commit

Permalink
upright_sprite: Fix texture position for players
Browse files Browse the repository at this point in the history
Fixes #6471
  • Loading branch information
SmallJoker committed Apr 9, 2018
1 parent e1bbc7e commit e40ffed
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/content_cao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,11 @@ void GenericCAO::addToScene(ITextureSource *tsrc)
video::S3DVertex( dx, dy, 0, 0,0,0, c, 0,0),
video::S3DVertex(-dx, dy, 0, 0,0,0, c, 1,0),
};
if (m_is_player) {
// Move minimal Y position to 0 (feet position)
for (video::S3DVertex &vertex : vertices)
vertex.Pos.Y += dy;
}
u16 indices[] = {0,1,2,2,3,0};
buf->append(vertices, 4, indices, 6);
// Set material
Expand All @@ -535,6 +540,11 @@ void GenericCAO::addToScene(ITextureSource *tsrc)
video::S3DVertex(-dx, dy, 0, 0,0,0, c, 0,0),
video::S3DVertex( dx, dy, 0, 0,0,0, c, 1,0),
};
if (m_is_player) {
// Move minimal Y position to 0 (feet position)
for (video::S3DVertex &vertex : vertices)
vertex.Pos.Y += dy;
}
u16 indices[] = {0,1,2,2,3,0};
buf->append(vertices, 4, indices, 6);
// Set material
Expand Down

0 comments on commit e40ffed

Please sign in to comment.