Skip to content

Commit

Permalink
Merge pull request #29 from Live2D/develop
Browse files Browse the repository at this point in the history
Update to Cubism 4 SDK for Native R1
  • Loading branch information
itoh-at-live2d-com authored Jan 30, 2020
2 parents 6261f6a + e9355b9 commit 03d6aa6
Show file tree
Hide file tree
Showing 31 changed files with 509 additions and 355 deletions.
5 changes: 3 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{c,cpp,h,hpp}]
[*.{cpp,hpp}]
indent_size = 4
charset = utf-8-bom
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vs/
.vscode/
.idea/
*.iml
.DS_Store
26 changes: 24 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,29 @@

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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## [4-r.1] - 2020-01-30

### Added

* Add the callback function called on finished motion playback.

### Changed

* Include header files in CMake.
* `<GL/glew>` is not included on macOS if `CSM_TARGET_COCOS` is defined.

### Fixed

* Fix rendering not working properly on Android devices with Tegra.

### Deprecated

* Use `target_include_directories` instead of using `FRAMEWORK_XXX_INCLUDE_PATH` variable in application CMake.
* Use `target_compile_definitions` instead of using `FRAMEWORK_DEFINITIOINS` variable in application CMake.
* Specify `FRAMEWORK_SOURCE` variable also in OpenGL application CMake.


## [4-beta.2] - 2019-11-14
Expand Down Expand Up @@ -41,5 +62,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Fix invalid expressions of `CubismCdiJson`.


[4-r.1]: https://github.com/Live2D/CubismNativeFramework/compare/4-beta.2...4-r.1
[4-beta.2]: https://github.com/Live2D/CubismNativeFramework/compare/4-beta.1...4-beta.2
[4-beta.1]: https://github.com/Live2D/CubismNativeFramework/compare/0f5da4981cc636fe3892bb94d5c60137c9cf1eb1...4-beta.
134 changes: 31 additions & 103 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,103 +1,31 @@
cmake_minimum_required(VERSION 3.15)

# includeパスの追加
include_directories(src)
include_directories(../Core/include)

# 各プラットフォーム共通ファイル
set(commonfiles

src/Effect/CubismBreath.cpp
src/Effect/CubismEyeBlink.cpp
src/Effect/CubismPose.cpp

src/Id/CubismId.cpp
src/Id/CubismIdManager.cpp

src/Math/CubismMath.cpp
src/Math/CubismMatrix44.cpp
src/Math/CubismModelMatrix.cpp
src/Math/CubismTargetPoint.cpp
src/Math/CubismVector2.cpp
src/Math/CubismViewMatrix.cpp

src/Model/CubismModel.cpp
src/Model/CubismModelUserData.cpp
src/Model/CubismModelUserDataJson.cpp
src/Model/CubismUserModel.cpp
src/Model/CubismMoc.cpp

src/Motion/CubismExpressionMotion.cpp
src/Motion/CubismMotion.cpp
src/Motion/CubismMotionJson.cpp
src/Motion/CubismMotionManager.cpp
src/Motion/CubismMotionQueueEntry.cpp
src/Motion/CubismMotionQueueManager.cpp
src/Motion/ACubismMotion.cpp

src/Physics/CubismPhysicsJson.cpp
src/Physics/CubismPhysics.cpp

src/Rendering/CubismRenderer.cpp

src/Type/csmRectF.cpp
src/Type/csmString.cpp

src/Utils/CubismDebug.cpp
src/Utils/CubismJson.cpp
src/Utils/CubismString.cpp

src/CubismDefaultParameterId.cpp
src/CubismFramework.cpp
src/CubismModelSettingJson.cpp
src/CubismCdiJson.cpp)

if(${FRAMEWORK_SOURCE} MATCHES "D3D9")
# ここにプロジェクトに追加するソースファイルを追加 DirectX9

# アプリケーション側で設定したgl系のincludeパスをセットする
include_directories(${FRAMEWORK_DX9_INCLUDE_PATH})

set(Framework

${commonfiles}

src/Rendering/D3D9/CubismRenderer_D3D9.cpp
src/Rendering/D3D9/CubismRenderState_D3D9.cpp
src/Rendering/D3D9/CubismShader_D3D9.cpp
src/Rendering/D3D9/CubismOffscreenSurface_D3D9.cpp)

