Skip to content

Commit

Permalink
Update to Cubism 5 SDK for Native R1 beta4
Browse files Browse the repository at this point in the history
  • Loading branch information
wada-at-live2d-com committed Jan 25, 2024
1 parent 8edce19 commit 88d13ad
Show file tree
Hide file tree
Showing 77 changed files with 2,819 additions and 696 deletions.
29 changes: 28 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,34 @@ 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/).


## [5-r.1-beta.3] - 2023-10-12
## [5-r.1-beta.4] - 2024-01-25

### Added

* Add `LAppWavFileHandler` class for Android and iOS.
* Add functions for MotionSyncPlugin to `LAppWavFileHandler` in Windows and macOS.

### Changed

* Change so that `LAppSprite` is not depend on `LAppDelegate` in Android.
* Change so that `ViewController` is not include on `LAppSprite` in iOS.
* Change the path acquisition process to a library function on OpenGL Mac and Linux.
* Change the compile and target SDK version of Android OS to 14.0 (API 34).
* Upgrade the version of Android Gradle Plugin from 8.0.2 to 8.1.1.
* Upgrade the version of Gradle from 8.1.1 to 8.2.
* Change the minimum version of Android Studio to Hedgehog(2023.1.1).

### Fixed

* The version set in `sourceCompatibility` and `targetCompatibility` in `build.gradle`'s `compileOptions` has been lowered to `JavaVersion.VERSION_1_7`.
* The version of CMake set in `externalNativeBuild` was raised to `3.22.1`.
* Fix to check for null when reading json.
* Replace deprecated features in Android.
* Fix an issue that caused some graphics drivers to not render correctly in Vulkan.
* Fix an issue that caused incorrect selection of depth format in Vulkan.
* Fix errors that occurs when building with x86 in vulkan.

## [5-r.1-beta.3] - 2023-10-12

### Added

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


[5-r.1-beta.4]: https://github.com/Live2D/CubismNativeSamples/compare/5-r.1-beta.3...5-r.1-beta.4
[5-r.1-beta.3]: https://github.com/Live2D/CubismNativeSamples/compare/5-r.1-beta.2...5-r.1-beta.3
[5-r.1-beta.2]: https://github.com/Live2D/CubismNativeSamples/compare/5-r.1-beta.1...5-r.1-beta.2
[5-r.1-beta.1]: https://github.com/Live2D/CubismNativeSamples/compare/4-r.7...5-r.1-beta.1
Expand Down
2 changes: 1 addition & 1 deletion Core/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Core
| プラットフォーム | アーキテクチャ | dll | lib | パス | 注記 |
| --- | --- | --- | --- | --- | --- |
| Android | ARM64 ||| android/arm64-v8a | |
| Android | ARMv7 ||| android/armeabi-v7a | |
| Android | ARMv7 ||| android/armeabi-v7a | このライブラリは現在非推奨で、近日中に削除される予定です。 |
| Android | x86 ||| android/x86 | |
| Android | x86_64 ||| android/x86_64 | |
| iOS | ARM64 | || ios/xxx-iphoneos | iOSデバイス |
Expand Down
2 changes: 1 addition & 1 deletion Core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Core
| Platform | Architecture | dll | lib | Path | Note |
| --- | --- | --- | --- | --- | --- |
| Android | ARM64 ||| android/arm64-v8a | |
| Android | ARMv7 ||| android/armeabi-v7a | |
| Android | ARMv7 ||| android/armeabi-v7a | This library is currently deprecated and will be removed in the near future. |
| Android | x86 ||| android/x86 | |
| Android | x86_64 ||| android/x86_64 | |
| iOS | ARM64 | || ios/xxx-iphoneos | iOS Devices |
Expand Down
11 changes: 11 additions & 0 deletions NOTICE.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

# お知らせ

## [注意事項] Metal の Mac Catalyst のビルドエラーについて (2024-01-25)

