diff --git a/builds/linux/obs/PKGBUILD b/builds/linux/obs/PKGBUILD index 9ae9c4396..132b97805 100755 --- a/builds/linux/obs/PKGBUILD +++ b/builds/linux/obs/PKGBUILD @@ -2,7 +2,7 @@ # Last Update: July 19, 2020 # Copyright (C) 2017 - 2023 by Trevor SANDY pkgname=lpub3d -pkgver=2.4.6.3336 +pkgver=2.4.6.3337 pkgrel=1 pkgdesc="An LDraw Building Instruction Editor" url="https://github.com/trevorsandy/lpub3d.git" diff --git a/builds/linux/obs/alldeps/PKGBUILD b/builds/linux/obs/alldeps/PKGBUILD index 2632495fe..6a788b213 100644 --- a/builds/linux/obs/alldeps/PKGBUILD +++ b/builds/linux/obs/alldeps/PKGBUILD @@ -2,7 +2,7 @@ # Last Update: July 19, 2020 # Copyright (C) 2017 - 2023 by Trevor SANDY pkgname=lpub3d -pkgver=2.4.6.3336 +pkgver=2.4.6.3337 pkgrel=1 pkgdesc="An LDraw Building Instruction Editor" url="https://github.com/trevorsandy/lpub3d.git" diff --git a/builds/linux/obs/alldeps/debian/changelog b/builds/linux/obs/alldeps/debian/changelog index 5b051d544..c93d614da 100644 --- a/builds/linux/obs/alldeps/debian/changelog +++ b/builds/linux/obs/alldeps/debian/changelog @@ -1,5 +1,5 @@ -lpub3d (2.4.6.3336) debian; urgency=medium +lpub3d (2.4.6.3337) debian; urgency=medium - * LPub3D version 2.4.6.225.3336_20230508 for Linux + * LPub3D version 2.4.6.226.3337_20230508 for Linux - -- Trevor SANDY Mon, 08 May 2023 15:12:48 +0200 + -- Trevor SANDY Mon, 08 May 2023 15:13:18 +0200 diff --git a/builds/linux/obs/alldeps/debian/lpub3d.dsc b/builds/linux/obs/alldeps/debian/lpub3d.dsc index 817cf50ad..99a5c691a 100644 --- a/builds/linux/obs/alldeps/debian/lpub3d.dsc +++ b/builds/linux/obs/alldeps/debian/lpub3d.dsc @@ -2,7 +2,7 @@ Format: 1.0 Source: lpub3d Binary: lpub3d Architecture: any -Version: 2.4.6.3336 +Version: 2.4.6.3337 Maintainer: Trevor SANDY Homepage: https://trevorsandy.github.io/lpub3d/ Standards-Version: 3.9.7 diff --git a/builds/linux/obs/alldeps/lpub3d.spec b/builds/linux/obs/alldeps/lpub3d.spec index e1618223a..12f52c23d 100644 --- a/builds/linux/obs/alldeps/lpub3d.spec +++ b/builds/linux/obs/alldeps/lpub3d.spec @@ -120,7 +120,7 @@ BuildRequires: fdupes Summary: An LDraw Building Instruction Editor Name: lpub3d Icon: lpub3d.xpm -Version: 2.4.6.3336 +Version: 2.4.6.3337 Release: %{?dist} URL: https://trevorsandy.github.io/lpub3d Vendor: Trevor SANDY @@ -797,7 +797,7 @@ update-desktop-database || true %endif %changelog -* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3336 +* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3337 - LPub3D 2.4.4 enhancements and fixes - see RELEASE_NOTES for details * Tue May 31 2022 - trevor dot sandy at gmail dot com 2.4.4.2670 diff --git a/builds/linux/obs/debian/changelog b/builds/linux/obs/debian/changelog index 312dc0f11..88b2d9e69 100644 --- a/builds/linux/obs/debian/changelog +++ b/builds/linux/obs/debian/changelog @@ -1,5 +1,5 @@ -lpub3d (2.4.6.3336) debian; urgency=medium +lpub3d (2.4.6.3337) debian; urgency=medium - * LPub3D version 2.4.6.225.3336_20230508 for Linux + * LPub3D version 2.4.6.226.3337_20230508 for Linux - -- Trevor SANDY Mon, 08 May 2023 15:12:50 +0200 + -- Trevor SANDY Mon, 08 May 2023 15:13:20 +0200 diff --git a/builds/linux/obs/debian/lpub3d.dsc b/builds/linux/obs/debian/lpub3d.dsc index 6053d68e8..a1be25a25 100755 --- a/builds/linux/obs/debian/lpub3d.dsc +++ b/builds/linux/obs/debian/lpub3d.dsc @@ -2,7 +2,7 @@ Format: 1.0 Source: lpub3d Binary: lpub3d Architecture: any -Version: 2.4.6.3336 +Version: 2.4.6.3337 Maintainer: Trevor SANDY Homepage: https://trevorsandy.github.io/lpub3d/ Standards-Version: 3.9.7 diff --git a/builds/linux/obs/lpub3d.spec b/builds/linux/obs/lpub3d.spec index 4afefd06c..d014dfa5b 100755 --- a/builds/linux/obs/lpub3d.spec +++ b/builds/linux/obs/lpub3d.spec @@ -82,7 +82,7 @@ BuildRequires: fdupes Summary: An LDraw Building Instruction Editor Name: lpub3d Icon: lpub3d.xpm -Version: 2.4.6.3336 +Version: 2.4.6.3337 Release: 1%{?dist} URL: https://trevorsandy.github.io/lpub3d Vendor: Trevor SANDY @@ -313,7 +313,7 @@ update-desktop-database || true %endif %changelog -* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3336 +* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3337 - LPub3D 2.4.4 enhancements and fixes - see RELEASE_NOTES for details * Tue May 31 2022 - trevor dot sandy at gmail dot com 2.4.4.2670 diff --git a/builds/utilities/version.info b/builds/utilities/version.info index e60e2f1fe..5b0a6f896 100755 --- a/builds/utilities/version.info +++ b/builds/utilities/version.info @@ -1 +1 @@ -2 4 6 225 3336 603cfb074 +2 4 6 226 3337 28d281072 diff --git a/gitversion.pri b/gitversion.pri index 7d9a15d35..2887c8f3d 100644 --- a/gitversion.pri +++ b/gitversion.pri @@ -41,7 +41,7 @@ equals(GIT_DIR, undefined) { # Check if we do not have a valid version number (i.e. no version tag found) isEmpty(GIT_VERSION) { - GIT_REVISION = 225 + GIT_REVISION = 226 GIT_SHA = $$system($$GIT_BASE_COMMAND rev-parse --short HEAD 2> $$NULL_DEVICE) GIT_COMMIT = $$system($$GIT_BASE_COMMAND rev-list --count HEAD 2> $$NULL_DEVICE) GIT_VERSION = v$${VERSION}-$${GIT_REVISION}-$${GIT_SHA} @@ -69,7 +69,7 @@ equals(GIT_DIR, undefined) { # Get commit count GIT_COMMIT = $$system($$GIT_BASE_COMMAND rev-list --count HEAD 2> $$NULL_DEVICE) isEmpty(GIT_COMMIT) { - GIT_COMMIT = 3336 + GIT_COMMIT = 3337 message("~~~ ERROR! GIT_COMMIT NOT DEFINED, USING $$GIT_COMMIT ~~~") } @@ -117,7 +117,7 @@ if (equals(USE_GIT_VER_FILE, true)|equals(USE_VERSION_INFO_VAR, true)) { GIT_VERSION = $$cat($$GIT_VER_FILE, lines) } else { message("~~~ ERROR! $$GIT_DIR_ENV VERSION_INFO FILE $$GIT_VER_FILE NOT FOUND ~~~") - GIT_VERSION = $${VERSION}.225.3336.603cfb074 + GIT_VERSION = $${VERSION}.226.3337.28d281072 message("~~~ GIT_DIR [$$GIT_DIR_ENV, USING VERSION] $$GIT_VERSION ~~~") GIT_VERSION ~= s/\./" " } diff --git a/lclib/common/lc_colors.cpp b/lclib/common/lc_colors.cpp index c50a9ecaf..65bee3bba 100644 --- a/lclib/common/lc_colors.cpp +++ b/lclib/common/lc_colors.cpp @@ -94,11 +94,6 @@ static std::vector lcParseColorFile(lcFile& File) Color.Edge[1] = FLT_MAX; Color.Edge[2] = FLT_MAX; Color.Edge[3] = 1.0f; -/*** LPub3D Mod - use Visual Editor colors ***/ - Color.CValue = ~0U; - Color.EValue = ~0U; - Color.Alpha = 255; -/*** LPub3D Mod end ***/ GetToken(Ptr, Token); strncpy(Color.Name, Token, sizeof(Color.Name)); @@ -133,9 +128,7 @@ static std::vector lcParseColorFile(lcFile& File) int Value; if (sscanf(Token, "%x", &Value) != 1) Value = 0; -/*** LPub3D Mod - use Visual Editor colors ***/ - Color.CValue = Value; -/*** LPub3D Mod end ***/ + Color.Value[2] = (float)(Value & 0xff) / 255.0f; Value >>= 8; Color.Value[1] = (float)(Value & 0xff) / 255.0f; @@ -151,9 +144,6 @@ static std::vector lcParseColorFile(lcFile& File) int Value; if (sscanf(Token, "%x", &Value) != 1) Value = 0; -/*** LPub3D Mod - use Visual Editor colors ***/ - Color.EValue = Value; -/*** LPub3D Mod end ***/ Color.Edge[2] = (float)(Value & 0xff) / 255.0f; Value >>= 8; @@ -168,9 +158,7 @@ static std::vector lcParseColorFile(lcFile& File) Color.Value[3] = (float)(Value & 0xff) / 255.0f; if (Value != 255) Color.Translucent = true; -/*** LPub3D Mod - use Visual Editor colors ***/ - Color.Alpha = Value; -/*** LPub3D Mod end ***/ + if (Value == 128) Color.Group = LC_COLORGROUP_TRANSLUCENT; else if (Value != 0) @@ -290,11 +278,6 @@ bool lcLoadColorFile(lcFile& File, lcStudStyle StudStyle, bool Update, bool LPub MainColor.Edge[1] = 0.2f; MainColor.Edge[2] = 0.2f; MainColor.Edge[3] = 1.0f; -/*** LPub3D Mod - use Visual Editor colors ***/ - MainColor.CValue = lcColorFromVector3(lcVector3(MainColor.Value)); - MainColor.EValue = lcColorFromVector3(lcVector3(MainColor.Edge)); - MainColor.Alpha = 255; -/*** LPub3D Mod end ***/ strcpy(MainColor.Name, "Main Color"); strcpy(MainColor.SafeName, "Main_Color"); @@ -316,11 +299,6 @@ bool lcLoadColorFile(lcFile& File, lcStudStyle StudStyle, bool Update, bool LPub EdgeColor.Edge[1] = 0.2f; EdgeColor.Edge[2] = 0.2f; EdgeColor.Edge[3] = 1.0f; -/*** LPub3D Mod - use Visual Editor colors ***/ - EdgeColor.CValue = lcColorFromVector3(lcVector3(EdgeColor.Value)); - EdgeColor.EValue = lcColorFromVector3(lcVector3(EdgeColor.Edge)); - EdgeColor.Alpha = 255; -/*** LPub3D Mod end ***/ strcpy(EdgeColor.Name, "Edge Color"); strcpy(EdgeColor.SafeName, "Edge_Color"); @@ -337,11 +315,6 @@ bool lcLoadColorFile(lcFile& File, lcStudStyle StudStyle, bool Update, bool LPub StudCylinderColor.Group = LC_NUM_COLORGROUPS; StudCylinderColor.Value = lcVector4FromColor(Preferences.mStudCylinderColor); StudCylinderColor.Edge = lcVector4FromColor(Preferences.mPartEdgeColor); -/*** LPub3D Mod - use Visual Editor colors ***/ - StudCylinderColor.CValue = lcColorFromVector3(lcVector3(StudCylinderColor.Value)); - StudCylinderColor.EValue = lcColorFromVector3(lcVector3(StudCylinderColor.Edge)); - StudCylinderColor.Alpha = 255; -/*** LPub3D Mod end ***/ strcpy(StudCylinderColor.Name, "Stud Cylinder Color"); strcpy(StudCylinderColor.SafeName, "Stud_Cylinder_Color"); @@ -363,11 +336,6 @@ bool lcLoadColorFile(lcFile& File, lcStudStyle StudStyle, bool Update, bool LPub NoColor.Edge[1] = 0.2f; NoColor.Edge[2] = 0.2f; NoColor.Edge[3] = 1.0f; -/*** LPub3D Mod - use Visual Editor colors ***/ - NoColor.CValue = lcColorFromVector3(lcVector3(NoColor.Value)); - NoColor.EValue = lcColorFromVector3(lcVector3(NoColor.Edge)); - NoColor.Alpha = 255; -/*** LPub3D Mod end ***/ strcpy(NoColor.Name, "No Color"); strcpy(NoColor.SafeName, "No_Color"); diff --git a/lclib/common/lc_colors.h b/lclib/common/lc_colors.h index 6107e9183..6d127cf7c 100644 --- a/lclib/common/lc_colors.h +++ b/lclib/common/lc_colors.h @@ -18,11 +18,6 @@ struct lcColor lcVector4 Edge; char Name[LC_MAX_COLOR_NAME]; char SafeName[LC_MAX_COLOR_NAME]; -/*** LPub3D Mod - use Visual Editor colors ***/ - quint32 CValue; - quint32 EValue; - int Alpha; -/*** LPub3D Mod end ***/ }; enum diff --git a/lclib/common/lc_math.h b/lclib/common/lc_math.h index 157817f1c..ebc30d1b4 100644 --- a/lclib/common/lc_math.h +++ b/lclib/common/lc_math.h @@ -717,6 +717,13 @@ inline lcVector4 lcVector4FromColor(quint32 Color) return v; } +/*** LPub3D Mod - use Visual Editor colors ***/ +inline QColor lcQColorFromVector4(const lcVector4& Color) +{ + return QColor::fromRgb(roundf(Color[0] * 255), roundf(Color[1] * 255), roundf(Color[2] * 255), roundf(Color[3] * 255)); +} +/*** LPub3D Mod end ***/ + inline quint32 lcColorFromVector3(const lcVector3& Color) { return LC_RGB(roundf(Color[0] * 255), roundf(Color[1] * 255), roundf(Color[2] * 255)); diff --git a/mainApp/color.cpp b/mainApp/color.cpp index 53efa4f15..e726956bb 100644 --- a/mainApp/color.cpp +++ b/mainApp/color.cpp @@ -49,14 +49,14 @@ void LDrawColor::LDrawColorInit() for (lcColor& gColor : gColorList) { - lcColor* nativeColor = &gColor; - if (nativeColor->Code == quint32(LC_COLOR_NOCOLOR)) - continue; - QColor color(nativeColor->CValue); - color.setAlpha(nativeColor->Alpha); - QString const edge = QColor(nativeColor->EValue).name(QColor::HexRgb); - QString const name = nativeColor->SafeName; - QString const code = QString::number(nativeColor->Code); + if (gColor.Code == quint32(LC_COLOR_NOCOLOR)) + continue; + QColor color = lcQColorFromVector4(gColor.Value); + QColor edgecolor = lcQColorFromVector4(gColor.Edge); + QString const edge = edgecolor.name(edgecolor.alpha() != 255 ? QColor::HexArgb : QColor::HexRgb); + QString const name = gColor.SafeName; + QString const code = QString::number(gColor.Code); + AddColor(color, name, code, edge); } } @@ -66,28 +66,25 @@ void LDrawColor::LDrawColorInit() */ void LDrawColor::AddColor(const QColor& color, const QString& name, const QString& code, const QString& edge, bool native) { - ldname2ldcolor.insert(name.toLower(),code); // color code from name (lower) - value2code. insert(color.name(QColor::HexRgb).toLower(),code.toInt());// color code from value (lower) - color2value.insert(code,color.name(QColor::HexRgb).toUpper()); // color value from code - color2edge. insert(code,edge.toUpper()); // color edge from code - color2alpha.insert(code,color.alpha()); // color alpha from code - color2name. insert(code,name); // color name from code (safe name e.g. Dark_Nougat) - color2name. insert(color.name(QColor::HexRgb).toLower(),name); // color name from value (lower) - name2QColor.insert(code,color); // QColor object from code - name2QColor.insert(name.toLower(),color); // QColor object from name (lower) - e.g. dark_nougat + QColor::NameFormat format = QColor::HexRgb; + ldname2ldcolor.insert(name.toLower(),code); // color code from name (lower) + value2code. insert(color.name(format).toLower(),code.toInt());// color code from value (lower) + color2value.insert(code,color.name(format).toUpper()); // color value from code + color2edge. insert(code,edge.toUpper()); // color edge from code + color2alpha.insert(code,color.alpha()); // color alpha from code + color2name. insert(code,name); // color name from code (safe name e.g. Dark_Nougat) + color2name. insert(color.name(format).toLower(),name); // color name from value (lower) + name2QColor.insert(code,color); // QColor object from code + name2QColor.insert(name.toLower(),color); // QColor object from name (lower) - e.g. dark_nougat + QString const message = QObject::tr("%1. ADD 0 !COLOUR %2 CODE %3 VALUE %4 EDGE %5 ALPHA %6 QCOLOR_NAME %7") - .arg(ldname2ldcolor.size(), 3, 10, QChar(' ')).arg(name).arg(code).arg(color.name().toUpper()) - .arg(edge.toUpper()).arg(color.alpha()).arg(color.name()); + .arg(ldname2ldcolor.size(), 3, 10, QChar(' ')).arg(name).arg(code).arg(color.name().toUpper()) + .arg(edge.toUpper()).arg(color.alpha()).arg(color.name()); + //qDebug() << qUtf8Printable(message); if (!native) { userdefinedcolors.append(name.toLower()); emit lpub->messageSig(LOG_INFO, message); -#ifdef QT_DEBUG_MODE - } else { - ; - //qDebug() << qUtf8Printable(message); -#endif } - } /* diff --git a/mainApp/docs/README.txt b/mainApp/docs/README.txt index 02529639f..5ff8d7b48 100755 --- a/mainApp/docs/README.txt +++ b/mainApp/docs/README.txt @@ -1,4 +1,4 @@ -LPub3D 2.4.6.225.3336 (08 05 2023 15:12:50) +LPub3D 2.4.6.226.3337 (08 05 2023 15:13:20) Features, enhancements, fixes and changes ------------ diff --git a/mainApp/docs/RELEASE_NOTES.html b/mainApp/docs/RELEASE_NOTES.html index 7499166b0..9d5ea48ed 100644 --- a/mainApp/docs/RELEASE_NOTES.html +++ b/mainApp/docs/RELEASE_NOTES.html @@ -18,7 +18,7 @@
-

