Skip to content

Commit

Permalink
More lpub3d_build to master branch updates
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed Oct 2, 2024
1 parent 0d83549 commit c23ff51
Show file tree
Hide file tree
Showing 22 changed files with 1,361 additions and 961 deletions.
5 changes: 5 additions & 0 deletions ChangeHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ <h2>Change history</h2>
(23 Apr, 2023)
</td>
<td colspan="2">
<b>Additions</b>
<ul>
<li>Added support for custom config LDraw file.</li>
</ul>
<b>Updates</b>
<ul>
<li>Optimize checking for library updates to finish quickly when the latest
Expand Down Expand Up @@ -265,6 +269,7 @@ <h2>Change history</h2>
Visual Studio 2017 compiler for Windows XP compatibility.)</li>
<li><b>Mac:</b> Now requires macOS 10.9 Mavericks or later.</li>
<li><b>Mac:</b> No longer uses drawers (which are deprecated).</li>
<li><b>Mac:</b> Updated icon to Big Sur style.</li>
</ul>
<b>Bug Fixes</b>
<ul>
Expand Down
50 changes: 44 additions & 6 deletions Help.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
<li><a href="#GeneralTab">General Tab</a>
<ul>
<li><a href="#GeneralAABox">Antialiasing Box</a></li>
<li><a href="#GeneralCustomConfigBox">Custom Config Box</a></li>
<li><a href="#GeneralColorsBox">Colors Box</a></li>
<li><a href="#GeneralMiscBox">Misc Box</a></li>
</ul></li>
Expand Down Expand Up @@ -1599,6 +1600,19 @@ <h3><a name="3dsExport">3D-Studio file:</a></h3>
Antialiasing</a> is enabled.
</p>

<p>
<span class="SubHeader2"><a name="GeneralCustomConfigBox">Custom Config Box</a></span><br/>
<i><a name="CustomConfig">Text Field</a></i> (Default: <i>Blank</i>):<br/>
This text field allows you to enter or paste the full path to an LDraw file that
you want to use for custom config. It is expected that a custom config file
would normally contain custom color definitions that get loaded after the
standard ones in LDConfig.ldr (if that is enabled). It can thus override any
colors that are defined in LDConfig.ldr, as well as define new colors.<br/>
The file can contain any valid LDraw statements, including geometry, but any
geometry specified by this file will be drawn in addition to any file that is
loaded. The geometry will not be included in model size calculations, so it may
be cropped.
</p>

