summaryrefslogtreecommitdiffstats
path: root/sigmodr/TileUI.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-10-13 21:05:50 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-10-13 21:05:50 +0000
commit460e7bdf3f6c1de69f41b02a16deb85522ae3c49 (patch)
tree3b80ad00d5f021f63d3f890af2e017af314d2106 /sigmodr/TileUI.cpp
parentb427a8cdf13aabe59af60acf0a4264d84ae3ff7a (diff)
downloadsigen-460e7bdf3f6c1de69f41b02a16deb85522ae3c49.tar.gz
sigen-460e7bdf3f6c1de69f41b02a16deb85522ae3c49.tar.xz
sigen-460e7bdf3f6c1de69f41b02a16deb85522ae3c49.zip
[FIX] Sprite no longer stores a QImage, but a QByteArray
[FIX] Preparing for move to a collaged map instead of a tiled map git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@278 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'sigmodr/TileUI.cpp')
-rw-r--r--sigmodr/TileUI.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/sigmodr/TileUI.cpp b/sigmodr/TileUI.cpp
index acab991f..f360f438 100644
--- a/sigmodr/TileUI.cpp
+++ b/sigmodr/TileUI.cpp
@@ -49,16 +49,22 @@ void Sigmodr::TileUI::initGui()
void Sigmodr::TileUI::refreshGui()
{
+ int maxHeight = 0;
+ int maxWidth = 0;
const bool blocked = varSprite->blockSignals(true);
varSprite->clear();
for (int i = 0; i < sigmod()->spriteCount(); ++i)
{
const Sigmod::Sprite* sprite = sigmod()->sprite(i);
- if (sprite->sprite().size() == QSize(64, 64))
- varSprite->addItem(QPixmap::fromImage(sprite->sprite()), sprite->name(), sprite->id());
+ QPixmap icon;
+ icon.loadFromData(sprite->sprite());
+ maxHeight = qMax(maxHeight, icon.height());
+ maxWidth = qMax(maxWidth, icon.width());
+ varSprite->addItem(icon, sprite->name(), sprite->id());
}
varSprite->blockSignals(blocked);
- varSprite->setIconSize(QSize(64, 64));
+ const QSize maxSize(maxWidth, maxHeight);
+ varSprite->setIconSize(maxSize);
}
void Sigmodr::TileUI::setGui()