Skip to content

Commit

Permalink
FS preview: find multiple tims in *.tim files (only for carbuncle mag…
Browse files Browse the repository at this point in the history
…ic effect)
  • Loading branch information
myst6re committed Mar 13, 2024
1 parent 05208ad commit 86e1e7b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion src/FF8Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ QByteArray FF8Image::toLzs(const QImage &image, quint16 u1, quint16 u2)

QList<int> 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;
Expand Down
14 changes: 0 additions & 14 deletions src/FsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 86e1e7b

Please sign in to comment.