Skip to content

Commit c816f24

Browse files
Merge pull request #44 from Live2D/develop
Update to Cubism 5 SDK for Native R1 beta4
2 parents 12dea6c + 88d13ad commit c816f24

77 files changed

Lines changed: 2819 additions & 696 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,34 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77

8-
## [5-r.1-beta.3] - 2023-10-12
8+
## [5-r.1-beta.4] - 2024-01-25
9+
10+
### Added
11+
12+
* Add `LAppWavFileHandler` class for Android and iOS.
13+
* Add functions for MotionSyncPlugin to `LAppWavFileHandler` in Windows and macOS.
14+
15+
### Changed
916

17+
* Change so that `LAppSprite` is not depend on `LAppDelegate` in Android.
18+
* Change so that `ViewController` is not include on `LAppSprite` in iOS.
19+
* Change the path acquisition process to a library function on OpenGL Mac and Linux.
20+
* Change the compile and target SDK version of Android OS to 14.0 (API 34).
21+
* Upgrade the version of Android Gradle Plugin from 8.0.2 to 8.1.1.
22+
* Upgrade the version of Gradle from 8.1.1 to 8.2.
23+
* Change the minimum version of Android Studio to Hedgehog(2023.1.1).
24+
25+
### Fixed
26+
27+
* The version set in `sourceCompatibility` and `targetCompatibility` in `build.gradle`'s `compileOptions` has been lowered to `JavaVersion.VERSION_1_7`.
28+
* The version of CMake set in `externalNativeBuild` was raised to `3.22.1`.
29+
* Fix to check for null when reading json.
30+
* Replace deprecated features in Android.
31+
* Fix an issue that caused some graphics drivers to not render correctly in Vulkan.
32+
* Fix an issue that caused incorrect selection of depth format in Vulkan.
33+
* Fix errors that occurs when building with x86 in vulkan.
34+
35+
## [5-r.1-beta.3] - 2023-10-12
1036

1137
### Added
1238

@@ -354,6 +380,7 @@ See [Core Changelog] for details.
354380
* What was `Package.json` is currently being changed to`cubism-info.yml`.
355381

356382

383+
[5-r.1-beta.4]: https://github.com/Live2D/CubismNativeSamples/compare/5-r.1-beta.3...5-r.1-beta.4
357384
[5-r.1-beta.3]: https://github.com/Live2D/CubismNativeSamples/compare/5-r.1-beta.2...5-r.1-beta.3
358385
[5-r.1-beta.2]: https://github.com/Live2D/CubismNativeSamples/compare/5-r.1-beta.1...5-r.1-beta.2
359386
[5-r.1-beta.1]: https://github.com/Live2D/CubismNativeSamples/compare/4-r.7...5-r.1-beta.1

Core/README.ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Core
2929
| プラットフォーム | アーキテクチャ | dll | lib | パス | 注記 |
3030
| --- | --- | --- | --- | --- | --- |
3131
| Android | ARM64 ||| android/arm64-v8a | |
32-
| Android | ARMv7 ||| android/armeabi-v7a | |
32+
| Android | ARMv7 ||| android/armeabi-v7a | このライブラリは現在非推奨で、近日中に削除される予定です。 |
3333
| Android | x86 ||| android/x86 | |
3434
| Android | x86_64 ||| android/x86_64 | |
3535
| iOS | ARM64 | || ios/xxx-iphoneos | iOSデバイス |

Core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Core
3131
| Platform | Architecture | dll | lib | Path | Note |
3232
| --- | --- | --- | --- | --- | --- |
3333
| Android | ARM64 ||| android/arm64-v8a | |
34-
| Android | ARMv7 ||| android/armeabi-v7a | |
34+
| Android | ARMv7 ||| android/armeabi-v7a | This library is currently deprecated and will be removed in the near future. |
3535
| Android | x86 ||| android/x86 | |
3636
| Android | x86_64 ||| android/x86_64 | |
3737
| iOS | ARM64 | || ios/xxx-iphoneos | iOS Devices |