LPub3D 2.4.6.225.3336 (08 05 2023 15:12:50)

+

LPub3D 2.4.6.226.3337 (08 05 2023 15:13:20)


LPub3D Official release.
diff --git a/mainApp/editwindow.cpp b/mainApp/editwindow.cpp index 6a8b74ba5..833f5cc04 100644 --- a/mainApp/editwindow.cpp +++ b/mainApp/editwindow.cpp @@ -1233,7 +1233,7 @@ void EditWindow::editLineItem() int colorCode = elements.first().toInt(); int newColorIndex = -1; items = elements.at(1).split(" ", SkipEmptyParts); - QColor qcolor(gColorList[lcGetColorIndex(colorCode)].CValue); + QColor qcolor = lcQColorFromVector4(gColorList[lcGetColorIndex(colorCode)].Value); QColor newColor = LDrawColorDialog::getLDrawColor(colorCode, newColorIndex, this); if (newColor.isValid() && qcolor != newColor) { if (elements.size() == 3) // selection is a substitute meta command diff --git a/mainApp/extras/LPub3D_Npp_UDL.xml b/mainApp/extras/LPub3D_Npp_UDL.xml index 80a400a67..5f29fe875 100644 --- a/mainApp/extras/LPub3D_Npp_UDL.xml +++ b/mainApp/extras/LPub3D_Npp_UDL.xml @@ -14,8 +14,8 @@ ;; ;; Author......: Trevor SANDY ;; Name........: LPub3D_Npp_UDL.xml -;; Version.....: 2.4.6.225.3336 -;; Last Update.: Mon, 08 May 2023 15:12:50 +0200 +;; Version.....: 2.4.6.226.3337 +;; Last Update.: Mon, 08 May 2023 15:13:20 +0200 ;; License.....: GPLv3 ;; Homepage....: https://trevorsandy.github.io/lpub3d ;; Copyright (C) 2021 - 2023 by Trevor SANDY diff --git a/mainApp/substitutepartdialog.cpp b/mainApp/substitutepartdialog.cpp index f2e1650da..ea8647d06 100644 --- a/mainApp/substitutepartdialog.cpp +++ b/mainApp/substitutepartdialog.cpp @@ -261,7 +261,7 @@ void SubstitutePartDialog::initialize() ui->ldrawTitleLbl->setText(Pli::titleDescription(mLdrawType)); } - QColor partColor(gColorList[lcGetColorIndex(mAttributes.at(sColorCode).toInt())].CValue); + QColor partColor = lcQColorFromVector4(gColorList[lcGetColorIndex(mAttributes.at(sColorCode).toInt())].Value); if(partColor.isValid() ) { ui->colorLbl->setAutoFillBackground(true); QString styleSheet = @@ -631,7 +631,7 @@ void SubstitutePartDialog::browseType(bool clicked) void SubstitutePartDialog::browseColor(bool clicked) { Q_UNUSED(clicked); - QString colorName = QColor(gColorList[lcGetColorIndex(mAttributes.at(sColorCode).toInt())].CValue).name(); + QColor colorName = lcQColorFromVector4(gColorList[lcGetColorIndex(mAttributes.at(sColorCode).toInt())].Value).name(); int newColorIndex = ~0U; QColor newColor = LDrawColorDialog::getLDrawColor(mAttributes.at(sColorCode).toInt(),newColorIndex,this); QString newColorName = newColor.name();