MetalのMac Catalystのビルド時にエラーが発生する場合がございます。
具体的には`cmake3.27.0`以上を使用してプロジェクトを生成した際に`'Foundation/NSURLHandle.h' file not found`といったエラーが発生いたします。
詳細については継続して調査いたします。

### 回避方法

* cmakeを3.27未満のバージョンで使用する


## [注意事項] Cocos2d-xセットアップのエラーについて (2022-03-15)

Cocos2d-xサンプルプロジェクトのセットアップ時に実行するsetup-cocos2dバッチにおいてエラーが発生いたします。
Expand Down
11 changes: 11 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

# Notices

## [Caution] Mac Catalyst build error for Metal (2024-01-25)

There is an error when building Mac Catalyst for Metal.
Specifically, when generating a project using `cmake3.27.0` or higher, errors such as `'Foundation/NSURLHandle.h' file not found` will occur.
We will continue to investigate the details.

### Workaround

* Use cmake with versions less than 3.27


## [Caution] About Cocos2d-x setup error (2022-03-15)

An error occurs in the setup-cocos2d batch that is executed when setting up the Cocos2d-x sample project.
Expand Down
14 changes: 7 additions & 7 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ Demo

| 開発ツール | バージョン |
| --- | --- |
| Android Studio | Giraffe 2022.3.1 |
| CMake | 3.27.1 |
| Android Studio | Hedgehog 2023.1.1 |
| CMake | 3.28.1 |
| Visual Studio 2013 | Update 5 |
| Visual Studio 2015 | Update 3 |
| Visual Studio 2017 | 15.9.57 |
| Visual Studio 2019 | 16.11.30 |
| Visual Studio 2022 | 17.7.4 |
| Xcode | 14.3.1 |
| Visual Studio 2017 | 15.9.59 |
| Visual Studio 2019 | 16.11.33 |
| Visual Studio 2022 | 17.8.4 |
| Xcode | 15.1 |

### Android

Expand Down Expand Up @@ -152,7 +152,7 @@ Demo
| プラットフォーム | バージョン |
| --- | --- |
| iOS / iPadOS | 16.6.1 |
| macOS | 13.6 |
| macOS | 14.1.1 |
| Windows 10 | 22H2 |
| Windows 11 | 22H2 |

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ Please refer to [CHANGELOG.md](CHANGELOG.md) for the changelog of this repositor

| Development Tool | Version |
| --- | --- |
| Android Studio | Giraffe 2022.3.1 |
| CMake | 3.27.1 |
| Android Studio | Hedgehog 2023.1.1 |
| CMake | 3.28.1 |
| Visual Studio 2013 | Update 5 |
| Visual Studio 2015 | Update 3 |
| Visual Studio 2017 | 15.9.57 |
| Visual Studio 2019 | 16.11.30 |
| Visual Studio 2022 | 17.7.4 |
| Xcode | 14.3.1 |
| Visual Studio 2017 | 15.9.59 |
| Visual Studio 2019 | 16.11.33 |
| Visual Studio 2022 | 17.8.4 |
| Xcode | 15.1 |

### Android

Expand Down Expand Up @@ -151,7 +151,7 @@ Please refer to [CHANGELOG.md](CHANGELOG.md) for the changelog of this repositor
| Platform | Version |
| --- | --- |
| iOS / iPadOS | 16.6.1 |
| macOS | 13.6 |
| macOS | 14.1.1 |
| Windows 10 | 22H2 |
| Windows 11 | 22H2 |

Expand Down
66 changes: 38 additions & 28 deletions Samples/Cocos2d-x/Demo/Classes/LAppModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,15 @@ void LAppModel::SetupModel(ICubismModelSetting* setting)
buffer = CreateBuffer(path.GetRawString(), &size);
ACubismMotion* motion = LoadExpression(buffer, size, name.GetRawString());

if (_expressions[name] != NULL)
if (motion)
{
ACubismMotion::Delete(_expressions[name]);
_expressions[name] = NULL;
if (_expressions[name] != NULL)
{
ACubismMotion::Delete(_expressions[name]);
_expressions[name] = NULL;
}
_expressions[name] = motion;
}
_expressions[name] = motion;

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