NOTICE.ja.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44

55
# お知らせ
66

7+
## [注意事項] Metal の Mac Catalyst のビルドエラーについて (2024-01-25)
8+
9+
MetalのMac Catalystのビルド時にエラーが発生する場合がございます。
10+
具体的には`cmake3.27.0`以上を使用してプロジェクトを生成した際に`'Foundation/NSURLHandle.h' file not found`といったエラーが発生いたします。
11+
詳細については継続して調査いたします。
12+
13+
### 回避方法
14+
15+
* cmakeを3.27未満のバージョンで使用する
16+
17+
718
## [注意事項] Cocos2d-xセットアップのエラーについて (2022-03-15)
819

920
Cocos2d-xサンプルプロジェクトのセットアップ時に実行するsetup-cocos2dバッチにおいてエラーが発生いたします。

NOTICE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44

55
# Notices
66

7+
## [Caution] Mac Catalyst build error for Metal (2024-01-25)
8+
9+
There is an error when building Mac Catalyst for Metal.
10+
Specifically, when generating a project using `cmake3.27.0` or higher, errors such as `'Foundation/NSURLHandle.h' file not found` will occur.
11+
We will continue to investigate the details.
12+
13+
### Workaround
14+
15+
* Use cmake with versions less than 3.27
16+
17+
718
## [Caution] About Cocos2d-x setup error (2022-03-15)
819

920
An error occurs in the setup-cocos2d batch that is executed when setting up the Cocos2d-x sample project.

README.ja.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ Demo
107107

108108
| 開発ツール | バージョン |
109109
| --- | --- |
110-
| Android Studio | Giraffe 2022.3.1 |
111-
| CMake | 3.27.1 |
110+
| Android Studio | Hedgehog 2023.1.1 |
111+
| CMake | 3.28.1 |
112112
| Visual Studio 2013 | Update 5 |
113113
| Visual Studio 2015 | Update 3 |
114-
| Visual Studio 2017 | 15.9.57 |
115-
| Visual Studio 2019 | 16.11.30 |
116-
| Visual Studio 2022 | 17.7.4 |
117-
| Xcode | 14.3.1 |
114+
| Visual Studio 2017 | 15.9.59 |
115+
| Visual Studio 2019 | 16.11.33 |
116+
| Visual Studio 2022 | 17.8.4 |
117+
| Xcode | 15.1 |
118118

119119
### Android
120120

@@ -152,7 +152,7 @@ Demo
152152
| プラットフォーム | バージョン |
153153
| --- | --- |
154154
| iOS / iPadOS | 16.6.1 |
155-
| macOS | 13.6 |
155+
| macOS | 14.1.1 |
156156
| Windows 10 | 22H2 |
157157
| Windows 11 | 22H2 |
158158

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ Please refer to [CHANGELOG.md](CHANGELOG.md) for the changelog of this repositor
106106

107107
| Development Tool | Version |
108108
| --- | --- |
109-
| Android Studio | Giraffe 2022.3.1 |
110-
| CMake | 3.27.1 |
109+
| Android Studio | Hedgehog 2023.1.1 |
110+
| CMake | 3.28.1 |
111111
| Visual Studio 2013 | Update 5 |
112112
| Visual Studio 2015 | Update 3 |
113-
| Visual Studio 2017 | 15.9.57 |
114-
| Visual Studio 2019 | 16.11.30 |
115-
| Visual Studio 2022 | 17.7.4 |
116-
| Xcode | 14.3.1 |
113+
| Visual Studio 2017 | 15.9.59 |
114+
| Visual Studio 2019 | 16.11.33 |
115+
| Visual Studio 2022 | 17.8.4 |
116+
| Xcode | 15.1 |
117117

118118
### Android
119119

@@ -151,7 +151,7 @@ Please refer to [CHANGELOG.md](CHANGELOG.md) for the changelog of this repositor
151151
| Platform | Version |
152152
| --- | --- |
153153
| iOS / iPadOS | 16.6.1 |
154-
| macOS | 13.6 |
154+
| macOS | 14.1.1 |
155155
| Windows 10 | 22H2 |
156156
| Windows 11 | 22H2 |
157157

