use static QImage for collision pixmap copying

This commit is contained in:
garak 2023-01-11 15:20:54 -05:00 committed by t
parent c7d548bfc3
commit 1ed2f1d206

View file

@ -8,10 +8,10 @@ QImage getCollisionMetatileImage(Block block) {
}
QImage getCollisionMetatileImage(int collision, int elevation) {
static const QImage collisionImage(":/images/collisions.png");
int x = (collision != 0) * 16;
int y = elevation * 16;
QPixmap collisionImage = QPixmap(":/images/collisions.png").copy(x, y, 16, 16);
return collisionImage.toImage();
return collisionImage.copy(x, y, 16, 16);
}
QImage getMetatileImage(