Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/rendering/StarDrawablePainter.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-04-15 17:46:44 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2024-04-15 17:46:44 +1000
commit63c9e3ec8b51a9d96872a054a0d35e8591b3535d (patch)
tree7d5cfaea0e13eb34cc6db25df6054cae1a04677c /source/rendering/StarDrawablePainter.cpp
parent2a4bd826052102a0bb8858355e42b9cba06f2991 (diff)
only round vertices if AA is on
[skip ci]
Diffstat (limited to 'source/rendering/StarDrawablePainter.cpp')
-rw-r--r--source/rendering/StarDrawablePainter.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/source/rendering/StarDrawablePainter.cpp b/source/rendering/StarDrawablePainter.cpp
index 5f9fd79..88ca651 100644
--- a/source/rendering/StarDrawablePainter.cpp
+++ b/source/rendering/StarDrawablePainter.cpp
@@ -36,15 +36,13 @@ void DrawablePainter::drawDrawable(Drawable const& drawable) {
} else if (auto imagePart = drawable.part.ptr<Drawable::ImagePart>()) {
TexturePtr texture = m_textureGroup->loadTexture(imagePart->image);
+ Vec2F position = drawable.position;
Vec2F textureSize(texture->size());
- RectF imageRect(Vec2F(), textureSize);
-
- Mat3F transformation = Mat3F::translation(drawable.position) * imagePart->transformation;
-
- Vec2F lowerLeft = transformation.transformVec2(Vec2F(imageRect.xMin(), imageRect.yMin()));
- Vec2F lowerRight = transformation.transformVec2(Vec2F(imageRect.xMax(), imageRect.yMin()));
- Vec2F upperRight = transformation.transformVec2(Vec2F(imageRect.xMax(), imageRect.yMax()));
- Vec2F upperLeft = transformation.transformVec2(Vec2F(imageRect.xMin(), imageRect.yMax()));
+ Mat3F transformation = imagePart->transformation;
+ Vec2F lowerLeft = { transformation[0][2] += position.x(), transformation[1][2] += position.y() };
+ Vec2F lowerRight = transformation * Vec2F(textureSize.x(), 0.f);
+ Vec2F upperRight = transformation * textureSize;
+ Vec2F upperLeft = transformation * Vec2F(0.f, textureSize.y());
float param1 = drawable.fullbright ? 0.0f : 1.0f;