elseif(${FRAMEWORK_SOURCE} MATCHES "D3D11")
# ここにプロジェクトに追加するソースファイルを追加 DirectX11

# アプリケーション側で設定したgl系のincludeパスをセットする
include_directories(${FRAMEWORK_DX11_INCLUDE_PATH})

set(Framework

${commonfiles}

src/Rendering/D3D11/CubismOffscreenSurface_D3D11.cpp
src/Rendering/D3D11/CubismRenderer_D3D11.cpp
src/Rendering/D3D11/CubismRenderState_D3D11.cpp
src/Rendering/D3D11/CubismShader_D3D11.cpp)
else()
# ここにプロジェクトに追加するソースファイルを追加 OpenGL

# アプリケーション側で設定したgl系のincludeパスをセットする
include_directories(${FRAMEWORK_GLFW_PATH})
include_directories(${FRAMEWORK_GLEW_PATH})

# プリプロセッサ定義の追加
add_definitions(${FRAMEWORK_DEFINITIOINS})

set(Framework

${commonfiles}

src/Rendering/OpenGL/CubismRenderer_OpenGLES2.cpp
src/Rendering/OpenGL/CubismOffscreenSurface_OpenGLES2.cpp)
endif()

# staticライブラリとして追加
add_library (Framework STATIC ${Framework})
cmake_minimum_required(VERSION 3.10)

set(LIB_NAME Framework)

# Force static library.
add_library(${LIB_NAME} STATIC)

add_subdirectory(src)

# Add include path.
target_include_directories(${LIB_NAME}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
PRIVATE
${RENDER_INCLUDE_PATH}
)

# Deprecated functions
# The following expressions are written for compatibility
# and will be removed in a future release.