<p>
<span class="SubHeader2"><a name="GeneralColorsBox">Colors Box</a></span><br/>
Expand All @@ -1619,9 +1633,9 @@ <h3><a name="3dsExport">3D-Studio file:</a></h3>
Enabling this option causes default-colored items to be transparent.
</p>
<p>
<i><a name="ProcessLDConfig">Process ldconfig.ldr</a></i>
<i><a name="ProcessLDConfig">Process LDConfig.ldr</a></i>
(Default: <i>On</i>):<br/>
This controls whether or not LDView processes the ldconfig.ldr file that is now
This controls whether or not LDView processes the LDConfig.ldr file that is now
distributed as part of the LDraw parts library. This file contains settings
that can effect how LDraw models are displayed. Currently the only settings it
contains are color definitions. Enabling this option will use the LDraw.org
Expand Down Expand Up @@ -1926,8 +1940,8 @@ <h3><a name="3dsExport">3D-Studio file:</a></h3>
useful to part authors, as it causes the edge lines for the default color (light
gray) to be much more visible. Dark gray edges are used on dark colors, and
black edges are used on all other colors.<br/>
If <a href="#ProcessLDConfig"><i>Process ldconfig.ldr</i></a> is checked in the
General Preferences, LDView will look for a entries in ldconfig.ldr with color
If <a href="#ProcessLDConfig"><i>Process LDConfig.ldr</i></a> is checked in the
General Preferences, LDView will look for a entries in LDConfig.ldr with color
names of Black_Edge and Dark_Gray_Edge. If it finds either entry, it will use
that color instead of black or dark gray.
</p>
Expand Down Expand Up @@ -2757,9 +2771,17 @@ <h3><a name="3dsExport">3D-Studio file:</a></h3>
Example:
</p>
<PRE>
LDView -LDConfig=LDConfig_TLG.ldr
LDView -LDConfig=LDCfgalt.ldr
</PRE>
<p>
<div class="Note">
<div>Note:</div>
<div>If you just want to override a few colors from the standard
LDConfig.ldr, you can do that by setting a
<a href="#GeneralCustomConfigBox">Custom Config</a>.</div>
</div>
</p>
<p>
<span class="SubHeader"><a name="L3PCompatibility">L3P-compatible
Options</a></span><br/>
</p>
Expand Down Expand Up @@ -3191,6 +3213,22 @@ <h3><a name="3dsExport">3D-Studio file:</a></h3>
on the Color dialog box.
</td>
</tr>
<tr>
<td valign="top">
CustomConfigPath
</td>
<td valign="top">
String
</td>
<td valign="top">
NO
</td>
<td valign="top">
Equivalent to the value in the text field in the
<a href="#GeneralCustomConfigBox"><i>General-&gt;Custom
config</i></a> box.
</td>
</tr>
<tr>
<td valign="top">
CutawayAlpha
Expand Down Expand Up @@ -4400,7 +4438,7 @@ <h3><a name="3dsExport">3D-Studio file:</a></h3>
NO
</td>
<td valign="top">
Equivalent to the <i>Process ldconfig.ldr</i> check box in the
Equivalent to the <i>Process LDConfig.ldr</i> check box in the
<i>General-&gt;Misc</i> box.
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion LDExporter/LD3dsExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ int LD3dsExporter::doExport(LDLModel *pTopModel)
//}
// LPub3D Mod - return 0 fix
if (lib3ds_file_save(m_file, m_filename.c_str()))
// LPub3D Mod End
// LPub3D Mod End
{
retVal = 0;
}
Expand Down
24 changes: 12 additions & 12 deletions LDExporter/LDExportMessages.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ LDXResetGroup =Reset Group
PovErrorCreatingPov =Error creating POV file.\n
PovTypeDescription =POV: POV-Ray Scene File
PovFindReplacements =Search for POV replacements for LDraw parts
PovFindReplacementsTT1 =If you check this, you can put POV include files in a pov subdirectory of your LDraw directory and
PovFindReplacementsTT2 =have LDView use those as replacements for part files. In order for this to work, you must put your part files
PovFindReplacementsTT3 =in the <LDraw directory>/pov/parts directory, and put your primitive files in the <LDraw directory>/pov/p
PovFindReplacementsTT1 =If you check this, you can put POV include files in a pov subdirectory of your LDraw directory and
PovFindReplacementsTT2 =have LDView use those as replacements for part files. In order for this to work, you must put your part files
PovFindReplacementsTT3 =in the <LDraw directory>/pov/parts directory, and put your primitive files in the <LDraw directory>/pov/p
PovFindReplacementsTT4 =directory. Give them the same filename as the LDraw file, but replace the .dat extension with .inc.
PovXmlMap =Use XML mapping file
PovXmlMapTT1 =Check this to have LDView use the specified XML mapping file to find POV replacements for LDraw parts. LDView's
PovXmlMapTT2 =default mapping file will work with LGEO parts. In order to render the POV file produced, you must have the associated
PovXmlMapTT1 =Check this to have LDView use the specified XML mapping file to find POV replacements for LDraw parts. LDView's
PovXmlMapTT2 =default mapping file will work with LGEO parts. In order to render the POV file produced, you must have the associated
PovXmlMapTT3 =POV parts library installed.
PovXmlMapPath =Path to XML mapping file:
PovXmlMapPathTT =If you leave this blank, and check "Use XML mapping file", LDView will use LGEO.xml in the LDView install directory.
PovInlinePov =Use inline POV statements in LDraw parts
PovInlinePovTT1 =Some LDraw files contain L3P-compatible statements that allow the LDraw geometry in the file to be
PovInlinePovTT1 =Some LDraw files contain L3P-compatible statements that allow the LDraw geometry in the file to be
PovInlinePovTT2 =replaced with native POV geometry. Check this if you want to use that native POV geometry.
PovHideStuds =Hide studs
PovSmoothCurves =Smooth curves
PovUnmirrorStuds =Fix mirrored stud logos
PovUnmirrorStudsTT1 =If the model contains sections that are mirrored, the stud logos will be mirrored if this option isn't enabled.\r\n
PovUnmirrorStudsTT2 =However, this is only pertinent if Quality is set to "Include stud logos", and it increases the size of the POV
PovUnmirrorStudsTT2 =However, this is only pertinent if Quality is set to "Include stud logos", and it increases the size of the POV
PovUnmirrorStudsTT3 =file, so there's no point enabling this if quality is set lower than "Include stud logos".
PovEdgeRadius =Edge line radius:
PovQuality =Quality:
Expand Down Expand Up @@ -69,13 +69,13 @@ PovFloorAxisX =X
PovFloorAxisY =Y
PovFloorAxisZ =Z
PovTopInclude =Top include filename (empty for no top include):
PovTopIncludeTT1 =If present, the given filename will be used in a #include statement near
PovTopIncludeTT2 =the top of the POV file. Since it is just under the initial list of
PovTopIncludeTT3 =definitions, you can redifine things from that list, and your definitions
PovTopIncludeTT1 =If present, the given filename will be used in a #include statement near
PovTopIncludeTT2 =the top of the POV file. Since it is just under the initial list of
PovTopIncludeTT3 =definitions, you can redifine things from that list, and your definitions
PovTopIncludeTT4 =will be used instead of the LDView-generated ones.\r\n
PovTopIncludeTT5 =Note that POV-Ray must be able to find the given include file.
PovBottomInclude =Bottom include filename (empty for no bottom include):
PovBottomIncludeTT1 =If present, the given filename will be used in a #include statement at
PovBottomIncludeTT1 =If present, the given filename will be used in a #include statement at
PovBottomIncludeTT2 =the end of the generated POV file.\r\n
PovBottomIncludeTT3 =Note that POV-Ray must be able to find the given include file.
PovAspectRatio =Aspect Ratio:
Expand All @@ -84,7 +84,7 @@ PovCustom =Custom
PovFileVersion =Target POV-Ray Version:
; Note: "Custom" below needs to match whatever you put in PovCustom above.
PovCustomAspectRatio =Custom aspect ratio (must select "Custom" above):
PovCustomAspectRatioTT1 =Select "Custom" for the "Aspect Ratio" setting, then enter any aspect
PovCustomAspectRatioTT1 =Select "Custom" for the "Aspect Ratio" setting, then enter any aspect
PovCustomAspectRatioTT2 =ratio you want here.
; LD3dsExporter.cpp
Expand Down
6 changes: 5 additions & 1 deletion LDExporter/LDExporterSetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,13 @@ void LDExporterSetting::reset(bool commit /*= false*/)
ucstring povLights;
mbstoucstring(povLights, TCObject::ls("PovLights"));
if (getName() == povLights)
{
setValue(mbstoucstring(TCUserDefaults::defaultStringForKey(m_key.c_str())), commit);
}
else
setValue(TCUserDefaults::defaultStringForKeyUC(m_key.c_str()), commit);
{
setValue(TCUserDefaults::defaultStringForKeyUC(m_key.c_str()), commit);
}
}
// LPub3D Mod End
break;
Expand Down
10 changes: 5 additions & 5 deletions LDLib/LDPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ void LDPreferences::applyPrimitivesSettings(void)
m_modelViewer->setTexturesAfterTransparent(true);
m_modelViewer->setTextureOffsetFactor(m_textureOffsetFactor);
m_modelViewer->setUseStrips(m_useStrips);
// LPub3D Mod - stud style

