Skip to content

Commit

Permalink
Update to Cubism 4 SDK for Native R5 beta5
Browse files Browse the repository at this point in the history
  • Loading branch information
wada-at-live2d-com committed Aug 4, 2022
1 parent d6cdcd1 commit 98abe81
Show file tree
Hide file tree
Showing 45 changed files with 528 additions and 167 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ 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.5-beta.5] - 2022-08-04

### Changed

* Update `Mao` model.
* Change the Signing setting of the Debugging building in the samples for Android to use the `debug.keystore` in the `app` directory.

### Fixed

* Fix the GLEW version for Visual Studio 2013.
* Fix crash with exception when reading .moc3 files of unsupported versions.


## [4-r.5-beta.4.1] - 2022-07-08

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


[4-r.5-beta.5]: https://github.com/Live2D/CubismNativeSamples/compare/4-r.5-beta.4.1...4-r.5-beta.5
[4-r.5-beta.4.1]: https://github.com/Live2D/CubismNativeSamples/compare/4-r.5-beta.4...4-r.5-beta.4.1
[4-r.5-beta.4]: https://github.com/Live2D/CubismNativeSamples/compare/4-r.5-beta.3...4-r.5-beta.4
[4-r.5-beta.3]: https://github.com/Live2D/CubismNativeSamples/compare/4-r.5-beta.2...4-r.5-beta.3
Expand Down
2 changes: 1 addition & 1 deletion Framework
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Demo
| Visual Studio 2013 | Update 5 |
| Visual Studio 2015 | Update 3 |
| Visual Studio 2017 | 15.9.49 |
| Visual Studio 2019 | 16.11.16 |
| Visual Studio 2019 | 16.11.17 |
| XCode | 13.4.1 |

### Android
Expand Down Expand Up @@ -136,7 +136,7 @@ Demo
| プラットフォーム | バージョン |
| --- | --- |
| iOS / iPadOS | 15.5 |
| macOS | 12.4 |
| macOS | 12.5 |
| Windows 10 | 21H2 |
| Windows 11 | 21H2 |

Expand Down
7 changes: 7 additions & 0 deletions Samples/Cocos2d-x/Demo/Classes/LAppLive2DManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ void LAppLive2DManager::OnUpdate(Csm::Rendering::CubismCommandBuffer_Cocos2dx* c
{
CubismMatrix44 projection;
LAppModel* model = GetModel(i);

if (model->GetModel() == NULL)
{
LAppPal::PrintLog("Failed to model->GetModel().");
continue;
}

if (model->GetModel()->GetCanvasWidth() > 1.0f && window.width < window.height)
{
// 横に長いモデルを縦長ウィンドウに表示する際モデルの横サイズでscaleを算出する
Expand Down
12 changes: 12 additions & 0 deletions Samples/Cocos2d-x/Demo/Classes/LAppModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ void LAppModel::LoadAssets(const csmChar* dir, const csmChar* fileName)

SetupModel(setting);

if (_model == NULL)
{
LAppPal::PrintLog("Failed to LoadAssets().");
return;
}

CreateRenderer();

SetupTextures();
Expand Down Expand Up @@ -255,6 +261,12 @@ void LAppModel::SetupModel(ICubismModelSetting* setting)
}
}

if (_modelSetting == NULL || _modelMatrix == NULL)
{
LAppPal::PrintLog("Failed to SetupModel().");
return;
}

//Layout
csmMap<csmString, csmFloat32> layout;
_modelSetting->GetLayoutMap(layout);
Expand Down
7 changes: 7 additions & 0 deletions Samples/Cocos2d-x/Demo/proj.android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ android {
keyPassword RELEASE_KEY_PASSWORD
}
}

