From 86e1e7bfbdcb0690c032541aba9ec404366d7f24 Mon Sep 17 00:00:00 2001 From: myst6re Date: Wed, 13 Mar 2024 21:51:45 +0100 Subject: [PATCH] FS preview: find multiple tims in *.tim files (only for carbuncle magic effect) --- src/FF8Image.cpp | 2 +- src/FsDialog.cpp | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/FF8Image.cpp b/src/FF8Image.cpp index 5c7baaf..738c162 100644 --- a/src/FF8Image.cpp +++ b/src/FF8Image.cpp @@ -102,7 +102,7 @@ QByteArray FF8Image::toLzs(const QImage &image, quint16 u1, quint16 u2) QList FF8Image::findTims(const QByteArray &data) { - int indexInData = -1, dataSize = data.size(); + int indexInData = -4, dataSize = data.size(); qint32 palSize, imgSize; quint16 w, h; quint8 bpp; diff --git a/src/FsDialog.cpp b/src/FsDialog.cpp index e1035d7..f963387 100644 --- a/src/FsDialog.cpp +++ b/src/FsDialog.cpp @@ -167,12 +167,6 @@ void FsDialog::generatePreview() texFile.setCurrentColorTable(currentPal); preview->imagePreview(QPixmap::fromImage(texFile.image()), fileName, currentPal, texFile.colorTableCount()); } - else if (fileType == "tim") - { - TimFile timFile(data); - timFile.setCurrentColorTable(currentPal); - preview->imagePreview(QPixmap::fromImage(timFile.image()), fileName, currentPal, timFile.colorTableCount()); - } else if (fileType == "tdw") { preview->imagePreview(QPixmap::fromImage(TdwFile::image(data, TdwFile::Color(currentPal))), fileName, currentPal, 8); @@ -249,14 +243,6 @@ void FsDialog::exportImages() texFile.image().save(QString("%1/%2-%3.png").arg(path, fileName).arg(i)); } } - else if (fileType == "tim") - { - TimFile timFile(data); - for (int i = 0; i < timFile.colorTableCount(); ++i) { - timFile.setCurrentColorTable(i); - timFile.image().save(QString("%1/%2-%3.png").arg(path, fileName).arg(i)); - } - } else if (fileType == "tdw") { for (int i = 0; i < 8; ++i) {