// LPub3D Mod - stud style
m_modelViewer->setStudCylinderColor(m_studCylinderColor);
m_modelViewer->setPartEdgeColor(m_partEdgeColor);
m_modelViewer->setBlackEdgeColor(m_blackEdgeColor);
Expand Down Expand Up @@ -642,7 +642,7 @@ void LDPreferences::loadDefaultPrimitivesSettings(bool initializing /*= true*/)
setTexmaps(true);
setTextureOffsetFactor(5.0);
setUseStrips(true);

// LPub3D Mod - stud style
setStudCylinderColor(27, 42, 52, 255);
setPartEdgeColor(0, 0, 0, 255);
Expand Down Expand Up @@ -860,7 +860,7 @@ void LDPreferences::loadPrimitivesSettings(void)
m_textureOffsetFactor = getFloatSetting(TEXTURE_OFFSET_FACTOR_KEY,
m_textureOffsetFactor);
m_useStrips = getBoolSetting(STRIPS_KEY, m_useStrips);

// LPub3D Mod - stud style
m_studCylinderColor = (TCULong)getRGBAFromStringSetting(STUD_CYLINDER_COLOR_KEY, m_studCylinderColor);
m_partEdgeColor = (TCULong)getRGBAFromStringSetting(PART_EDGE_COLOR_KEY, m_partEdgeColor);
Expand Down Expand Up @@ -1052,7 +1052,7 @@ void LDPreferences::commitPrimitivesSettings(bool flush /*= true*/)
setTexmaps(m_texmaps, true);
setTextureOffsetFactor(m_textureOffsetFactor, true);
setUseStrips(m_useStrips, true);

