first try at libplist patch to build with msbuild

This commit is contained in:
Harvey Fong 2025-04-10 19:19:57 -06:00
parent e427eab5ff
commit e985c74aac
5 changed files with 2154 additions and 4 deletions

View File

@ -77,8 +77,20 @@ make
``` ```
mkdir workdir mkdir workdir
git clone https://github.com/lzfse/lzfse git clone https://github.com/lzfse/lzfse
mkdir -p lzfse/build
cd lzfse/build
cmake ..
msbuild lzfse.vcxproj /p:Configuration=release /p:Platform=x64 /p:PlatformToolset=v143
cd ../..
git clone https://github.com/libimobiledevice/libplist
git clone https://github.com/jpaver/opengametools.git git clone https://github.com/jpaver/opengametools.git
git clone https://github.com/oomer/vmax2bella.git git clone https://github.com/oomer/vmax2bella.git
cp vmax2bella/patch_libplist/libplist.vcxproj ../libplist
cp vmax2bella/patch_libplist/cnary.c ../libplist/libcnary/cnary.c
cp vmax2bella/patch_libplist/plist.c ../libplist/libcnary/plist.c
cd libplist
msbuild libplist.vcxproj /p:Configuration=release /p:Platform=x64 /p:PlatformToolset=v143
cd ..
cd vmax2bella cd vmax2bella
msbuild vox2bella.vcxproj /p:Configuration=release /p:Platform=x64 /p:PlatformToolset=v143 msbuild vmax2bella.vcxproj /p:Configuration=release /p:Platform=x64 /p:PlatformToolset=v143
``` ```

47
patch_libplist/cnary.c Normal file
View File

@ -0,0 +1,47 @@
/*
* cnary.c
*
* Created on: Mar 9, 2011
* Author: posixninja
*
* Copyright (c) 2011 Joshua Hill. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include "node.h"
int main(int argc, char* argv[]) {
puts("Creating root node");
node_t root = node_create(NULL, NULL);
puts("Creating child 1 node");
node_t one = node_create(root, NULL);
puts("Creating child 2 node");
node_t two = node_create(root, NULL);
puts("Creating child 3 node");
node_t three = node_create(one, NULL);
puts("Debugging root node");
node_debug(root);
puts("Destroying root node");
node_destroy(root);
return 0;
}

View File

@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{A34F0D57-E086-45B3-9A7D-8A04CAD3AFEF}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>libplist</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>WIN32;_WINDOWS;_USRDLL;LIBPLIST_EXPORTS;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)include;$(ProjectDir)src;$(ProjectDir)libcnary\include;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<DisableSpecificWarnings>4244;4267;4146</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\base64.c" />
<ClCompile Include="src\bplist.c" />
<ClCompile Include="src\bytearray.c" />
<ClCompile Include="src\hashtable.c" />
<ClCompile Include="src\jplist.c" />
<ClCompile Include="src\jsmn.c" />
<ClCompile Include="src\oplist.c" />
<ClCompile Include="src\plist.c" />
<ClCompile Include="src\ptrarray.c" />
<ClCompile Include="src\time64.c" />
<ClCompile Include="src\xplist.c" />
<ClCompile Include="libcnary\node.c" />
<ClCompile Include="libcnary\node_list.c" />
<ClCompile Include="libcnary\cnary.c" />
<ClCompile Include="src\out-default.c" />
<ClCompile Include="src\out-limd.c" />
<ClCompile Include="src\out-plutil.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\base64.h" />
<ClInclude Include="src\bytearray.h" />
<ClInclude Include="src\hashtable.h" />
<ClInclude Include="src\jsmn.h" />
<ClInclude Include="src\plist.h" />
<ClInclude Include="src\ptrarray.h" />
<ClInclude Include="src\strbuf.h" />
<ClInclude Include="src\time64.h" />
<ClInclude Include="src\time64_limits.h" />
<ClInclude Include="include\plist\plist.h" />
<ClInclude Include="src\config.h" />
<ClInclude Include="libcnary\include\node.h" />
<ClInclude Include="libcnary\include\node_list.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

1969
patch_libplist/plist.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -591,6 +591,7 @@ dl::bella_sdk::Node addModelToScene(dl::Args& args,
canonicalName + dl::String("vmaxMat") + dl::String(material) + dl::String("Color") + dl::String(color)); canonicalName + dl::String("vmaxMat") + dl::String(material) + dl::String("Color") + dl::String(color));
bool isMesh = false; bool isMesh = false;
bool isBox = true; bool isBox = true;
std::cout << vmaxMaterial[material].roughness << std::endl;
if(material==7) { if(material==7) {
belMaterial["type"] = "liquid"; belMaterial["type"] = "liquid";
@ -601,8 +602,8 @@ dl::bella_sdk::Node addModelToScene(dl::Args& args,
isBox = false; isBox = false;
} else if(material==6 || vmaxPalette[color-1].a < 255) { } else if(material==6 || vmaxPalette[color-1].a < 255) {
belMaterial["type"] = "glass"; belMaterial["type"] = "glass";
belMaterial["roughness"] = vmaxMaterial[material].roughness * 100.0f; belMaterial["roughness"] = vmaxMaterial[material].roughness/.9f * 100.0f;
belMaterial["glassDepth"] = 500.0f; belMaterial["glassDepth"] = 1500.0f;
} else if(vmaxMaterial[material].metalness > 0.1f) { } else if(vmaxMaterial[material].metalness > 0.1f) {
belMaterial["type"] = "metal"; belMaterial["type"] = "metal";
belMaterial["roughness"] = vmaxMaterial[material].roughness * 100.0f; belMaterial["roughness"] = vmaxMaterial[material].roughness * 100.0f;
@ -613,12 +614,14 @@ dl::bella_sdk::Node addModelToScene(dl::Args& args,
belMaterial["type"] = "emitter"; belMaterial["type"] = "emitter";
belMaterial["emitterUnit"] = "radiance"; belMaterial["emitterUnit"] = "radiance";
belMaterial["energy"] = vmaxMaterial[material].emission*1.0f; belMaterial["energy"] = vmaxMaterial[material].emission*1.0f;
} else if(vmaxMaterial[material].roughness > 0.8999f) {
belMaterial["type"] = "diffuse";
} else { } else {
belMaterial["type"] = "plastic"; belMaterial["type"] = "plastic";
belMaterial["roughness"] = vmaxMaterial[material].roughness * 100.0f; belMaterial["roughness"] = vmaxMaterial[material].roughness * 100.0f;
} }
if (args.have("bevel")) { if (args.have("bevel") && material != 7) {
belMaterial["bevel"] = belBevel; belMaterial["bevel"] = belBevel;
} }
if (args.have("mode") && args.value("mode") == "mesh" || args.value("mode") == "both") { if (args.have("mode") && args.value("mode") == "mesh" || args.value("mode") == "both") {