csmFloat32 fadeTime = _modelSetting->GetMotionFadeInTimeValue(group, i);
if (fadeTime >= 0.0f)
if (tmpMotion)
{
tmpMotion->SetFadeInTime(fadeTime);
}
csmFloat32 fadeTime = _modelSetting->GetMotionFadeInTimeValue(group, i);
if (fadeTime >= 0.0f)
{
tmpMotion->SetFadeInTime(fadeTime);
}

fadeTime = _modelSetting->GetMotionFadeOutTimeValue(group, i);
if (fadeTime >= 0.0f)
{
tmpMotion->SetFadeOutTime(fadeTime);
}
tmpMotion->SetEffectIds(_eyeBlinkIds, _lipSyncIds);
fadeTime = _modelSetting->GetMotionFadeOutTimeValue(group, i);
if (fadeTime >= 0.0f)
{
tmpMotion->SetFadeOutTime(fadeTime);
}
tmpMotion->SetEffectIds(_eyeBlinkIds, _lipSyncIds);

if (_motions[name] != NULL)
{
ACubismMotion::Delete(_motions[name]);
if (_motions[name] != NULL)
{
ACubismMotion::Delete(_motions[name]);
}
_motions[name] = tmpMotion;
}
_motions[name] = tmpMotion;

DeleteBuffer(buffer, path.GetRawString());

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

fadeTime = _modelSetting->GetMotionFadeOutTimeValue(group, no);
if (fadeTime >= 0.0f)
if (motion)
{
motion->SetFadeOutTime(fadeTime);
csmFloat32 fadeTime = _modelSetting->GetMotionFadeInTimeValue(group, no);
if (fadeTime >= 0.0f)
{
motion->SetFadeInTime(fadeTime);
}

fadeTime = _modelSetting->GetMotionFadeOutTimeValue(group, no);
if (fadeTime >= 0.0f)
{
motion->SetFadeOutTime(fadeTime);
}
motion->SetEffectIds(_eyeBlinkIds, _lipSyncIds);
autoDelete = true; // 終了時にメモリから削除
}
motion->SetEffectIds(_eyeBlinkIds, _lipSyncIds);
autoDelete = true; // 終了時にメモリから削除

DeleteBuffer(buffer, path.GetRawString());
}
Expand Down
44 changes: 43 additions & 1 deletion Samples/Cocos2d-x/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Cocos2d-xで実装したアプリケーションのサンプル実装です。

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

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

ビルド時に下記の手順を行なってください。

1. Android Studio の `File - Build, Execution, Deployment - Build Tools - Gradle - Gradle JDK``1.8` に設定してください

### proj.ios

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

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

1. `cocos2d/cocos/2d/CCFontAtlas.h` に以下の修正を加えてください
```CCFontAtlas.h
@@ -30,6 +30,7 @@

#include <string>
#include <unordered_map>
+#include <iconv.h>

#include "platform/CCPlatformMacros.h"
#include "base/CCRef.h"
@@ -129,7 +130,7 @@ protected:
float _lineHeight;
Font* _font;
FontFreeType* _fontFreeType;
- void* _iconv;
+ iconv_t _iconv;
```

NOTICE: Cubism Core は i386 アーキテクチャをサポートしていないため、**iPhone Simulator 向けのビルドは行えません。**

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

ビルド時に下記の手順を行なってください。

1. `cocos2d/cocos/2d/CCFontAtlas.h` に以下の修正を加えてください
```CCFontAtlas.h
@@ -30,6 +30,7 @@

#include <string>
#include <unordered_map>
+#include <iconv.h>

#include "platform/CCPlatformMacros.h"
#include "base/CCRef.h"
@@ -129,7 +130,7 @@ protected:
float _lineHeight;
Font* _font;
FontFreeType* _fontFreeType;
- void* _iconv;
+ iconv_t _iconv;
```

### proj.win

Windows 用の CMake プロジェクトです。
Expand Down
Loading

0 comments on commit 88d13ad

Please sign in to comment.