// LPub3D Mod - stud style
int r, g, b, a;
getRGBA(m_studCylinderColor, r, g, b, a);
Expand Down
4 changes: 2 additions & 2 deletions LDLib/LDPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class LDPreferences : public TCAlertSender
void setTexturesAfterTransparent(bool value, bool commit = false, bool apply = false);
void setTextureOffsetFactor(TCFloat value, bool commit = false, bool apply = false);
void setUseStrips(bool value, bool commit = false, bool apply = false);

// LPub3D Mod - stud style
void setStudCylinderColor(int r, int g, int b, int a, bool commit = false);
void setPartEdgeColor(int r, int g, int b, int a, bool commit = false);
Expand Down Expand Up @@ -542,7 +542,7 @@ class LDPreferences : public TCAlertSender
bool m_texmaps;
TCFloat m_textureOffsetFactor;
bool m_useStrips;

// LPub3D Mod - stud style
TCULong m_studCylinderColor;
TCULong m_partEdgeColor;
Expand Down
12 changes: 6 additions & 6 deletions LDLib/LDSnapshotTaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,11 @@ bool LDSnapshotTaker::exportFiles(bool *tried /*= nullptr*/)
for (i = 0; i < count && (exportFiles || !retValue); ++i)
{
std::string arg = unhandledArgs->stringAtIndex(i);

if (arg[0] != '-' && arg[0] != 0)
{
std::string exportFilename;

if (isFileUri(arg))
{
m_fileUri = arg;
Expand Down Expand Up @@ -768,7 +768,7 @@ bool LDSnapshotTaker::saveImage(bool *tried /*= nullptr*/)
for (i = 0; i < count && (saveSnapshots || !retValue); i++)
{
std::string arg = unhandledArgs->stringAtIndex(i);

if (arg[0] != '-' && arg[0] != 0)
{
std::string imageFilename;
Expand Down Expand Up @@ -1281,7 +1281,7 @@ static void testZMap(const char *filename)
{
FILE *zMapFile = ucfopen(filename, "rb");
TCImage *image = new TCImage;

if (testZMap2(zMapFile, image))
{
std::string pngFilename = filename;
Expand Down Expand Up @@ -1842,7 +1842,7 @@ LDConsoleAlertHandler* LDSnapshotTaker::getConsoleAlertHandler(void)
int verbosity = 1;
TCStringArray *unhandledArgs =
TCUserDefaults::getUnhandledCommandLineArgs();

if (unhandledArgs != NULL)
{
size_t count = unhandledArgs->getCount();
Expand Down Expand Up @@ -2104,7 +2104,7 @@ std::string LDSnapshotTaker::extensionForType(
if (includeDot)
{
std::string retValue(".");

retValue += extensionForType(type, false);
return retValue;
}
Expand Down
4 changes: 4 additions & 0 deletions LDLoader/LDLPrimitiveCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,13 @@ bool LDLPrimitiveCheck::performPrimitiveSubstitution(
{
// LPub3D Mod - stud style
if (TCUserDefaults::longForKey("StudStyle", 0, 0))
{
return false;
}
else
{
return substituteStud();
}
// LPub3D Mod End
}
else if (strcasecmp(m_modelName, "1-8sphe.dat") == 0)
Expand Down
8 changes: 4 additions & 4 deletions LDView.iss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
; http://www.jrsoftware.org/isdl.php#qsp

#define AppFilename 'Build\Release\LDView.exe'
#define SetupFilename(str Filename) ParseVersion(Filename, Local[0], Local[1], Local[2], Local[3]), "LDView-" + Str(Local[0]) + Str(Local[1]) + (Local[2] < 10 ? '0' : '') + Str(Local[2])
#define SetupFilename(str Filename) GetVersionComponents(Filename, Local[0], Local[1], Local[2], Local[3]), "LDView-" + Str(Local[0]) + Str(Local[1]) + (Local[2] < 10 ? '0' : '') + Str(Local[2])

#define AppVerName GetFileDescription(AppFilename) + ' ' + GetFileVersionString(AppFilename)
#define IntallDescription AppVerName + ' Setup'
#define AppVersion GetFileVersion(AppFilename)
#define AppVersion GetVersionNumbersString(AppFilename)

[Setup]
AppName=LDView
Expand Down Expand Up @@ -48,7 +48,7 @@ Name: thumbnails; Description: Use LDView to generate thumbnails in Windows Expl
Name: prefsets; Description: Install preset Preference Sets; GroupDescription: Preference Sets:

[Files]
Source: Build\Release\LDView.exe; DestDir: {app}; Flags: ignoreversion
Source: Build\Release\LDView.exe; DestDir: {app}; Flags: ignoreversion
Source: Build\Release\LDView.com; DestDir: {app}; Flags: ignoreversion
Source: license.txt; DestDir: {app}; Flags: ignoreversion
; NOTE: The first Readme.txt is for everything prior to Windows Vista, and can
Expand All @@ -70,7 +70,7 @@ Source: Build\Release64\LDViewThumbs64.dll; DestDir: {app}; Flags: 64bit ignorev

[Icons]
Name: {group}\LDView; Filename: {app}\LDView.exe
Name: {group}\LDView Home Page; Filename: {app}\LDView Home Page.url; IconFilename: {app}\LDView.exe
Name: {group}\LDView Home Page; Filename: {app}\LDView Home Page.url; IconFilename: {app}\LDView.exe
Name: {group}\Uninstall LDView; Filename: {uninstallexe}
Name: {commondesktop}\LDView; Filename: {app}\LDView.exe; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\LDView; Filename: {app}\LDView.exe; Tasks: quicklaunchicon
Expand Down
1 change: 1 addition & 0 deletions LDView.sln
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31321.278
Expand Down
6 changes: 3 additions & 3 deletions LDView64.iss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
; http://www.jrsoftware.org/isdl.php#qsp

#define AppFilename 'Build\Release64\LDView64.exe'
#define SetupFilename(str Filename) ParseVersion(Filename, Local[0], Local[1], Local[2], Local[3]), "LDView64-" + Str(Local[0]) + Str(Local[1]) + (Local[2] < 10 ? '0' : '') + Str(Local[2])
#define SetupFilename(str Filename) GetVersionComponents(Filename, Local[0], Local[1], Local[2], Local[3]), "LDView64-" + Str(Local[0]) + Str(Local[1]) + (Local[2] < 10 ? '0' : '') + Str(Local[2])

#define AppVerName GetFileDescription(AppFilename) + ' ' + GetFileVersionString(AppFilename) + ' (64-bit)'
#define IntallDescription AppVerName + ' Setup'
#define AppVersion GetFileVersion(AppFilename)
#define AppVersion GetVersionNumbersString(AppFilename)

[Setup]
ArchitecturesInstallIn64BitMode=x64
Expand Down Expand Up @@ -44,7 +44,7 @@ Name: prefsets; Description: Install preset Preference Sets; GroupDescription: P

[Files]
Source: Build\Release64\LDView64.exe; DestDir: {app}; Flags: ignoreversion
Source: Build\Release\LDView.com; DestDir: {app}; Flags: ignoreversion
Source: Build\Release\LDView.com; DestDir: {app}; Flags: ignoreversion
Source: license.txt; DestDir: {app}; Flags: ignoreversion
; NOTE: The first Readme.txt is for everything prior to Windows Vista, and can
; be shown at the end of the installation. However, since in Vista that
Expand Down
Loading

0 comments on commit c23ff51

Please sign in to comment.