Skip to content

Commit 0160c77

Browse files
Merge pull request #4 from Live2D/develop
Update to Cubism 4 SDK for Java R1 beta3
2 parents d14d187 + 4a33996 commit 0160c77

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7+
## [4-r.1-beta.3] - 2023-03-10
8+
9+
### Added
10+
11+
* Add function to validate MOC3 files.
12+
713
## [4-r.1-beta.2] - 2023-01-26
814

915
### Added
@@ -59,6 +65,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5965
### Added
6066

6167
* New released!
62-
68+
*
69+
[4-r.1-beta.3]: https://github.com/Live2D/CubismJavaFramework/compare/4-r.1-beta.2...4-r.1-beta.3
6370
[4-r.1-beta.2]: https://github.com/Live2D/CubismJavaFramework/compare/4-r.1-beta.1...4-r.1-beta.2
6471
[4-r.1-beta.1]: https://github.com/Live2D/CubismJavaFramework/compare/4-r.1-alpha.1...4-r.1-beta.1

framework/src/main/java/com/live2d/sdk/cubism/framework/model/CubismMoc.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package com.live2d.sdk.cubism.framework.model;
99

1010
import com.live2d.sdk.cubism.core.Live2DCubismCore;
11+
import com.live2d.sdk.cubism.framework.utils.CubismDebug;
1112

1213
import java.text.ParseException;
1314

@@ -50,6 +51,18 @@ public static int getLatestMocVersion() {
5051
return Live2DCubismCore.getLatestMocVersion();
5152
}
5253

54+
/**
55+
* .moc3ファイルがロードされたメモリを参照し、フォーマットが正しいかチェックする。(不正なファイルかどうかのチェック)
56+
* Native CoreのcsmHasMocConsistencyに対応する。
57+
*
58+
* @param mocBytes .moc3が読まれたデータ配列
59+
*
60+
* @return .moc3が有効なデータであるかどうか。有効なデータならtrue
61+
*/
62+
public static boolean hasMocConsistency(byte[] mocBytes) {
63+
return Live2DCubismCore.hasMocConsistency(mocBytes);
64+
}
65+
5366
/**
5467
* Create a model.
5568
*
@@ -105,7 +118,6 @@ public int getMocVersion() {
105118
return mocVersion;
106119
}
107120

108-
109121
/**
110122
* private constructor
111123
*/

0 commit comments

Comments
 (0)