# Add core include.
target_include_directories(${LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../Core/include
)
# Add definitions.
target_compile_definitions(${LIB_NAME}
PRIVATE
${FRAMEWORK_DEFINITIOINS}
)
39 changes: 39 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Definitions

### Live2D Cubism Components

Cubism Native Framework is included in Live2D Cubism Components.

Cubism Native Framework は Live2D Cubism Components に含まれます。


## Cubism SDK Release License

*All business* users must obtain a Cubism SDK Release License. "Business" means an entity with the annual gross revenue more than ten million (10,000,000) JPY for the most recent fiscal year.

* [Cubism SDK Release License](https://www.live2d.com/en/download/cubism-sdk/release-license/)

直近会計年度の売上高が 1000 万円以上の事業者様がご利用になる場合は、Cubism SDK リリースライセンス(出版許諾契約)に同意していただく必要がございます。

* [Cubism SDK リリースライセンス](https://www.live2d.com/ja/download/cubism-sdk/release-license/)


## Live2D Open Software License

Live2D Cubism Components is available under Live2D Open Software License.

* [Live2D Open Software License Agreement](https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html)
* [Live2D Open Software 使用許諾契約書](https://www.live2d.com/eula/live2d-open-software-license-agreement_jp.html)


## Live2D Proprietary Software License

Live2D Cubism Core is available under Live2D Proprietary Software License.

* [Live2D Proprietary Software License Agreement](https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_en.html)
* [Live2D Proprietary Software 使用許諾契約書](https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_jp.html)


---

Please contact us from [here](https://www.live2d.jp/contact/) for more license information.
40 changes: 12 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Cubism Native Framework

Live2D Cubism 4 Editorで出力したモデルをアプリケーションで利用するためのフレームワークです
Live2D Cubism 4 Editor で出力したモデルをアプリケーションで利用するためのフレームワークです

モデルを表示、操作するための各種機能を提供します。
モデルをロードするにはCubism Coreライブラリと組み合わせて使用します。
モデルをロードするには Cubism Core ライブラリと組み合わせて使用します。


## ライセンス

本フレームワークを使用する前に、[ライセンス](LICENSE.md)をご確認ください。


## コンポーネント
Expand All @@ -14,7 +19,7 @@ Live2D Cubism 4 Editorで出力したモデルをアプリケーションで利

### Id

モデルに設定されたパラメータ名・パーツ名・Drawable名を独自の型で管理する機能を提供します
モデルに設定されたパラメータ名・パーツ名・Drawable 名を独自の型で管理する機能を提供します

### Math

Expand All @@ -38,16 +43,16 @@ Live2D Cubism 4 Editorで出力したモデルをアプリケーションで利

### Type

フレームワーク内で使用するC++型定義を提供します。
本フレームワーク内で使用する C++ 型定義を提供します。

### Utils

JSONパーサーやログ出力などのユーティリティ機能を提供します
JSON パーサーやログ出力などのユーティリティ機能を提供します


## Live2D Cubism Core for Native

当リポジトリにはLive2D Cubism Core for Nativeは同梱されていません
当リポジトリには Live2D Cubism Core for Native は同梱されていません

ダウンロードするには[こちら](https://www.live2d.com/download/cubism-sdk/download-native/)のページを参照ください。

Expand All @@ -66,25 +71,4 @@ JSONパーサーやログ出力などのユーティリティ機能を提供し

## 変更履歴

当リポジトリの変更履歴については[CHANGELOG.md](/CHANGELOG.md)を参照ください。


## ライセンス

Cubism Native Framework は Live2D Open Software License で提供しています。
- Live2D Open Software License

[日本語](https://www.live2d.com/eula/live2d-open-software-license-agreement_jp.html)
[English](https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html)

Live2D Cubism Core for Native は Live2D Proprietary Software License で提供しています。
- Live2D Proprietary Software License

[日本語](https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_jp.html)
[English](https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_en.html)

直近会計年度の売上高が 1000 万円以上の事業者様がご利用になる場合は、SDKリリース(出版許諾)ライセンスに同意していただく必要がございます。
- [SDKリリース(出版許諾)ライセンス](https://www.live2d.com/ja/products/releaselicense)

*All business* users must obtain a Publication License. "Business" means an entity with the annual gross revenue more than ten million (10,000,000) JPY for the most recent fiscal year.
- [SDK Release (Publication) License](https://www.live2d.com/en/products/releaselicense)
当リポジトリの変更履歴については [CHANGELOG.md](CHANGELOG.md) を参照ください。
26 changes: 26 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
target_sources(${LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CubismCdiJson.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismCdiJson.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismDefaultParameterId.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismDefaultParameterId.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismFramework.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismFramework.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismFrameworkConfig.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismModelSettingJson.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismModelSettingJson.hpp
${CMAKE_CURRENT_SOURCE_DIR}/ICubismAllocator.hpp
${CMAKE_CURRENT_SOURCE_DIR}/ICubismModelSetting.hpp
${CMAKE_CURRENT_SOURCE_DIR}/Live2DCubismCore.hpp
)

# Add sub directories.
add_subdirectory(Effect)
add_subdirectory(Id)
add_subdirectory(Math)
add_subdirectory(Model)
add_subdirectory(Motion)
add_subdirectory(Physics)
add_subdirectory(Rendering)
add_subdirectory(Type)
add_subdirectory(Utils)
2 changes: 1 addition & 1 deletion src/CubismFramework.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <new>
#include "ICubismAllocator.hpp"

#ifdef linux
#ifdef __linux__
#include <cstdlib>
#endif

Expand Down
9 changes: 9 additions & 0 deletions src/Effect/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
target_sources(${LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CubismBreath.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismBreath.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismEyeBlink.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismEyeBlink.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismPose.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismPose.hpp
)
7 changes: 7 additions & 0 deletions src/Id/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
target_sources(${LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CubismId.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismId.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismIdManager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismIdManager.hpp
)
15 changes: 15 additions & 0 deletions src/Math/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
target_sources(${LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CubismMath.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismMath.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismMatrix44.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismMatrix44.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismModelMatrix.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismModelMatrix.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismTargetPoint.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismTargetPoint.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismVector2.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismVector2.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismViewMatrix.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismViewMatrix.hpp
)
13 changes: 13 additions & 0 deletions src/Model/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
target_sources(${LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CubismMoc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismMoc.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismModel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismModel.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismModelUserData.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismModelUserData.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismModelUserDataJson.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismModelUserDataJson.hpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismUserModel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CubismUserModel.hpp
)
Loading

0 comments on commit 03d6aa6

Please sign in to comment.