Samples/Cocos2d-x/Demo/Classes/LAppModel.cpp

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,15 @@ void LAppModel::SetupModel(ICubismModelSetting* setting)
184184
buffer = CreateBuffer(path.GetRawString(), &size);
185185
ACubismMotion* motion = LoadExpression(buffer, size, name.GetRawString());
186186

187-
if (_expressions[name] != NULL)
187+
if (motion)
188188
{
189-
ACubismMotion::Delete(_expressions[name]);
190-
_expressions[name] = NULL;
189+
if (_expressions[name] != NULL)
190+
{
191+
ACubismMotion::Delete(_expressions[name]);
192+
_expressions[name] = NULL;
193+
}
194+
_expressions[name] = motion;
191195
}
192-
_expressions[name] = motion;
193196

194197
DeleteBuffer(buffer, path.GetRawString());
195198
}
@@ -309,24 +312,27 @@ void LAppModel::PreloadMotionGroup(const csmChar* group)
309312
buffer = CreateBuffer(path.GetRawString(), &size);
310313
CubismMotion* tmpMotion = static_cast<CubismMotion*>(LoadMotion(buffer, size, name.GetRawString()));
311314

312-
csmFloat32 fadeTime = _modelSetting->GetMotionFadeInTimeValue(group, i);
313-
if (fadeTime >= 0.0f)
315+
if (tmpMotion)
314316
{
315-
tmpMotion->SetFadeInTime(fadeTime);
316-
}
317+
csmFloat32 fadeTime = _modelSetting->GetMotionFadeInTimeValue(group, i);
318+
if (fadeTime >= 0.0f)
319+
{
320+
tmpMotion->SetFadeInTime(fadeTime);
321+
}
317322

318-
fadeTime = _modelSetting->GetMotionFadeOutTimeValue(group, i);
319-
if (fadeTime >= 0.0f)
320-
{
321-
tmpMotion->SetFadeOutTime(fadeTime);
322-
}
323-
tmpMotion->SetEffectIds(_eyeBlinkIds, _lipSyncIds);
323+
fadeTime = _modelSetting->GetMotionFadeOutTimeValue(group, i);
324+
if (fadeTime >= 0.0f)
325+
{
326+
tmpMotion->SetFadeOutTime(fadeTime);
327+
}
328+
tmpMotion->SetEffectIds(_eyeBlinkIds, _lipSyncIds);
324329

325-
if (_motions[name] != NULL)
326-
{
327-
ACubismMotion::Delete(_motions[name]);
330+
if (_motions[name] != NULL)
331+
{
332+
ACubismMotion::Delete(_motions[name]);
333+
}
334+
_motions[name] = tmpMotion;
328335
}
329-
_motions[name] = tmpMotion;
330336

331337
DeleteBuffer(buffer, path.GetRawString());
332338

@@ -513,19 +519,23 @@ CubismMotionQueueEntryHandle LAppModel::StartMotion(const csmChar* group, csmInt
513519
csmSizeInt size;
514520
buffer = CreateBuffer(path.GetRawString(), &size);
515521
motion = static_cast<CubismMotion*>(LoadMotion(buffer, size, NULL, onFinishedMotionHandler));
516-
csmFloat32 fadeTime = _modelSetting->GetMotionFadeInTimeValue(group, no);
517-
if (fadeTime >= 0.0f)
518-
{
519-
motion->SetFadeInTime(fadeTime);
520-
}
521522

522-
fadeTime = _modelSetting->GetMotionFadeOutTimeValue(group, no);
523-
if (fadeTime >= 0.0f)
523+
if (motion)
524524
{
525-
motion->SetFadeOutTime(fadeTime);
525+
csmFloat32 fadeTime = _modelSetting->GetMotionFadeInTimeValue(group, no);
526+
if (fadeTime >= 0.0f)
527+
{
528+
motion->SetFadeInTime(fadeTime);
529+
}
530+
531+
fadeTime = _modelSetting->GetMotionFadeOutTimeValue(group, no);
532+
if (fadeTime >= 0.0f)
533+
{
534+
motion->SetFadeOutTime(fadeTime);
535+
}
536+
motion->SetEffectIds(_eyeBlinkIds, _lipSyncIds);
537+
autoDelete = true; // 終了時にメモリから削除
526538
}
527-
motion->SetEffectIds(_eyeBlinkIds, _lipSyncIds);
528-
autoDelete = true; // 終了時にメモリから削除
529539

530540
DeleteBuffer(buffer, path.GetRawString());
531541
}

