Fix typo in data member name

This commit is contained in:
Stepland 2024-03-24 23:18:16 +01:00
parent d8eec1064a
commit df3a00a00c
2 changed files with 39 additions and 32 deletions

View File

@ -106,7 +106,7 @@ void Playfield::draw_tail_and_receptor(
long_note.triangle.setTexture(*tex, true);
}
if (auto tex = long_note.marker.background_at(note_offset)) {
long_note.backgroud.setTexture(*tex, true);
long_note.background.setTexture(*tex, true);
}
if (auto tex = long_note.marker.outline_at(note_offset)) {
long_note.outline.setTexture(*tex, true);
@ -147,50 +147,57 @@ void Playfield::draw_tail_and_receptor(
);
}
auto rect = long_note.tail.getTextureRect();
rect.height = static_cast<int>(rect.height * tail_length_factor);
long_note.tail.setTextureRect(rect);
long_note.tail.setOrigin(rect.width / 2.f, -rect.width / 2.f);
long_note.tail.setRotation(note.get_tail_angle() + 180);
rect = long_note.triangle.getTextureRect();
long_note.triangle.setOrigin(
rect.width / 2.f,
rect.width * (
0.5f
+ OffsetToTriangleDistance.clampedTransform(
note_offset.asSeconds()
{
auto rect = long_note.tail.getTextureRect();
rect.height = static_cast<int>(rect.height * tail_length_factor);
long_note.tail.setTextureRect(rect);
long_note.tail.setOrigin(rect.width / 2.f, -rect.width / 2.f);
long_note.tail.setRotation(note.get_tail_angle() + 180);
}
{
auto rect = long_note.triangle.getTextureRect();
long_note.triangle.setOrigin(
rect.width / 2.f,
rect.width * (
0.5f
+ OffsetToTriangleDistance.clampedTransform(
note_offset.asSeconds()
)
)
)
);
long_note.triangle.setRotation(note.get_tail_angle());
rect = long_note.backgroud.getTextureRect();
long_note.backgroud.setOrigin(rect.width / 2.f, rect.height / 2.f);
long_note.backgroud.setRotation(note.get_tail_angle());
rect = long_note.outline.getTextureRect();
long_note.outline.setOrigin(rect.width / 2.f, rect.height / 2.f);
long_note.outline.setRotation(note.get_tail_angle());
rect = long_note.highlight.getTextureRect();
long_note.highlight.setOrigin(rect.width / 2.f, rect.height / 2.f);
);
long_note.triangle.setRotation(note.get_tail_angle());
}
{
auto rect = long_note.background.getTextureRect();
long_note.background.setOrigin(rect.width / 2.f, rect.height / 2.f);
long_note.background.setRotation(note.get_tail_angle());
}
{
auto rect = long_note.outline.getTextureRect();
long_note.outline.setOrigin(rect.width / 2.f, rect.height / 2.f);
long_note.outline.setRotation(note.get_tail_angle());
}
{
auto rect = long_note.highlight.getTextureRect();
long_note.highlight.setOrigin(rect.width / 2.f, rect.height / 2.f);
}
auto rect = long_note.highlight.getTextureRect();
const float scale = square_size / rect.width;
long_note.tail.setScale(scale, scale);
long_note.triangle.setScale(scale, scale);
long_note.backgroud.setScale(scale, scale);
long_note.background.setScale(scale, scale);
long_note.outline.setScale(scale, scale);
long_note.highlight.setScale(scale, scale);
long_note.tail.setPosition((x + 0.5f) * square_size, (y + 0.5f) * square_size);
long_note.triangle.setPosition((x + 0.5f) * square_size, (y + 0.5f) * square_size);
long_note.backgroud.setPosition((x + 0.5f) * square_size, (y + 0.5f) * square_size);
long_note.background.setPosition((x + 0.5f) * square_size, (y + 0.5f) * square_size);
long_note.outline.setPosition((x + 0.5f) * square_size, (y + 0.5f) * square_size);
long_note.highlight.setPosition((x + 0.5f) * square_size, (y + 0.5f) * square_size);
long_note.layer.draw(long_note.tail);
long_note.layer.draw(long_note.backgroud);
long_note.layer.draw(long_note.background);
long_note.layer.draw(long_note.outline);
long_note.layer.draw(long_note.triangle);
long_note.layer.draw(long_note.highlight);

View File

@ -34,7 +34,7 @@ public:
LNMarker marker;
sf::RenderTexture layer;
sf::Sprite backgroud;
sf::Sprite background;
sf::Sprite outline;
sf::Sprite highlight;
sf::Sprite tail;