Skip to content

Commit

Permalink
fix(gui): render models correctly on my linux machine again (Debian +…
Browse files Browse the repository at this point in the history
… KDE 5)
  • Loading branch information
craftablescience committed Aug 7, 2024
1 parent 59ca96b commit 2235900
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ CMakeSettings.json
build/
cmake-build-*/
out/

# Generated
**/generated/
4 changes: 2 additions & 2 deletions src/gui/previews/MDLPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ std::unique_ptr<MDLTextureData> getTextureDataForMaterial(const PackFile& packFi

VTF vtf{*textureFile};
return std::make_unique<MDLTextureData>(
vtf.getImageDataAsRGBA8888(),
vtf.getImageDataAs(ImageFormat::RGB888),
vtf.getWidth(),
vtf.getHeight()
);
Expand Down Expand Up @@ -162,7 +162,7 @@ void MDLWidget::setTextures(const std::vector<std::unique_ptr<MDLTextureData>>&
}
auto* texture = new QOpenGLTexture(QOpenGLTexture::Target::Target2D);
texture->create();
texture->setData(QImage(reinterpret_cast<uchar*>(vtf->data.data()), static_cast<int>(vtf->width), static_cast<int>(vtf->height), QImage::Format_RGBA8888));
texture->setData(QImage(reinterpret_cast<uchar*>(vtf->data.data()), static_cast<int>(vtf->width), static_cast<int>(vtf->height), QImage::Format_RGB888));
this->textures.push_back(texture);
}
}
Expand Down

0 comments on commit 2235900

Please sign in to comment.