mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 07:22:43 +02:00
Fix QFile::open complaining the device was already open in
TextureBaker::processTexture
This commit is contained in:
parent
5e430c98c5
commit
3016860bab
1 changed files with 5 additions and 1 deletions
|
@ -205,7 +205,11 @@ QImage processRawImageData(QIODevice& content, const std::string& filename) {
|
|||
// Help the QImage loader by extracting the image file format from the url filename ext.
|
||||
// Some tga are not created properly without it.
|
||||
auto filenameExtension = filename.substr(filename.find_last_of('.') + 1);
|
||||
content.open(QIODevice::ReadOnly);
|
||||
if (!content.isReadable()) {
|
||||
content.open(QIODevice::ReadOnly);
|
||||
} else {
|
||||
content.reset();
|
||||
}
|
||||
|
||||
if (filenameExtension == "tga") {
|
||||
QImage image = image::readTGA(content);
|
||||
|
|
Loading…
Reference in a new issue