From 4743368f11d86778b870fbf2cc4f370dac3faecc Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Mon, 9 Mar 2026 23:13:08 -0700 Subject: [PATCH] Fixed mipmaps not enabled. --- common/lc_library.cpp | 6 +++--- common/lc_texture.cpp | 6 ++---- common/lc_texture.h | 10 +++++----- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/common/lc_library.cpp b/common/lc_library.cpp index 68775054..2a9cf07c 100644 --- a/common/lc_library.cpp +++ b/common/lc_library.cpp @@ -236,7 +236,7 @@ lcTexture* lcPiecesLibrary::FindTexture(const char* TextureName, Project* Curren if (TextureFile.isFile()) { - lcTexture* Texture = lcLoadTexture(TextureFile.absoluteFilePath(), LC_TEXTURE_WRAPU | LC_TEXTURE_WRAPV); + lcTexture* Texture = lcLoadTexture(TextureFile.absoluteFilePath(), LC_TEXTURE_MIPMAPS); if (Texture) { @@ -425,7 +425,7 @@ bool lcPiecesLibrary::OpenArchive(std::unique_ptr File, lcZipFileType Zi if ((ZipFileType == lcZipFileType::Official && !memcmp(Name, "LDRAW/PARTS/TEXTURES/", 21)) || (ZipFileType == lcZipFileType::Unofficial && !memcmp(Name, "PARTS/TEXTURES/", 15))) { - lcTexture* Texture = new lcTexture(); + lcTexture* Texture = new lcTexture(LC_TEXTURE_MIPMAPS); mTextures.push_back(Texture); *Dst = 0; @@ -652,7 +652,7 @@ bool lcPiecesLibrary::OpenDirectory(const QDir& LibraryDir, bool ShowProgress) continue; *Dst = 0; - lcTexture* Texture = new lcTexture(); + lcTexture* Texture = new lcTexture(LC_TEXTURE_MIPMAPS); mTextures.push_back(Texture); strncpy(Texture->mName, Name, sizeof(Texture->mName)); diff --git a/common/lc_texture.cpp b/common/lc_texture.cpp index 1dbd01e2..1ea7a055 100644 --- a/common/lc_texture.cpp +++ b/common/lc_texture.cpp @@ -32,11 +32,9 @@ void lcReleaseTexture(lcTexture* Texture) delete Texture; } -lcTexture::lcTexture() +lcTexture::lcTexture(int Flags) + : mFlags(Flags) { - mTexture = 0; - mRefCount = 0; - mTemporary = false; } lcTexture::~lcTexture() diff --git a/common/lc_texture.h b/common/lc_texture.h index 4a5e4201..4f993842 100644 --- a/common/lc_texture.h +++ b/common/lc_texture.h @@ -20,7 +20,7 @@ class lcTexture { public: - lcTexture(); + lcTexture(int Flags = 0); ~lcTexture(); lcTexture(const lcTexture&) = delete; @@ -89,16 +89,16 @@ public: int mHeight; char mName[LC_TEXTURE_NAME_LEN]; QString mFileName; - GLuint mTexture; + GLuint mTexture = 0; protected: bool Load(); bool LoadImages(); - bool mTemporary; - QAtomicInt mRefCount; + bool mTemporary = false; + QAtomicInt mRefCount = 0; std::vector mImages; - int mFlags; + int mFlags = 0; bool mLoading = false; };