Samples/Cocos2d-x/README.ja.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Cocos2d-xで実装したアプリケーションのサンプル実装です。
1111

1212
| フレームワーク | バージョン |
1313
| --- | --- |
14-
| [Xcode] | 12.4 |
14+
| [Xcode] | 15.1 |
1515
| [Cocos2d-x] | 4.0 (`95e5d868ce5958c0dadfc485bdda52f1bc404fe0`) |
1616

1717
その他の開発環境・動作確認環境はトップディレクトリにある [README.md](../../README.ja.md) を参照してください。
@@ -68,6 +68,10 @@ NOTE: 事前に下記の SDK のダウンロードが必要です
6868
* NDK
6969
* CMake
7070

71+
ビルド時に下記の手順を行なってください。
72+
73+
1. Android Studio の `File - Build, Execution, Deployment - Build Tools - Gradle - Gradle JDK``1.8` に設定してください
74+
7175
### proj.ios
7276

7377
iOS 用の CMake プロジェクトです。
@@ -82,6 +86,24 @@ iOS 用の CMake プロジェクトです。
8286

8387
1. Xcode の `Project設定 - TARGETS - Demo - Packaging - Info.plist File` に記載されている `Info.plist` 内の `Executable file``$(EXECUTABLE_NAME)` または`Demo`(アプリ名)に書き換えてください
8488

89+
1. `cocos2d/cocos/2d/CCFontAtlas.h` に以下の修正を加えてください
90+
```CCFontAtlas.h
91+
@@ -30,6 +30,7 @@
92+
93+
#include <string>
94+
#include <unordered_map>
95+
+#include <iconv.h>
96+
97+
#include "platform/CCPlatformMacros.h"
98+
#include "base/CCRef.h"
99+
@@ -129,7 +130,7 @@ protected:
100+
float _lineHeight;
101+
Font* _font;
102+
FontFreeType* _fontFreeType;
103+
- void* _iconv;
104+
+ iconv_t _iconv;
105+
```
106+
85107
NOTICE: Cubism Core は i386 アーキテクチャをサポートしていないため、**iPhone Simulator 向けのビルドは行えません。**
86108

87109
### proj.linux
@@ -119,6 +141,26 @@ WARNING: macOSビルドにつきまして、`Cocos2d-x V4.0` に起因する不
119141
#20607
120142
](https://github.com/cocos2d/cocos2d-x/issues/20607#issuecomment-780266298)
121143

144+
ビルド時に下記の手順を行なってください。
145+
146+
1. `cocos2d/cocos/2d/CCFontAtlas.h` に以下の修正を加えてください
147+
```CCFontAtlas.h
148+
@@ -30,6 +30,7 @@
149+
150+
#include <string>
151+
#include <unordered_map>
152+
+#include <iconv.h>
153+
154+
#include "platform/CCPlatformMacros.h"
155+
#include "base/CCRef.h"
156+
@@ -129,7 +130,7 @@ protected:
157+
float _lineHeight;
158+
Font* _font;
159+
FontFreeType* _fontFreeType;
160+
- void* _iconv;
161+
+ iconv_t _iconv;
162+
```
163+
122164
### proj.win
123165

124166
Windows 用の CMake プロジェクトです。

0 commit comments

Comments
 (0)