debug {
storeFile file("debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}

buildTypes {
Expand Down
Binary file not shown.
6 changes: 6 additions & 0 deletions Samples/D3D11/Demo/proj.d3d11.cmake/src/LAppLive2DManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ void LAppLive2DManager::OnUpdate() const
CubismMatrix44 projection;
LAppModel* model = GetModel(i);

if (model->GetModel() == NULL)
{
LAppPal::PrintLog("Failed to model->GetModel().");
continue;
}

if (model->GetModel()->GetCanvasWidth() > 1.0f && windowWidth < windowHeight)
{
// 横に長いモデルを縦長ウィンドウに表示する際モデルの横サイズでscaleを算出する
Expand Down
12 changes: 12 additions & 0 deletions Samples/D3D11/Demo/proj.d3d11.cmake/src/LAppModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ void LAppModel::LoadAssets(const csmChar* dir, const csmChar* fileName)

SetupModel(setting);

if (_model == NULL)
{
LAppPal::PrintLog("Failed to LoadAssets().");
return;
}

CreateRenderer();

SetupTextures();
Expand Down Expand Up @@ -232,6 +238,12 @@ void LAppModel::SetupModel(ICubismModelSetting* setting)
}
}

if (_modelSetting == NULL || _modelMatrix == NULL)
{
LAppPal::PrintLog("Failed to SetupModel().");
return;
}

//Layout
csmMap<csmString, csmFloat32> layout;
_modelSetting->GetLayoutMap(layout);
Expand Down
13 changes: 13 additions & 0 deletions Samples/D3D9/Demo/proj.d3d9.cmake/src/LAppLive2DManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ void LAppLive2DManager::OnUpdate() const
{
CubismMatrix44 projection;
LAppModel* model = GetModel(i);

if (model->GetModel() == NULL)
{
LAppPal::PrintLog("Failed to model->GetModel().");
continue;
}

if (model->GetModel()->GetCanvasWidth() > 1.0f && width < height)
{
// 横に長いモデルを縦長ウィンドウに表示する際モデルの横サイズでscaleを算出する
Expand Down Expand Up @@ -287,6 +294,12 @@ void LAppLive2DManager::RestoreDeviceLost(LPDIRECT3DDEVICE9 device)
// レンダラー再作成
for (csmUint32 i = 0; i < _models.GetSize(); i++)
{
if (_models[i]->GetModel() == NULL)
{
LAppPal::PrintLog("Failed to model->GetModel().");
continue;
}

_models[i]->ReloadRenderer();
}
}
Expand Down
12 changes: 12 additions & 0 deletions Samples/D3D9/Demo/proj.d3d9.cmake/src/LAppModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ void LAppModel::LoadAssets(const csmChar* dir, const csmChar* fileName)

SetupModel(setting);

if (_model == NULL)
{
LAppPal::PrintLog("Failed to LoadAssets().");
return;
}

CreateRenderer();

SetupTextures();
Expand Down Expand Up @@ -232,6 +238,12 @@ void LAppModel::SetupModel(ICubismModelSetting* setting)
}
}

if (_modelSetting == NULL || _modelMatrix == NULL)
{
LAppPal::PrintLog("Failed to SetupModel().");
return;
}

//Layout
csmMap<csmString, csmFloat32> layout;
_modelSetting->GetLayoutMap(layout);
Expand Down
7 changes: 7 additions & 0 deletions Samples/Metal/Demo/proj.ios.cmake/src/LAppLive2DManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ - (void)onUpdate:(id <MTLCommandBuffer>)commandBuffer currentDrawable:(id<CAMeta
for (Csm::csmUint32 i = 0; i < modelCount; ++i)
{
LAppModel* model = [self getModel:i];

if (model->GetModel() == NULL)
{
LAppPal::PrintLog("Failed to model->GetModel().");
continue;
}

if (model->GetModel()->GetCanvasWidth() > 1.0f && width < height)
{
// 横に長いモデルを縦長ウィンドウに表示する際モデルの横サイズでscaleを算出する
Expand Down
12 changes: 12 additions & 0 deletions Samples/Metal/Demo/proj.ios.cmake/src/LAppModel.mm
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ void DeleteBuffer(csmByte* buffer, const csmChar* path = "")

SetupModel(setting);

if (_model == NULL)
{
LAppPal::PrintLog("Failed to LoadAssets().");
return;
}

CreateRenderer();

SetupTextures();
Expand Down Expand Up @@ -242,6 +248,12 @@ void DeleteBuffer(csmByte* buffer, const csmChar* path = "")
}
}

if (_modelSetting == NULL || _modelMatrix == NULL)
{
LAppPal::PrintLog("Failed to SetupModel().");
return;
}

//Layout
csmMap<csmString, csmFloat32> layout;
_modelSetting->GetLayoutMap(layout);
Expand Down
8 changes: 8 additions & 0 deletions Samples/OpenGL/Demo/proj.android.cmake/Full/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ android {
}
}
}
signingConfigs {
debug {
storeFile file("debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
buildTypes {
release {
minifyEnabled false
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ void LAppLive2DManager::OnUpdate() const
{
CubismMatrix44 projection;
LAppModel* model = GetModel(i);

if (model->GetModel() == NULL)
{
LAppPal::PrintLog("Failed to model->GetModel().");
continue;
}

if (model->GetModel()->GetCanvasWidth() > 1.0f && width < height)
{
// 横に長いモデルを縦長ウィンドウに表示する際モデルの横サイズでscaleを算出する
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ void LAppModel::LoadAssets(const csmChar* dir, const csmChar* fileName)

SetupModel(setting);

if (_model == NULL)
{
LAppPal::PrintLog("Failed to LoadAssets().");
return;
}

CreateRenderer();

SetupTextures();
Expand Down Expand Up @@ -223,6 +229,12 @@ void LAppModel::SetupModel(ICubismModelSetting* setting)
}
}

if (_modelSetting == NULL || _modelMatrix == NULL)
{
LAppPal::PrintLog("Failed to SetupModel().");
return;
}

//Layout
csmMap<csmString, csmFloat32> layout;
_modelSetting->GetLayoutMap(layout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ android {
}
}
}
signingConfigs {
debug {
storeFile file("debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
buildTypes {
release {
minifyEnabled false
Expand Down
Binary file not shown.
7 changes: 7 additions & 0 deletions Samples/OpenGL/Demo/proj.ios.cmake/src/LAppLive2DManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ - (void)onUpdate;
{
Csm::CubismMatrix44 projection;
LAppModel* model = [self getModel:i];

if (model->GetModel() == NULL)
{
LAppPal::PrintLog("Failed to model->GetModel().");
continue;
}

if (model->GetModel()->GetCanvasWidth() > 1.0f && width < height)
{
// 横に長いモデルを縦長ウィンドウに表示する際モデルの横サイズでscaleを算出する
Expand Down
13 changes: 12 additions & 1 deletion Samples/OpenGL/Demo/proj.ios.cmake/src/LAppModel.mm
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,17 @@ void DeleteBuffer(csmByte* buffer, const csmChar* path = "")

SetupModel(setting);

if (_model == NULL)
{
LAppPal::PrintLog("Failed to LoadAssets().");
return;
}

CreateRenderer();

SetupTextures();
}


void LAppModel::SetupModel(ICubismModelSetting* setting)
{
_updating = true;
Expand Down Expand Up @@ -224,6 +229,12 @@ void DeleteBuffer(csmByte* buffer, const csmChar* path = "")
}
}

if (_modelSetting == NULL || _modelMatrix == NULL)
{
LAppPal::PrintLog("Failed to SetupModel().");
return;
}

//Layout
csmMap<csmString, csmFloat32> layout;
_modelSetting->GetLayoutMap(layout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ void LAppLive2DManager::OnUpdate() const
{
CubismMatrix44 projection;
LAppModel* model = GetModel(i);

if (model->GetModel() == NULL)
{
LAppPal::PrintLog("Failed to model->GetModel().");
continue;
}

if (model->GetModel()->GetCanvasWidth() > 1.0f && width < height)
{
// 横に長いモデルを縦長ウィンドウに表示する際モデルの横サイズでscaleを算出する
Expand Down
12 changes: 12 additions & 0 deletions Samples/OpenGL/Demo/proj.linux.cmake/src/LAppModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ void LAppModel::LoadAssets(const csmChar* dir, const csmChar* fileName)

SetupModel(setting);

if (_model == NULL)
{
LAppPal::PrintLog("Failed to LoadAssets().");
return;
}

CreateRenderer();

SetupTextures();
Expand Down Expand Up @@ -223,6 +229,12 @@ void LAppModel::SetupModel(ICubismModelSetting* setting)
}
}

if (_modelSetting == NULL || _modelMatrix == NULL)
{
LAppPal::PrintLog("Failed to SetupModel().");
return;
}

//Layout
csmMap<csmString, csmFloat32> layout;
_modelSetting->GetLayoutMap(layout);
Expand Down
Loading

0 comments on commit 98abe81

Please sign in to comment.