diff --git a/CHANGELOG.md b/CHANGELOG.md index 82c150a..a5eaedf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [4-r.6.1] - 2023-03-10 + +### Added + +* Add function to validate MOC3 files. + + ## [4-r.6] - 2023-02-21 ### Added @@ -244,6 +251,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Fix invalid expressions of `CubismCdiJson`. +[4-r.6.1]: https://github.com/Live2D/CubismNativeFramework/compare/4-r.6...4-r.6.1 [4-r.6]: https://github.com/Live2D/CubismNativeFramework/compare/4-r.5.1...4-r.6 [4-r.5.1]: https://github.com/Live2D/CubismNativeFramework/compare/4-r.5...4-r.5.1 [4-r.5]: https://github.com/Live2D/CubismNativeFramework/compare/4-r.5-beta.5...4-r.5 diff --git a/src/Model/CubismMoc.cpp b/src/Model/CubismMoc.cpp index ec6e0a1..4394bca 100644 --- a/src/Model/CubismMoc.cpp +++ b/src/Model/CubismMoc.cpp @@ -82,4 +82,10 @@ Core::csmMocVersion CubismMoc::GetMocVersion() return _mocVersion; } +csmBool CubismMoc::HasMocConsistency(void* address, const csmUint32 size) +{ + csmInt32 consistencyFlags = Core::csmHasMocConsistency(address, size); + return consistencyFlags != 0 ? true : false; +} + }}} diff --git a/src/Model/CubismMoc.hpp b/src/Model/CubismMoc.hpp index 209e88d..ce77d44 100644 --- a/src/Model/CubismMoc.hpp +++ b/src/Model/CubismMoc.hpp @@ -75,6 +75,16 @@ class CubismMoc */ Core::csmMocVersion GetMocVersion(); + /** + * @brief Checks consistency of a moc. + * + * @param address Address of unrevived moc. The address must be aligned to 'csmAlignofMoc'. + * @param size Size of moc (in bytes). + * + * @return '1' if Moc is valid; '0' otherwise. + */ + static csmBool HasMocConsistency(void* address, const csmUint32 size); + private: /** * @brief コンストラクタ