libwz 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +165 -0
- package/binding.gyp +149 -0
- package/deps/tiny-aes/.github/workflows/c-cpp.yml +27 -0
- package/deps/tiny-aes/CMakeLists.txt +17 -0
- package/deps/tiny-aes/Makefile +61 -0
- package/deps/tiny-aes/README.md +83 -0
- package/deps/tiny-aes/aes.c +572 -0
- package/deps/tiny-aes/aes.h +91 -0
- package/deps/tiny-aes/aes.hpp +12 -0
- package/deps/tiny-aes/conanfile.py +73 -0
- package/deps/tiny-aes/library.json +19 -0
- package/deps/tiny-aes/library.properties +11 -0
- package/deps/tiny-aes/test.c +316 -0
- package/deps/tiny-aes/test.cpp +2 -0
- package/deps/tiny-aes/test_package/CMakeLists.txt +11 -0
- package/deps/tiny-aes/test_package/conanfile.py +17 -0
- package/deps/tiny-aes/unlicense.txt +24 -0
- package/deps/zlib/.cmake-format.yaml +245 -0
- package/deps/zlib/.github/workflows/c-std.yml +268 -0
- package/deps/zlib/.github/workflows/cmake.yml +147 -0
- package/deps/zlib/.github/workflows/configure.yml +146 -0
- package/deps/zlib/.github/workflows/contribs.yml +64 -0
- package/deps/zlib/.github/workflows/fuzz.yml +25 -0
- package/deps/zlib/.github/workflows/msys-cygwin.yml +92 -0
- package/deps/zlib/.github/workflows/others.yml +153 -0
- package/deps/zlib/BUILD.bazel +134 -0
- package/deps/zlib/CMakeLists.txt +310 -0
- package/deps/zlib/ChangeLog +1669 -0
- package/deps/zlib/FAQ +371 -0
- package/deps/zlib/INDEX +67 -0
- package/deps/zlib/LICENSE +22 -0
- package/deps/zlib/MODULE.bazel +9 -0
- package/deps/zlib/Makefile.in +426 -0
- package/deps/zlib/README +115 -0
- package/deps/zlib/README-cmake.md +79 -0
- package/deps/zlib/adler32.c +164 -0
- package/deps/zlib/amiga/Makefile.pup +69 -0
- package/deps/zlib/amiga/Makefile.sas +68 -0
- package/deps/zlib/compress.c +99 -0
- package/deps/zlib/configure +1078 -0
- package/deps/zlib/contrib/CMakeLists.txt +61 -0
- package/deps/zlib/contrib/README.contrib +57 -0
- package/deps/zlib/contrib/ada/CMakeLists.txt +217 -0
- package/deps/zlib/contrib/ada/buffer_demo.adb +106 -0
- package/deps/zlib/contrib/ada/cmake/Modules/CMakeADACompiler.cmake.in +23 -0
- package/deps/zlib/contrib/ada/cmake/Modules/CMakeADAInformation.cmake +133 -0
- package/deps/zlib/contrib/ada/cmake/Modules/CMakeDetermineADACompiler.cmake +33 -0
- package/deps/zlib/contrib/ada/cmake/Modules/CMakeTestADACompiler.cmake +46 -0
- package/deps/zlib/contrib/ada/cmake/binder_helper.cmake +47 -0
- package/deps/zlib/contrib/ada/cmake/compile_helper.cmake +32 -0
- package/deps/zlib/contrib/ada/cmake/exe_link_helper.cmake +53 -0
- package/deps/zlib/contrib/ada/cmake/shared_link_helper.cmake +52 -0
- package/deps/zlib/contrib/ada/cmake/static_link_helper.cmake +25 -0
- package/deps/zlib/contrib/ada/mtest.adb +156 -0
- package/deps/zlib/contrib/ada/read.adb +156 -0
- package/deps/zlib/contrib/ada/readme.txt +65 -0
- package/deps/zlib/contrib/ada/test.adb +463 -0
- package/deps/zlib/contrib/ada/zlib-streams.adb +225 -0
- package/deps/zlib/contrib/ada/zlib-streams.ads +114 -0
- package/deps/zlib/contrib/ada/zlib-thin.adb +142 -0
- package/deps/zlib/contrib/ada/zlib-thin.ads +450 -0
- package/deps/zlib/contrib/ada/zlib.adb +701 -0
- package/deps/zlib/contrib/ada/zlib.ads +328 -0
- package/deps/zlib/contrib/ada/zlib.gpr +20 -0
- package/deps/zlib/contrib/blast/CMakeLists.txt +166 -0
- package/deps/zlib/contrib/blast/Makefile +14 -0
- package/deps/zlib/contrib/blast/README +4 -0
- package/deps/zlib/contrib/blast/blast-test.c +42 -0
- package/deps/zlib/contrib/blast/blast.c +422 -0
- package/deps/zlib/contrib/blast/blast.h +84 -0
- package/deps/zlib/contrib/blast/blastConfig.cmake.in +18 -0
- package/deps/zlib/contrib/blast/test/CMakeLists.txt +193 -0
- package/deps/zlib/contrib/blast/test/add_subdirectory_exclude_test.cmake.in +27 -0
- package/deps/zlib/contrib/blast/test/add_subdirectory_test.cmake.in +25 -0
- package/deps/zlib/contrib/blast/test/find_package_no_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/blast/test/find_package_test.cmake.in +24 -0
- package/deps/zlib/contrib/blast/test/find_package_wrong_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/blast/test.pk +0 -0
- package/deps/zlib/contrib/blast/test.txt +1 -0
- package/deps/zlib/contrib/blast/tester.cmake +28 -0
- package/deps/zlib/contrib/crc32vx/CMakeLists.txt +67 -0
- package/deps/zlib/contrib/crc32vx/README +9 -0
- package/deps/zlib/contrib/crc32vx/crc32_vx.c +254 -0
- package/deps/zlib/contrib/crc32vx/crc32_vx_hooks.h +9 -0
- package/deps/zlib/contrib/delphi/ZLib.pas +557 -0
- package/deps/zlib/contrib/delphi/ZLibConst.pas +11 -0
- package/deps/zlib/contrib/delphi/readme.txt +76 -0
- package/deps/zlib/contrib/delphi/zlibd32.mak +99 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs +58 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs +202 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs +83 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/CodecBase.cs +198 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/Deflater.cs +106 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/DotZLib.cs +288 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj +141 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/GZipStream.cs +301 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/Inflater.cs +105 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/UnitTests.cs +274 -0
- package/deps/zlib/contrib/dotzlib/DotZLib.build +33 -0
- package/deps/zlib/contrib/dotzlib/DotZLib.chm +0 -0
- package/deps/zlib/contrib/dotzlib/DotZLib.sln +21 -0
- package/deps/zlib/contrib/dotzlib/LICENSE_1_0.txt +23 -0
- package/deps/zlib/contrib/dotzlib/readme.txt +58 -0
- package/deps/zlib/contrib/gcc_gvmat64/CMakeLists.txt +19 -0
- package/deps/zlib/contrib/gcc_gvmat64/gvmat64.S +570 -0
- package/deps/zlib/contrib/infback9/CMakeLists.txt +19 -0
- package/deps/zlib/contrib/infback9/README +1 -0
- package/deps/zlib/contrib/infback9/infback9.c +603 -0
- package/deps/zlib/contrib/infback9/infback9.h +37 -0
- package/deps/zlib/contrib/infback9/inffix9.h +107 -0
- package/deps/zlib/contrib/infback9/inflate9.h +47 -0
- package/deps/zlib/contrib/infback9/inftree9.c +319 -0
- package/deps/zlib/contrib/infback9/inftree9.h +61 -0
- package/deps/zlib/contrib/iostream/test.cpp +24 -0
- package/deps/zlib/contrib/iostream/zfstream.cpp +329 -0
- package/deps/zlib/contrib/iostream/zfstream.h +128 -0
- package/deps/zlib/contrib/iostream2/zstream.h +306 -0
- package/deps/zlib/contrib/iostream2/zstream_test.cpp +25 -0
- package/deps/zlib/contrib/iostream3/CMakeLists.txt +200 -0
- package/deps/zlib/contrib/iostream3/README +35 -0
- package/deps/zlib/contrib/iostream3/TODO +17 -0
- package/deps/zlib/contrib/iostream3/iostream3Config.cmake.in +23 -0
- package/deps/zlib/contrib/iostream3/test/CMakeLists.txt +191 -0
- package/deps/zlib/contrib/iostream3/test/add_subdirectory_exclude_test.cmake.in +27 -0
- package/deps/zlib/contrib/iostream3/test/add_subdirectory_test.cmake.in +25 -0
- package/deps/zlib/contrib/iostream3/test/find_package_no_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/iostream3/test/find_package_test.cmake.in +24 -0
- package/deps/zlib/contrib/iostream3/test/find_package_wrong_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/iostream3/test.cc +50 -0
- package/deps/zlib/contrib/iostream3/zfstream.cc +479 -0
- package/deps/zlib/contrib/iostream3/zfstream.h +466 -0
- package/deps/zlib/contrib/minizip/CMakeLists.txt +387 -0
- package/deps/zlib/contrib/minizip/LICENSE.Info-Zip +58 -0
- package/deps/zlib/contrib/minizip/Makefile +33 -0
- package/deps/zlib/contrib/minizip/Makefile.am +45 -0
- package/deps/zlib/contrib/minizip/MiniZip64_Changes.txt +6 -0
- package/deps/zlib/contrib/minizip/MiniZip64_info.txt +69 -0
- package/deps/zlib/contrib/minizip/configure.ac +32 -0
- package/deps/zlib/contrib/minizip/crypt.h +125 -0
- package/deps/zlib/contrib/minizip/ints.h +57 -0
- package/deps/zlib/contrib/minizip/ioapi.c +231 -0
- package/deps/zlib/contrib/minizip/ioapi.h +183 -0
- package/deps/zlib/contrib/minizip/iowin32.c +447 -0
- package/deps/zlib/contrib/minizip/iowin32.h +27 -0
- package/deps/zlib/contrib/minizip/make_vms.com +25 -0
- package/deps/zlib/contrib/minizip/miniunz.c +647 -0
- package/deps/zlib/contrib/minizip/miniunzip.1 +63 -0
- package/deps/zlib/contrib/minizip/minizip.1 +46 -0
- package/deps/zlib/contrib/minizip/minizip.c +511 -0
- package/deps/zlib/contrib/minizip/minizip.pc.in +13 -0
- package/deps/zlib/contrib/minizip/minizip.pc.txt +13 -0
- package/deps/zlib/contrib/minizip/minizipConfig.cmake.in +27 -0
- package/deps/zlib/contrib/minizip/mztools.c +294 -0
- package/deps/zlib/contrib/minizip/mztools.h +37 -0
- package/deps/zlib/contrib/minizip/skipset.h +366 -0
- package/deps/zlib/contrib/minizip/test/CMakeLists.txt +176 -0
- package/deps/zlib/contrib/minizip/test/add_subdirectory_exclude_test.cmake.in +29 -0
- package/deps/zlib/contrib/minizip/test/add_subdirectory_test.cmake.in +28 -0
- package/deps/zlib/contrib/minizip/test/find_package_no_components_test.cmake.in +26 -0
- package/deps/zlib/contrib/minizip/test/find_package_test.cmake.in +26 -0
- package/deps/zlib/contrib/minizip/test/find_package_wrong_components_test.cmake.in +26 -0
- package/deps/zlib/contrib/minizip/test/test_helper.cm +32 -0
- package/deps/zlib/contrib/minizip/unzip.c +1984 -0
- package/deps/zlib/contrib/minizip/unzip.h +442 -0
- package/deps/zlib/contrib/minizip/zip.c +2246 -0
- package/deps/zlib/contrib/minizip/zip.h +371 -0
- package/deps/zlib/contrib/nuget/nuget.csproj +45 -0
- package/deps/zlib/contrib/nuget/nuget.sln +22 -0
- package/deps/zlib/contrib/pascal/example.pas +599 -0
- package/deps/zlib/contrib/pascal/readme.txt +76 -0
- package/deps/zlib/contrib/pascal/zlibd32.mak +99 -0
- package/deps/zlib/contrib/pascal/zlibpas.pas +276 -0
- package/deps/zlib/contrib/puff/CMakeLists.txt +154 -0
- package/deps/zlib/contrib/puff/Makefile +42 -0
- package/deps/zlib/contrib/puff/README +63 -0
- package/deps/zlib/contrib/puff/bin-writer.c +26 -0
- package/deps/zlib/contrib/puff/puff.c +840 -0
- package/deps/zlib/contrib/puff/puff.h +35 -0
- package/deps/zlib/contrib/puff/puffConfig.cmake.in +18 -0
- package/deps/zlib/contrib/puff/pufftest.c +168 -0
- package/deps/zlib/contrib/puff/test/CMakeLists.txt +262 -0
- package/deps/zlib/contrib/puff/test/add_subdirectory_exclude_test.cmake.in +26 -0
- package/deps/zlib/contrib/puff/test/add_subdirectory_test.cmake.in +25 -0
- package/deps/zlib/contrib/puff/test/find_package_no_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/puff/test/find_package_test.cmake.in +24 -0
- package/deps/zlib/contrib/puff/test/find_package_wrong_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/puff/test/tester-cov.cmake +58 -0
- package/deps/zlib/contrib/puff/test/tester.cmake +16 -0
- package/deps/zlib/contrib/puff/zeros.raw +0 -0
- package/deps/zlib/contrib/testzlib/CMakeLists.txt +44 -0
- package/deps/zlib/contrib/testzlib/testzlib.c +275 -0
- package/deps/zlib/contrib/testzlib/testzlib.txt +10 -0
- package/deps/zlib/contrib/vstudio/readme.txt +22 -0
- package/deps/zlib/contrib/zlib1-dll/CMakeLists.txt +196 -0
- package/deps/zlib/contrib/zlib1-dll/readme.txt +21 -0
- package/deps/zlib/crc32.c +983 -0
- package/deps/zlib/crc32.h +9446 -0
- package/deps/zlib/deflate.c +2185 -0
- package/deps/zlib/deflate.h +383 -0
- package/deps/zlib/doc/algorithm.txt +209 -0
- package/deps/zlib/doc/crc-doc.1.0.pdf +0 -0
- package/deps/zlib/doc/rfc1950.txt +619 -0
- package/deps/zlib/doc/rfc1951.txt +955 -0
- package/deps/zlib/doc/rfc1952.txt +675 -0
- package/deps/zlib/doc/txtvsbin.txt +107 -0
- package/deps/zlib/examples/README.examples +54 -0
- package/deps/zlib/examples/enough.c +597 -0
- package/deps/zlib/examples/fitblk.c +233 -0
- package/deps/zlib/examples/gun.c +702 -0
- package/deps/zlib/examples/gzappend.c +504 -0
- package/deps/zlib/examples/gzjoin.c +449 -0
- package/deps/zlib/examples/gzlog.c +1061 -0
- package/deps/zlib/examples/gzlog.h +91 -0
- package/deps/zlib/examples/gznorm.c +474 -0
- package/deps/zlib/examples/zlib_how.html +550 -0
- package/deps/zlib/examples/zpipe.c +206 -0
- package/deps/zlib/examples/zran.c +546 -0
- package/deps/zlib/examples/zran.h +53 -0
- package/deps/zlib/gzclose.c +23 -0
- package/deps/zlib/gzguts.h +216 -0
- package/deps/zlib/gzlib.c +609 -0
- package/deps/zlib/gzread.c +668 -0
- package/deps/zlib/gzwrite.c +700 -0
- package/deps/zlib/infback.c +581 -0
- package/deps/zlib/inffast.c +321 -0
- package/deps/zlib/inffast.h +11 -0
- package/deps/zlib/inffixed.h +94 -0
- package/deps/zlib/inflate.c +1413 -0
- package/deps/zlib/inflate.h +126 -0
- package/deps/zlib/inftrees.c +424 -0
- package/deps/zlib/inftrees.h +64 -0
- package/deps/zlib/make_vms.com +867 -0
- package/deps/zlib/msdos/Makefile.bor +115 -0
- package/deps/zlib/msdos/Makefile.dj2 +104 -0
- package/deps/zlib/msdos/Makefile.emx +69 -0
- package/deps/zlib/msdos/Makefile.msc +112 -0
- package/deps/zlib/msdos/Makefile.tc +100 -0
- package/deps/zlib/os400/README400 +48 -0
- package/deps/zlib/os400/bndsrc +144 -0
- package/deps/zlib/os400/make.sh +383 -0
- package/deps/zlib/os400/zlibfixed.rpgle +578 -0
- package/deps/zlib/os400/zlibfree.rpgle +634 -0
- package/deps/zlib/qnx/package.qpg +141 -0
- package/deps/zlib/test/CMakeLists.txt +318 -0
- package/deps/zlib/test/add_subdirectory_exclude_test.cmake.in +29 -0
- package/deps/zlib/test/add_subdirectory_test.cmake.in +28 -0
- package/deps/zlib/test/example.c +552 -0
- package/deps/zlib/test/find_package_no_components_test.cmake.in +27 -0
- package/deps/zlib/test/find_package_test.cmake.in +27 -0
- package/deps/zlib/test/find_package_wrong_components_test.cmake.in +27 -0
- package/deps/zlib/test/infcover.c +672 -0
- package/deps/zlib/test/minigzip.c +592 -0
- package/deps/zlib/treebuild.xml +116 -0
- package/deps/zlib/trees.c +1119 -0
- package/deps/zlib/trees.h +128 -0
- package/deps/zlib/uncompr.c +101 -0
- package/deps/zlib/watcom/watcom_f.mak +43 -0
- package/deps/zlib/watcom/watcom_l.mak +43 -0
- package/deps/zlib/win32/DLL_FAQ.txt +381 -0
- package/deps/zlib/win32/Makefile.bor +109 -0
- package/deps/zlib/win32/Makefile.gcc +177 -0
- package/deps/zlib/win32/Makefile.msc +159 -0
- package/deps/zlib/win32/README-WIN32.txt +103 -0
- package/deps/zlib/win32/VisualC.txt +3 -0
- package/deps/zlib/win32/zlib.def +104 -0
- package/deps/zlib/win32/zlib1.rc +37 -0
- package/deps/zlib/zconf.h.in +551 -0
- package/deps/zlib/zlib.3 +149 -0
- package/deps/zlib/zlib.3.pdf +0 -0
- package/deps/zlib/zlib.h +2057 -0
- package/deps/zlib/zlib.map +116 -0
- package/deps/zlib/zlib.pc.cmakein +14 -0
- package/deps/zlib/zlib.pc.in +14 -0
- package/deps/zlib/zlibConfig.cmake.in +18 -0
- package/deps/zlib/zutil.c +313 -0
- package/deps/zlib/zutil.h +331 -0
- package/dist/index.d.ts +266 -0
- package/dist/index.js +1146 -0
- package/dist/libwz.js +5632 -0
- package/dist/libwz.wasm +0 -0
- package/include/wz/CRC32.h +182 -0
- package/include/wz/PngUtility.h +72 -0
- package/include/wz/PortalType.h +124 -0
- package/include/wz/Properties/WzBinaryProperty.h +70 -0
- package/include/wz/Properties/WzCanvasProperty.h +55 -0
- package/include/wz/Properties/WzConvexProperty.h +34 -0
- package/include/wz/Properties/WzDoubleProperty.h +32 -0
- package/include/wz/Properties/WzFloatProperty.h +30 -0
- package/include/wz/Properties/WzIntProperty.h +30 -0
- package/include/wz/Properties/WzLongProperty.h +30 -0
- package/include/wz/Properties/WzLuaProperty.h +31 -0
- package/include/wz/Properties/WzNullProperty.h +15 -0
- package/include/wz/Properties/WzPngProperty.h +53 -0
- package/include/wz/Properties/WzRawDataProperty.h +46 -0
- package/include/wz/Properties/WzShortProperty.h +31 -0
- package/include/wz/Properties/WzStringProperty.h +32 -0
- package/include/wz/Properties/WzSubProperty.h +35 -0
- package/include/wz/Properties/WzUOLProperty.h +44 -0
- package/include/wz/Properties/WzVectorProperty.h +40 -0
- package/include/wz/Properties/WzVideoProperty.h +43 -0
- package/include/wz/Result.h +58 -0
- package/include/wz/Util/Defines.h +16 -0
- package/include/wz/Util/ListFileParser.h +20 -0
- package/include/wz/Util/WzBinaryReader.h +95 -0
- package/include/wz/Util/WzBinaryWriter.h +72 -0
- package/include/wz/Util/WzBlobDataSource.h +30 -0
- package/include/wz/Util/WzDataSource.h +49 -0
- package/include/wz/Util/WzKeyGenerator.h +28 -0
- package/include/wz/Util/WzMutableKey.h +39 -0
- package/include/wz/Util/WzPath.h +37 -0
- package/include/wz/Util/WzStream.h +86 -0
- package/include/wz/Util/WzTool.h +42 -0
- package/include/wz/WzAESConstant.h +17 -0
- package/include/wz/WzDirectory.h +97 -0
- package/include/wz/WzEnums.h +76 -0
- package/include/wz/WzFile.h +99 -0
- package/include/wz/WzHeader.h +47 -0
- package/include/wz/WzImage.h +97 -0
- package/include/wz/WzImageProperty.h +92 -0
- package/include/wz/WzObject.h +55 -0
- package/include/wz/WzPropertyCollection.h +115 -0
- package/include/wz/wz.h +41 -0
- package/include/wz/wz_api.h +432 -0
- package/package.json +93 -0
- package/src/PngUtility.cpp +328 -0
- package/src/Properties/WzBinaryProperty.cpp +183 -0
- package/src/Properties/WzCanvasProperty.cpp +262 -0
- package/src/Properties/WzConvexProperty.cpp +159 -0
- package/src/Properties/WzDoubleProperty.cpp +12 -0
- package/src/Properties/WzFloatProperty.cpp +17 -0
- package/src/Properties/WzIntProperty.cpp +12 -0
- package/src/Properties/WzLongProperty.cpp +12 -0
- package/src/Properties/WzLuaProperty.cpp +37 -0
- package/src/Properties/WzNullProperty.cpp +11 -0
- package/src/Properties/WzPngProperty.cpp +637 -0
- package/src/Properties/WzRawDataProperty.cpp +116 -0
- package/src/Properties/WzShortProperty.cpp +12 -0
- package/src/Properties/WzStringProperty.cpp +44 -0
- package/src/Properties/WzSubProperty.cpp +129 -0
- package/src/Properties/WzUOLProperty.cpp +136 -0
- package/src/Properties/WzVectorProperty.cpp +22 -0
- package/src/Properties/WzVideoProperty.cpp +115 -0
- package/src/Util/ListFileParser.cpp +48 -0
- package/src/Util/WzBinaryReader.cpp +368 -0
- package/src/Util/WzBinaryWriter.cpp +305 -0
- package/src/Util/WzBlobDataSource.cpp +47 -0
- package/src/Util/WzDataSource.cpp +61 -0
- package/src/Util/WzKeyGenerator.cpp +43 -0
- package/src/Util/WzMutableKey.cpp +59 -0
- package/src/Util/WzStream.cpp +196 -0
- package/src/Util/WzTool.cpp +266 -0
- package/src/WzAESConstant.cpp +12 -0
- package/src/WzDirectory.cpp +669 -0
- package/src/WzEnums.cpp +20 -0
- package/src/WzFile.cpp +450 -0
- package/src/WzImage.cpp +350 -0
- package/src/WzImageProperty.cpp +469 -0
- package/src/WzObject.cpp +174 -0
- package/src/WzPropertyCollection.cpp +84 -0
- package/src/capi/wz_api.cpp +1996 -0
- package/src/node/binding.cpp +1776 -0
package/dist/libwz.wasm
ADDED
|
Binary file
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
#ifndef WZ_CRC32_H_
|
|
2
|
+
#define WZ_CRC32_H_
|
|
3
|
+
#include <cstdint>
|
|
4
|
+
|
|
5
|
+
namespace wz {
|
|
6
|
+
|
|
7
|
+
class CCrc32 {
|
|
8
|
+
public:
|
|
9
|
+
static uint32_t GetCrc32(int32_t input,
|
|
10
|
+
uint32_t initialValue,
|
|
11
|
+
bool xorInitialCrc,
|
|
12
|
+
bool flag2) {
|
|
13
|
+
uint32_t result = 0;
|
|
14
|
+
return GetCrc32(reinterpret_cast<const uint8_t*>(&input),
|
|
15
|
+
4,
|
|
16
|
+
initialValue,
|
|
17
|
+
xorInitialCrc,
|
|
18
|
+
result,
|
|
19
|
+
flag2);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static uint32_t GetCrc32(int64_t input,
|
|
23
|
+
uint32_t initialValue,
|
|
24
|
+
bool xorInitialCrc,
|
|
25
|
+
bool flag2) {
|
|
26
|
+
uint32_t result = 0;
|
|
27
|
+
return GetCrc32(reinterpret_cast<const uint8_t*>(&input),
|
|
28
|
+
8,
|
|
29
|
+
initialValue,
|
|
30
|
+
xorInitialCrc,
|
|
31
|
+
result,
|
|
32
|
+
flag2);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private:
|
|
36
|
+
static uint32_t GetCrc32(const uint8_t* val,
|
|
37
|
+
uint32_t length,
|
|
38
|
+
uint32_t initialCrc,
|
|
39
|
+
bool xorInitialCrc,
|
|
40
|
+
uint32_t& a5,
|
|
41
|
+
bool flag2) {
|
|
42
|
+
const uint8_t* v6 = val;
|
|
43
|
+
if (xorInitialCrc) initialCrc ^= *reinterpret_cast<const uint32_t*>(val);
|
|
44
|
+
uint32_t length_ = length;
|
|
45
|
+
uint32_t initialCrc_ = initialCrc;
|
|
46
|
+
|
|
47
|
+
if (length >= 0x10) {
|
|
48
|
+
uint32_t v9 = length >> 4;
|
|
49
|
+
do {
|
|
50
|
+
uint32_t idx0 = static_cast<uint32_t>(*v6) ^ (initialCrc_ >> 24);
|
|
51
|
+
uint32_t t0 = ms_adwCrc32Table[idx0] ^ (initialCrc_ << 8);
|
|
52
|
+
|
|
53
|
+
uint32_t idx1 = static_cast<uint32_t>(v6[1]) ^ (t0 >> 24);
|
|
54
|
+
uint32_t t1 = ms_adwCrc32Table[idx1] ^ (t0 << 8);
|
|
55
|
+
|
|
56
|
+
uint32_t idx2 = static_cast<uint32_t>(v6[2]) ^ (t1 >> 24);
|
|
57
|
+
uint32_t t2 = ms_adwCrc32Table[idx2] ^ (t1 << 8);
|
|
58
|
+
|
|
59
|
+
uint32_t idx3 = static_cast<uint32_t>(v6[3]) ^ (t2 >> 24);
|
|
60
|
+
uint32_t t3 = ms_adwCrc32Table[idx3] ^ (t2 << 8);
|
|
61
|
+
|
|
62
|
+
v6 += 4;
|
|
63
|
+
length_ -= 4;
|
|
64
|
+
|
|
65
|
+
initialCrc_ = t3;
|
|
66
|
+
--v9;
|
|
67
|
+
} while (v9 != 0);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
while (length_ > 0) {
|
|
71
|
+
initialCrc_ =
|
|
72
|
+
ms_adwCrc32Table[*v6++ ^ (initialCrc_ >> 24)] ^ (initialCrc_ << 8);
|
|
73
|
+
--length_;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (xorInitialCrc && flag2) {
|
|
77
|
+
// int v48 = CCrc32.dword_E0DB10;
|
|
78
|
+
// *(uint*)(v48 + 132) =
|
|
79
|
+
// _ZtlSecureTear<long>(v6, CCrc32.dword_E0DB10 + 124);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// if (a5 != null)
|
|
83
|
+
a5 = 7;
|
|
84
|
+
return initialCrc_;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static constexpr uint32_t ms_adwCrc32Table[256] = {
|
|
88
|
+
0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B,
|
|
89
|
+
0x1A864DB2, 0x1E475005, 0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, 0x2B4BCB61,
|
|
90
|
+
0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD, 0x4C11DB70, 0x48D0C6C7,
|
|
91
|
+
0x4593E01E, 0x4152FDA9, 0x5F15ADAC, 0x5BD4B01B, 0x569796C2, 0x52568B75,
|
|
92
|
+
0x6A1936C8, 0x6ED82B7F, 0x639B0DA6, 0x675A1011, 0x791D4014, 0x7DDC5DA3,
|
|
93
|
+
0x709F7B7A, 0x745E66CD, 0x9823B6E0, 0x9CE2AB57, 0x91A18D8E, 0x95609039,
|
|
94
|
+
0x8B27C03C, 0x8FE6DD8B, 0x82A5FB52, 0x8664E6E5, 0xBE2B5B58, 0xBAEA46EF,
|
|
95
|
+
0xB7A96036, 0xB3687D81, 0xAD2F2D84, 0xA9EE3033, 0xA4AD16EA, 0xA06C0B5D,
|
|
96
|
+
0xD4326D90, 0xD0F37027, 0xDDB056FE, 0xD9714B49, 0xC7361B4C, 0xC3F706FB,
|
|
97
|
+
0xCEB42022, 0xCA753D95, 0xF23A8028, 0xF6FB9D9F, 0xFBB8BB46, 0xFF79A6F1,
|
|
98
|
+
0xE13EF6F4, 0xE5FFEB43, 0xE8BCCD9A, 0xEC7DD02D, 0x34867077, 0x30476DC0,
|
|
99
|
+
0x3D044B19, 0x39C556AE, 0x278206AB, 0x23431B1C, 0x2E003DC5, 0x2AC12072,
|
|
100
|
+
0x128E9DCF, 0x164F8078, 0x1B0CA6A1, 0x1FCDBB16, 0x018AEB13, 0x054BF6A4,
|
|
101
|
+
0x0808D07D, 0x0CC9CDCA, 0x7897AB07, 0x7C56B6B0, 0x71159069, 0x75D48DDE,
|
|
102
|
+
0x6B93DDDB, 0x6F52C06C, 0x6211E6B5, 0x66D0FB02, 0x5E9F46BF, 0x5A5E5B08,
|
|
103
|
+
0x571D7DD1, 0x53DC6066, 0x4D9B3063, 0x495A2DD4, 0x44190B0D, 0x40D816BA,
|
|
104
|
+
0xACA5C697, 0xA864DB20, 0xA527FDF9, 0xA1E6E04E, 0xBFA1B04B, 0xBB60ADFC,
|
|
105
|
+
0xB6238B25, 0xB2E29692, 0x8AAD2B2F, 0x8E6C3698, 0x832F1041, 0x87EE0DF6,
|
|
106
|
+
0x99A95DF3, 0x9D684044, 0x902B669D, 0x94EA7B2A, 0xE0B41DE7, 0xE4750050,
|
|
107
|
+
0xE9362689, 0xEDF73B3E, 0xF3B06B3B, 0xF771768C, 0xFA325055, 0xFEF34DE2,
|
|
108
|
+
0xC6BCF05F, 0xC27DEDE8, 0xCF3ECB31, 0xCBFFD686, 0xD5B88683, 0xD1799B34,
|
|
109
|
+
0xDC3ABDED, 0xD8FBA05A, 0x690CE0EE, 0x6DCDFD59, 0x608EDB80, 0x644FC637,
|
|
110
|
+
0x7A089632, 0x7EC98B85, 0x738AAD5C, 0x774BB0EB, 0x4F040D56, 0x4BC510E1,
|
|
111
|
+
0x46863638, 0x42472B8F, 0x5C007B8A, 0x58C1663D, 0x558240E4, 0x51435D53,
|
|
112
|
+
0x251D3B9E, 0x21DC2629, 0x2C9F00F0, 0x285E1D47, 0x36194D42, 0x32D850F5,
|
|
113
|
+
0x3F9B762C, 0x3B5A6B9B, 0x0315D626, 0x07D4CB91, 0x0A97ED48, 0x0E56F0FF,
|
|
114
|
+
0x1011A0FA, 0x14D0BD4D, 0x19939B94, 0x1D528623, 0xF12F560E, 0xF5EE4BB9,
|
|
115
|
+
0xF8AD6D60, 0xFC6C70D7, 0xE22B20D2, 0xE6EA3D65, 0xEBA91BBC, 0xEF68060B,
|
|
116
|
+
0xD727BBB6, 0xD3E6A601, 0xDEA580D8, 0xDA649D6F, 0xC423CD6A, 0xC0E2D0DD,
|
|
117
|
+
0xCDA1F604, 0xC960EBB3, 0xBD3E8D7E, 0xB9FF90C9, 0xB4BCB610, 0xB07DABA7,
|
|
118
|
+
0xAE3AFBA2, 0xAAFBE615, 0xA7B8C0CC, 0xA379DD7B, 0x9B3660C6, 0x9FF77D71,
|
|
119
|
+
0x92B45BA8, 0x9675461F, 0x8832161A, 0x8CF30BAD, 0x81B02D74, 0x857130C3,
|
|
120
|
+
0x5D8A9099, 0x594B8D2E, 0x5408ABF7, 0x50C9B640, 0x4E8EE645, 0x4A4FFBF2,
|
|
121
|
+
0x470CDD2B, 0x43CDC09C, 0x7B827D21, 0x7F436096, 0x7200464F, 0x76C15BF8,
|
|
122
|
+
0x68860BFD, 0x6C47164A, 0x61043093, 0x65C52D24, 0x119B4BE9, 0x155A565E,
|
|
123
|
+
0x18197087, 0x1CD86D30, 0x029F3D35, 0x065E2082, 0x0B1D065B, 0x0FDC1BEC,
|
|
124
|
+
0x3793A651, 0x3352BBE6, 0x3E119D3F, 0x3AD08088, 0x2497D08D, 0x2056CD3A,
|
|
125
|
+
0x2D15EBE3, 0x29D4F654, 0xC5A92679, 0xC1683BCE, 0xCC2B1D17, 0xC8EA00A0,
|
|
126
|
+
0xD6AD50A5, 0xD26C4D12, 0xDF2F6BCB, 0xDBEE767C, 0xE3A1CBC1, 0xE760D676,
|
|
127
|
+
0xEA23F0AF, 0xEEE2ED18, 0xF0A5BD1D, 0xF464A0AA, 0xF9278673, 0xFDE69BC4,
|
|
128
|
+
0x89B8FD09, 0x8D79E0BE, 0x803AC667, 0x84FBDBD0, 0x9ABC8BD5, 0x9E7D9662,
|
|
129
|
+
0x933EB0BB, 0x97FFAD0C, 0xAFB010B1, 0xAB710D06, 0xA6322BDF, 0xA2F33668,
|
|
130
|
+
0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4,
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
class CWvsPhysicalSpace2D {
|
|
135
|
+
public:
|
|
136
|
+
static uint32_t GetConstantCRC(int mapleVersion) {
|
|
137
|
+
int v19 = mapleVersion;
|
|
138
|
+
uint32_t crc = CCrc32::GetCrc32(v19, 0, false, false);
|
|
139
|
+
|
|
140
|
+
v19 = 140000;
|
|
141
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dWalkForce
|
|
142
|
+
v19 = 125;
|
|
143
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dWalkSpeed
|
|
144
|
+
v19 = 80000;
|
|
145
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dWalkDrag
|
|
146
|
+
v19 = 60000;
|
|
147
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dSlipForce
|
|
148
|
+
v19 = 120;
|
|
149
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dSlipSpeed
|
|
150
|
+
v19 = 100000;
|
|
151
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dFloatDrag1
|
|
152
|
+
v19 = 0;
|
|
153
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dFloatCoefficient
|
|
154
|
+
v19 = 120000;
|
|
155
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dSwimForce
|
|
156
|
+
v19 = 140;
|
|
157
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dSwimSpeed
|
|
158
|
+
v19 = 120000;
|
|
159
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dFlyForce
|
|
160
|
+
v19 = 200;
|
|
161
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dFlySpeed
|
|
162
|
+
v19 = 2000;
|
|
163
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dGravityAcc
|
|
164
|
+
v19 = 670;
|
|
165
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dFallSpeed
|
|
166
|
+
v19 = 555;
|
|
167
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dJumpSpeed
|
|
168
|
+
v19 = 2;
|
|
169
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dMaxFriction
|
|
170
|
+
v19 = 0;
|
|
171
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dMinFriction
|
|
172
|
+
v19 = 0;
|
|
173
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dSwimSpeedDec
|
|
174
|
+
v19 = 0;
|
|
175
|
+
crc = CCrc32::GetCrc32(v19, crc, false, false); // dFlyJumpDec
|
|
176
|
+
|
|
177
|
+
return crc;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
} // namespace wz
|
|
182
|
+
#endif // WZ_CRC32_H_
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#ifndef WZ_PNGUTILITY_H_
|
|
2
|
+
#define WZ_PNGUTILITY_H_
|
|
3
|
+
#include <cmath>
|
|
4
|
+
#include <cstdint>
|
|
5
|
+
#include <vector>
|
|
6
|
+
#include "wz/Result.h"
|
|
7
|
+
|
|
8
|
+
namespace wz {
|
|
9
|
+
|
|
10
|
+
struct RGBColor {
|
|
11
|
+
uint8_t R, G, B;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
class PngUtility {
|
|
15
|
+
public:
|
|
16
|
+
static RGBColor RGB565ToColor(uint16_t val);
|
|
17
|
+
|
|
18
|
+
// Decompress BGRA4444 raw data to BGRA32
|
|
19
|
+
// rawData: input, 2 bytes per pixel
|
|
20
|
+
// width, height: dimensions
|
|
21
|
+
// output: pre-allocated, size = width * height * 4
|
|
22
|
+
static Result<void> DecompressImagePixelDataBgra4444(
|
|
23
|
+
const std::vector<uint8_t>& rawData,
|
|
24
|
+
int width,
|
|
25
|
+
int height,
|
|
26
|
+
std::vector<uint8_t>& output);
|
|
27
|
+
|
|
28
|
+
// Decompress DXT3 compressed data to BGRA32
|
|
29
|
+
static Result<void> DecompressImageDXT3(const std::vector<uint8_t>& rawData,
|
|
30
|
+
int width,
|
|
31
|
+
int height,
|
|
32
|
+
std::vector<uint8_t>& output);
|
|
33
|
+
|
|
34
|
+
// Decompress DXT5 compressed data to BGRA32
|
|
35
|
+
static Result<void> DecompressImageDXT5(const std::vector<uint8_t>& rawData,
|
|
36
|
+
int width,
|
|
37
|
+
int height,
|
|
38
|
+
std::vector<uint8_t>& output);
|
|
39
|
+
|
|
40
|
+
// Decompress Format517 (16x16 block RGB565) to RGB565 data
|
|
41
|
+
static void DecompressImagePixelDataForm517(
|
|
42
|
+
const std::vector<uint8_t>& rawData,
|
|
43
|
+
int width,
|
|
44
|
+
int height,
|
|
45
|
+
std::vector<uint8_t>& output);
|
|
46
|
+
|
|
47
|
+
// Copy bitmap data with stride handling (for Format257/Format2 round-trip)
|
|
48
|
+
static void CopyBmpDataWithStride(const std::vector<uint8_t>& source,
|
|
49
|
+
int srcStride,
|
|
50
|
+
int dstHeight,
|
|
51
|
+
int dstStride,
|
|
52
|
+
std::vector<uint8_t>& output);
|
|
53
|
+
|
|
54
|
+
// DXT color table expansion
|
|
55
|
+
static void ExpandColorTable(RGBColor color[4], uint16_t c0, uint16_t c1);
|
|
56
|
+
static void ExpandColorIndexTable(int colorIndex[16],
|
|
57
|
+
const uint8_t* rawData,
|
|
58
|
+
int offset);
|
|
59
|
+
static void ExpandAlphaTableDXT3(uint8_t alpha[16],
|
|
60
|
+
const uint8_t* rawData,
|
|
61
|
+
int offset);
|
|
62
|
+
static void ExpandAlphaTableDXT5(uint8_t alpha[8], uint8_t a0, uint8_t a1);
|
|
63
|
+
static void ExpandAlphaIndexTableDXT5(int alphaIndex[16],
|
|
64
|
+
const uint8_t* rawData,
|
|
65
|
+
int offset);
|
|
66
|
+
|
|
67
|
+
// Get uncompressed pixel data size by format
|
|
68
|
+
static int GetUncompressedSizeByFormat(int width, int height, int format);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
} // namespace wz
|
|
72
|
+
#endif // WZ_PNGUTILITY_H_
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
#ifndef WZ_PORTALTYPE_H_
|
|
2
|
+
#define WZ_PORTALTYPE_H_
|
|
3
|
+
#include <algorithm>
|
|
4
|
+
#include <string>
|
|
5
|
+
#include <unordered_map>
|
|
6
|
+
#include "wz/Result.h"
|
|
7
|
+
|
|
8
|
+
namespace wz {
|
|
9
|
+
|
|
10
|
+
enum class PortalType {
|
|
11
|
+
StartPoint,
|
|
12
|
+
Invisible,
|
|
13
|
+
Visible,
|
|
14
|
+
Default,
|
|
15
|
+
Collision,
|
|
16
|
+
Changeable,
|
|
17
|
+
ChangeableInvisible,
|
|
18
|
+
TownPortalPoint,
|
|
19
|
+
Script,
|
|
20
|
+
ScriptInvisible,
|
|
21
|
+
CollisionScript,
|
|
22
|
+
Hidden,
|
|
23
|
+
ScriptHidden,
|
|
24
|
+
CollisionVerticalJump,
|
|
25
|
+
CollisionCustomImpact,
|
|
26
|
+
CollisionCustomImpact2,
|
|
27
|
+
CollisionUnknownPcig,
|
|
28
|
+
ScriptHiddenUng,
|
|
29
|
+
UNKNOWN_PCC,
|
|
30
|
+
UNKNOWN_PCIR
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
class PortalTypeExtensions {
|
|
34
|
+
public:
|
|
35
|
+
static Result<std::string> ToCode(PortalType type) {
|
|
36
|
+
auto it = portalTypeToCodes.find(type);
|
|
37
|
+
if (it == portalTypeToCodes.end())
|
|
38
|
+
return std::unexpected(Error::InvalidArgument("Unknown PortalType"));
|
|
39
|
+
return it->second;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static Result<PortalType> FromCode(const std::string& code) {
|
|
43
|
+
if (code.empty())
|
|
44
|
+
return std::unexpected(Error::InvalidArgument("code is null"));
|
|
45
|
+
std::string lower = code;
|
|
46
|
+
std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
|
|
47
|
+
auto it = codeToPortalTypes.find(lower);
|
|
48
|
+
if (it == codeToPortalTypes.end())
|
|
49
|
+
return std::unexpected(
|
|
50
|
+
Error::InvalidArgument("Invalid portal type code: " + code));
|
|
51
|
+
return it->second;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static Result<std::string> GetFriendlyName(PortalType type) {
|
|
55
|
+
auto it = portalTypeToNames.find(type);
|
|
56
|
+
if (it == portalTypeToNames.end())
|
|
57
|
+
return std::unexpected(Error::InvalidArgument("Unknown PortalType"));
|
|
58
|
+
return it->second;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private:
|
|
62
|
+
static inline const std::unordered_map<PortalType, std::string>
|
|
63
|
+
portalTypeToCodes = {
|
|
64
|
+
{PortalType::StartPoint, "sp"},
|
|
65
|
+
{PortalType::Invisible, "pi"},
|
|
66
|
+
{PortalType::Visible, "pv"},
|
|
67
|
+
{PortalType::Default, "default"},
|
|
68
|
+
{PortalType::Collision, "pc"},
|
|
69
|
+
{PortalType::Changeable, "pg"},
|
|
70
|
+
{PortalType::ChangeableInvisible, "pgi"},
|
|
71
|
+
{PortalType::TownPortalPoint, "tp"},
|
|
72
|
+
{PortalType::Script, "ps"},
|
|
73
|
+
{PortalType::ScriptInvisible, "psi"},
|
|
74
|
+
{PortalType::CollisionScript, "pcs"},
|
|
75
|
+
{PortalType::Hidden, "ph"},
|
|
76
|
+
{PortalType::ScriptHidden, "psh"},
|
|
77
|
+
{PortalType::CollisionVerticalJump, "pcj"},
|
|
78
|
+
{PortalType::CollisionCustomImpact, "pci"},
|
|
79
|
+
{PortalType::CollisionCustomImpact2, "pci2"},
|
|
80
|
+
{PortalType::CollisionUnknownPcig, "pcig"},
|
|
81
|
+
{PortalType::ScriptHiddenUng, "pshg"},
|
|
82
|
+
{PortalType::UNKNOWN_PCC, "pcc"},
|
|
83
|
+
{PortalType::UNKNOWN_PCIR, "pcir"},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
static inline const std::unordered_map<std::string, PortalType>
|
|
87
|
+
codeToPortalTypes = []() {
|
|
88
|
+
std::unordered_map<std::string, PortalType> m;
|
|
89
|
+
for (auto& p : portalTypeToCodes) {
|
|
90
|
+
std::string lower = p.second;
|
|
91
|
+
std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
|
|
92
|
+
m[lower] = p.first;
|
|
93
|
+
}
|
|
94
|
+
return m;
|
|
95
|
+
}();
|
|
96
|
+
|
|
97
|
+
static inline const std::unordered_map<PortalType, std::string>
|
|
98
|
+
portalTypeToNames = {
|
|
99
|
+
{PortalType::StartPoint, "Start Point"},
|
|
100
|
+
{PortalType::Invisible, "Invisible"},
|
|
101
|
+
{PortalType::Visible, "Visible"},
|
|
102
|
+
{PortalType::Default, "Visible (Default)"},
|
|
103
|
+
{PortalType::Collision, "Collision"},
|
|
104
|
+
{PortalType::Changeable, "Changeable"},
|
|
105
|
+
{PortalType::ChangeableInvisible, "Changeable Invisible"},
|
|
106
|
+
{PortalType::TownPortalPoint, "Town Portal"},
|
|
107
|
+
{PortalType::Script, "Script"},
|
|
108
|
+
{PortalType::ScriptInvisible, "Script Invisible"},
|
|
109
|
+
{PortalType::CollisionScript, "Script Collision"},
|
|
110
|
+
{PortalType::Hidden, "Hidden"},
|
|
111
|
+
{PortalType::ScriptHidden, "Script Hidden"},
|
|
112
|
+
{PortalType::CollisionVerticalJump, "Collision Vertical Jump"},
|
|
113
|
+
{PortalType::CollisionCustomImpact, "Collision Custom Impact Spring"},
|
|
114
|
+
{PortalType::CollisionCustomImpact2,
|
|
115
|
+
"Collision Custom Impact Spring 2"},
|
|
116
|
+
{PortalType::CollisionUnknownPcig, "Unknown (PCIG)"},
|
|
117
|
+
{PortalType::ScriptHiddenUng, "Script Hidden Ung"},
|
|
118
|
+
{PortalType::UNKNOWN_PCC, "Unknown pcc"},
|
|
119
|
+
{PortalType::UNKNOWN_PCIR, "Unknown pcir"},
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
} // namespace wz
|
|
124
|
+
#endif // WZ_PORTALTYPE_H_
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#ifndef WZ_PROPERTIES_WZBINARYPROPERTY_H_
|
|
2
|
+
#define WZ_PROPERTIES_WZBINARYPROPERTY_H_
|
|
3
|
+
#include <cstdint>
|
|
4
|
+
#include <vector>
|
|
5
|
+
#include "wz/Result.h"
|
|
6
|
+
#include "wz/WzEnums.h"
|
|
7
|
+
#include "wz/WzImageProperty.h"
|
|
8
|
+
|
|
9
|
+
namespace wz {
|
|
10
|
+
|
|
11
|
+
class WzBinaryReader;
|
|
12
|
+
|
|
13
|
+
#pragma pack(push, 1)
|
|
14
|
+
struct WzWaveFormat {
|
|
15
|
+
uint16_t wFormatTag = 0;
|
|
16
|
+
uint16_t nChannels = 0;
|
|
17
|
+
uint32_t nSamplesPerSec = 0;
|
|
18
|
+
uint32_t nAvgBytesPerSec = 0;
|
|
19
|
+
uint16_t nBlockAlign = 0;
|
|
20
|
+
uint16_t wBitsPerSample = 0;
|
|
21
|
+
uint16_t cbSize = 0;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
struct WzMp3WaveFormat {
|
|
25
|
+
WzWaveFormat wfx;
|
|
26
|
+
uint16_t wID = 0;
|
|
27
|
+
uint32_t fdwFlags = 0;
|
|
28
|
+
uint16_t nBlockSize = 0;
|
|
29
|
+
uint16_t nFramesPerBlock = 0;
|
|
30
|
+
uint16_t nCodecDelay = 0;
|
|
31
|
+
};
|
|
32
|
+
#pragma pack(pop)
|
|
33
|
+
|
|
34
|
+
class WzBinaryProperty : public WzImageProperty {
|
|
35
|
+
public:
|
|
36
|
+
WzBinaryProperty(const std::string& name,
|
|
37
|
+
WzBinaryReader* reader,
|
|
38
|
+
bool parseNow);
|
|
39
|
+
WZ_DISALLOW_COPY_AND_MOVE(WzBinaryProperty)
|
|
40
|
+
WzPropertyType PropertyType() const override { return WzPropertyType::Sound; }
|
|
41
|
+
Result<void> WriteValue(WzBinaryWriter* writer) const override;
|
|
42
|
+
|
|
43
|
+
const std::vector<uint8_t>& Header() const { return header_; }
|
|
44
|
+
int Length() const { return lenMs_; }
|
|
45
|
+
int Frequency() const { return wavFormat_.nSamplesPerSec; }
|
|
46
|
+
WzBinaryPropertyType Type() const { return type_; }
|
|
47
|
+
bool HeaderEncrypted() const { return headerEncrypted_; }
|
|
48
|
+
const WzWaveFormat& WavFormat() const { return wavFormat_; }
|
|
49
|
+
|
|
50
|
+
Result<std::vector<uint8_t>> GetBytes() override;
|
|
51
|
+
Result<std::vector<uint8_t>> GetBytes(bool saveInMemory);
|
|
52
|
+
Result<std::vector<uint8_t>> GetBytesForWAVPlayback(bool saveInMemory);
|
|
53
|
+
Result<void> SaveToFile(const std::string& filePath);
|
|
54
|
+
|
|
55
|
+
private:
|
|
56
|
+
void ParseWzSoundPropertyHeader();
|
|
57
|
+
|
|
58
|
+
std::vector<uint8_t> fileBytes_;
|
|
59
|
+
std::vector<uint8_t> header_;
|
|
60
|
+
WzBinaryReader* wzReader_ = nullptr;
|
|
61
|
+
WzWaveFormat wavFormat_;
|
|
62
|
+
int lenMs_ = 0;
|
|
63
|
+
int soundDataLen_ = 0;
|
|
64
|
+
int64_t offs_ = 0;
|
|
65
|
+
WzBinaryPropertyType type_ = WzBinaryPropertyType::Raw;
|
|
66
|
+
bool headerEncrypted_ = false;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
} // namespace wz
|
|
70
|
+
#endif // WZ_PROPERTIES_WZBINARYPROPERTY_H_
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#ifndef WZ_PROPERTIES_WZCANVASPROPERTY_H_
|
|
2
|
+
#define WZ_PROPERTIES_WZCANVASPROPERTY_H_
|
|
3
|
+
#include <memory>
|
|
4
|
+
#include <string>
|
|
5
|
+
#include "wz/Properties/WzPngProperty.h"
|
|
6
|
+
#include "wz/WzImageProperty.h"
|
|
7
|
+
#include "wz/WzPropertyCollection.h"
|
|
8
|
+
|
|
9
|
+
namespace wz {
|
|
10
|
+
class WzCanvasProperty : public WzImageProperty, public IPropertyContainer {
|
|
11
|
+
public:
|
|
12
|
+
static constexpr const char* InlinkPropertyName = "_inlink";
|
|
13
|
+
static constexpr const char* OutlinkPropertyName = "_outlink";
|
|
14
|
+
static constexpr const char* OriginPropertyName = "origin";
|
|
15
|
+
static constexpr const char* HeadPropertyName = "head";
|
|
16
|
+
static constexpr const char* LtPropertyName = "lt";
|
|
17
|
+
static constexpr const char* AnimationDelayPropertyName = "delay";
|
|
18
|
+
|
|
19
|
+
WzCanvasProperty();
|
|
20
|
+
explicit WzCanvasProperty(const std::string& name);
|
|
21
|
+
~WzCanvasProperty() override;
|
|
22
|
+
WZ_DISALLOW_COPY_AND_MOVE(WzCanvasProperty)
|
|
23
|
+
|
|
24
|
+
WzPropertyType PropertyType() const override {
|
|
25
|
+
return WzPropertyType::Canvas;
|
|
26
|
+
}
|
|
27
|
+
Result<void> WriteValue(WzBinaryWriter* writer) const override;
|
|
28
|
+
WzPropertyCollection* WzProperties() override { return &properties_; }
|
|
29
|
+
|
|
30
|
+
using IPropertyContainer::AddProperty;
|
|
31
|
+
Result<void> AddProperty(WzImageProperty* prop) override;
|
|
32
|
+
Result<void> AddProperty(std::unique_ptr<WzImageProperty> prop) override;
|
|
33
|
+
Result<std::unique_ptr<WzImageProperty>> RemoveProperty(
|
|
34
|
+
const std::string& propertyName) override;
|
|
35
|
+
Result<std::unique_ptr<WzImageProperty>> RemoveProperty(
|
|
36
|
+
WzImageProperty* prop) override;
|
|
37
|
+
Result<void> ClearProperties() override;
|
|
38
|
+
WzImageProperty* operator[](const std::string& name) override;
|
|
39
|
+
WzImageProperty* GetFromPath(const std::string& path) override;
|
|
40
|
+
|
|
41
|
+
WzPngProperty* PngProperty() const { return imageProp_.get(); }
|
|
42
|
+
void SetPngProperty(std::unique_ptr<WzPngProperty> prop) {
|
|
43
|
+
imageProp_ = std::move(prop);
|
|
44
|
+
}
|
|
45
|
+
bool ContainsInlinkProperty() const;
|
|
46
|
+
bool ContainsOutlinkProperty() const;
|
|
47
|
+
Result<void> SaveToFile(const std::string& filePath);
|
|
48
|
+
Result<WzImageProperty*> GetLinkedWzImageProperty();
|
|
49
|
+
|
|
50
|
+
private:
|
|
51
|
+
WzPropertyCollection properties_;
|
|
52
|
+
std::unique_ptr<WzPngProperty> imageProp_;
|
|
53
|
+
};
|
|
54
|
+
} // namespace wz
|
|
55
|
+
#endif // WZ_PROPERTIES_WZCANVASPROPERTY_H_
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#ifndef WZ_PROPERTIES_WZCONVEXPROPERTY_H_
|
|
2
|
+
#define WZ_PROPERTIES_WZCONVEXPROPERTY_H_
|
|
3
|
+
#include "wz/WzImageProperty.h"
|
|
4
|
+
#include "wz/WzPropertyCollection.h"
|
|
5
|
+
|
|
6
|
+
namespace wz {
|
|
7
|
+
class WzConvexProperty : public WzImageProperty, public IPropertyContainer {
|
|
8
|
+
public:
|
|
9
|
+
WzConvexProperty();
|
|
10
|
+
explicit WzConvexProperty(const std::string& name);
|
|
11
|
+
~WzConvexProperty() override;
|
|
12
|
+
WZ_DISALLOW_COPY_AND_MOVE(WzConvexProperty)
|
|
13
|
+
|
|
14
|
+
WzPropertyType PropertyType() const override {
|
|
15
|
+
return WzPropertyType::Convex;
|
|
16
|
+
}
|
|
17
|
+
Result<void> WriteValue(WzBinaryWriter* writer) const override;
|
|
18
|
+
WzPropertyCollection* WzProperties() override { return &properties_; }
|
|
19
|
+
using IPropertyContainer::AddProperty;
|
|
20
|
+
Result<void> AddProperty(WzImageProperty* prop) override;
|
|
21
|
+
Result<void> AddProperty(std::unique_ptr<WzImageProperty> prop) override;
|
|
22
|
+
Result<std::unique_ptr<WzImageProperty>> RemoveProperty(
|
|
23
|
+
const std::string& propertyName) override;
|
|
24
|
+
Result<std::unique_ptr<WzImageProperty>> RemoveProperty(
|
|
25
|
+
WzImageProperty* prop) override;
|
|
26
|
+
Result<void> ClearProperties() override;
|
|
27
|
+
WzImageProperty* operator[](const std::string& name) override;
|
|
28
|
+
WzImageProperty* GetFromPath(const std::string& path) override;
|
|
29
|
+
|
|
30
|
+
private:
|
|
31
|
+
WzPropertyCollection properties_;
|
|
32
|
+
};
|
|
33
|
+
} // namespace wz
|
|
34
|
+
#endif // WZ_PROPERTIES_WZCONVEXPROPERTY_H_
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#ifndef WZ_PROPERTIES_WZDOUBLEPROPERTY_H_
|
|
2
|
+
#define WZ_PROPERTIES_WZDOUBLEPROPERTY_H_
|
|
3
|
+
#include "wz/WzImageProperty.h"
|
|
4
|
+
namespace wz {
|
|
5
|
+
class WzDoubleProperty : public WzImageProperty {
|
|
6
|
+
public:
|
|
7
|
+
WzDoubleProperty() = default;
|
|
8
|
+
WzDoubleProperty(const std::string& name, double value) : value_(value) {
|
|
9
|
+
SetName(name);
|
|
10
|
+
}
|
|
11
|
+
WZ_DISALLOW_COPY_AND_MOVE(WzDoubleProperty)
|
|
12
|
+
WzPropertyType PropertyType() const override {
|
|
13
|
+
return WzPropertyType::Double;
|
|
14
|
+
}
|
|
15
|
+
double Value() const { return value_; }
|
|
16
|
+
Result<void> WriteValue(WzBinaryWriter* writer) const override;
|
|
17
|
+
void SetValue(double value) override {
|
|
18
|
+
if (value_ == value) return;
|
|
19
|
+
value_ = value;
|
|
20
|
+
MarkParentImageChanged();
|
|
21
|
+
}
|
|
22
|
+
double GetDouble() const override { return value_; }
|
|
23
|
+
float GetFloat() const override { return static_cast<float>(value_); }
|
|
24
|
+
int32_t GetInt() const override { return static_cast<int32_t>(value_); }
|
|
25
|
+
int16_t GetShort() const override { return static_cast<int16_t>(value_); }
|
|
26
|
+
int64_t GetLong() const override { return static_cast<int64_t>(value_); }
|
|
27
|
+
|
|
28
|
+
private:
|
|
29
|
+
double value_ = 0.0;
|
|
30
|
+
};
|
|
31
|
+
} // namespace wz
|
|
32
|
+
#endif // WZ_PROPERTIES_WZDOUBLEPROPERTY_H_
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#ifndef WZ_PROPERTIES_WZFLOATPROPERTY_H_
|
|
2
|
+
#define WZ_PROPERTIES_WZFLOATPROPERTY_H_
|
|
3
|
+
#include "wz/WzImageProperty.h"
|
|
4
|
+
namespace wz {
|
|
5
|
+
class WzFloatProperty : public WzImageProperty {
|
|
6
|
+
public:
|
|
7
|
+
WzFloatProperty() = default;
|
|
8
|
+
WzFloatProperty(const std::string& name, float value) : value_(value) {
|
|
9
|
+
SetName(name);
|
|
10
|
+
}
|
|
11
|
+
WZ_DISALLOW_COPY_AND_MOVE(WzFloatProperty)
|
|
12
|
+
WzPropertyType PropertyType() const override { return WzPropertyType::Float; }
|
|
13
|
+
float Value() const { return value_; }
|
|
14
|
+
Result<void> WriteValue(WzBinaryWriter* writer) const override;
|
|
15
|
+
void SetValue(float value) override {
|
|
16
|
+
if (value_ == value) return;
|
|
17
|
+
value_ = value;
|
|
18
|
+
MarkParentImageChanged();
|
|
19
|
+
}
|
|
20
|
+
float GetFloat() const override { return value_; }
|
|
21
|
+
double GetDouble() const override { return value_; }
|
|
22
|
+
int32_t GetInt() const override { return static_cast<int32_t>(value_); }
|
|
23
|
+
int16_t GetShort() const override { return static_cast<int16_t>(value_); }
|
|
24
|
+
int64_t GetLong() const override { return static_cast<int64_t>(value_); }
|
|
25
|
+
|
|
26
|
+
private:
|
|
27
|
+
float value_ = 0.0f;
|
|
28
|
+
};
|
|
29
|
+
} // namespace wz
|
|
30
|
+
#endif // WZ_PROPERTIES_WZFLOATPROPERTY_H_
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#ifndef WZ_PROPERTIES_WZINTPROPERTY_H_
|
|
2
|
+
#define WZ_PROPERTIES_WZINTPROPERTY_H_
|
|
3
|
+
#include "wz/WzImageProperty.h"
|
|
4
|
+
namespace wz {
|
|
5
|
+
class WzIntProperty : public WzImageProperty {
|
|
6
|
+
public:
|
|
7
|
+
WzIntProperty() = default;
|
|
8
|
+
WzIntProperty(const std::string& name, int32_t value) : value_(value) {
|
|
9
|
+
SetName(name);
|
|
10
|
+
}
|
|
11
|
+
WZ_DISALLOW_COPY_AND_MOVE(WzIntProperty)
|
|
12
|
+
WzPropertyType PropertyType() const override { return WzPropertyType::Int; }
|
|
13
|
+
int32_t Value() const { return value_; }
|
|
14
|
+
Result<void> WriteValue(WzBinaryWriter* writer) const override;
|
|
15
|
+
void SetValue(int32_t value) override {
|
|
16
|
+
if (value_ == value) return;
|
|
17
|
+
value_ = value;
|
|
18
|
+
MarkParentImageChanged();
|
|
19
|
+
}
|
|
20
|
+
int32_t GetInt() const override { return value_; }
|
|
21
|
+
int16_t GetShort() const override { return static_cast<int16_t>(value_); }
|
|
22
|
+
int64_t GetLong() const override { return value_; }
|
|
23
|
+
float GetFloat() const override { return static_cast<float>(value_); }
|
|
24
|
+
double GetDouble() const override { return static_cast<double>(value_); }
|
|
25
|
+
|
|
26
|
+
private:
|
|
27
|
+
int32_t value_ = 0;
|
|
28
|
+
};
|
|
29
|
+
} // namespace wz
|
|
30
|
+
#endif // WZ_PROPERTIES_WZINTPROPERTY_H_
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#ifndef WZ_PROPERTIES_WZLONGPROPERTY_H_
|
|
2
|
+
#define WZ_PROPERTIES_WZLONGPROPERTY_H_
|
|
3
|
+
#include "wz/WzImageProperty.h"
|
|
4
|
+
namespace wz {
|
|
5
|
+
class WzLongProperty : public WzImageProperty {
|
|
6
|
+
public:
|
|
7
|
+
WzLongProperty() = default;
|
|
8
|
+
WzLongProperty(const std::string& name, int64_t value) : value_(value) {
|
|
9
|
+
SetName(name);
|
|
10
|
+
}
|
|
11
|
+
WZ_DISALLOW_COPY_AND_MOVE(WzLongProperty)
|
|
12
|
+
WzPropertyType PropertyType() const override { return WzPropertyType::Long; }
|
|
13
|
+
int64_t Value() const { return value_; }
|
|
14
|
+
Result<void> WriteValue(WzBinaryWriter* writer) const override;
|
|
15
|
+
void SetValue(int64_t value) override {
|
|
16
|
+
if (value_ == value) return;
|
|
17
|
+
value_ = value;
|
|
18
|
+
MarkParentImageChanged();
|
|
19
|
+
}
|
|
20
|
+
int32_t GetInt() const override { return static_cast<int32_t>(value_); }
|
|
21
|
+
int16_t GetShort() const override { return static_cast<int16_t>(value_); }
|
|
22
|
+
int64_t GetLong() const override { return value_; }
|
|
23
|
+
float GetFloat() const override { return static_cast<float>(value_); }
|
|
24
|
+
double GetDouble() const override { return static_cast<double>(value_); }
|
|
25
|
+
|
|
26
|
+
private:
|
|
27
|
+
int64_t value_ = 0;
|
|
28
|
+
};
|
|
29
|
+
} // namespace wz
|
|
30
|
+
#endif // WZ_PROPERTIES_WZLONGPROPERTY_H_
|