Skip to content

Commit

Permalink
Cubism Framework updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
asfdfdfd committed Oct 20, 2018
1 parent 668e7c3 commit 0d018a4
Show file tree
Hide file tree
Showing 23 changed files with 2,978 additions and 180 deletions.
61 changes: 45 additions & 16 deletions CubismSDK/Framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,9 @@
include_directories(src)
include_directories(../Core/include)

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

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

# ここにプロジェクトに追加するソースファイルを追加
set(Framework

src/CubismDefaultParameterId.cpp
src/CubismFramework.cpp
src/CubismModelSettingJson.cpp
# 各プラットフォーム共通ファイル
set(commonfiles

src/Effect/CubismBreath.cpp
src/Effect/CubismEyeBlink.cpp
Expand All @@ -32,25 +22,24 @@ set(Framework
src/Math/CubismVector2.cpp
src/Math/CubismViewMatrix.cpp

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

src/Motion/ACubismMotion.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/CubismPhysics.cpp
src/Physics/CubismPhysicsJson.cpp
src/Physics/CubismPhysics.cpp

src/Rendering/CubismRenderer.cpp
src/Rendering/OpenGL/CubismRenderer_OpenGLES2.cpp

src/Type/csmRectF.cpp
src/Type/csmString.cpp
Expand All @@ -62,7 +51,47 @@ set(Framework
src/CubismDefaultParameterId.cpp
src/CubismFramework.cpp
src/CubismModelSettingJson.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

)

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

)

endif ()

# staticライブラリとして追加
add_library (Framework STATIC ${Framework})
10 changes: 5 additions & 5 deletions CubismSDK/Framework/src/CubismFramework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void CubismFramework::Dispose()

for (csmUint32 i = 0; i < s_allocationList->size(); ++i)
{
CubismLogInfo("Memory leaking: 0x%x", s_allocationList->at(i));
CubismLogInfo("Memory leaking: 0x%p", s_allocationList->at(i));
}

if (s_allocationList->size() == 0)
Expand Down Expand Up @@ -224,7 +224,7 @@ void* CubismFramework::Allocate(csmSizeType size, const csmChar* fileName, csmIn
{
void* address = GetAllocator()->Allocate(size);

CubismLogVerbose("CubismFramework::Allocate(0x%x, %dbytes) %s(%d)", address, size, fileName, lineNumber);
CubismLogVerbose("CubismFramework::Allocate(0x%p, %dbytes) %s(%d)", address, size, fileName, lineNumber);

if (s_allocationList)
{
Expand All @@ -238,7 +238,7 @@ void* CubismFramework::AllocateAligned(csmSizeType size, csmUint32 alignment, co
{
void* address = GetAllocator()->AllocateAligned(size, alignment);

CubismLogVerbose("CubismFramework::AllocateAligned(0x%x, a:%d, %dbytes) %s(%d)", address, alignment, size, fileName, lineNumber);
CubismLogVerbose("CubismFramework::AllocateAligned(0x%p, a:%d, %dbytes) %s(%d)", address, alignment, size, fileName, lineNumber);

if (s_allocationList)
{
Expand All @@ -255,7 +255,7 @@ void CubismFramework::Deallocate(void* address, const csmChar* fileName, csmInt3
return;
}

CubismLogVerbose("CubismFramework::Deallocate(0x%x) %s(%d)", address, fileName, lineNumber);
CubismLogVerbose("CubismFramework::Deallocate(0x%p) %s(%d)", address, fileName, lineNumber);

if (s_allocationList)
{
Expand All @@ -281,7 +281,7 @@ void CubismFramework::DeallocateAligned(void* address, const csmChar* fileName,
return;
}

CubismLogVerbose("CubismFramework::DeallocateAligned(0x%x) %s(%d)", address, fileName, lineNumber);
CubismLogVerbose("CubismFramework::DeallocateAligned(0x%p) %s(%d)", address, fileName, lineNumber);

if (s_allocationList)
{
Expand Down
1 change: 0 additions & 1 deletion CubismSDK/Framework/src/Effect/CubismPose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ void CubismPose::PartData::Initialize(CubismModel* model)
}

CubismPose::CubismPose() : _fadeTimeSeconds(DefaultFadeInSeconds)
, _lastTimeSeconds(0.0f)
, _lastModel(NULL)
{ }

Expand Down
1 change: 0 additions & 1 deletion CubismSDK/Framework/src/Effect/CubismPose.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ class CubismPose
csmVector<PartData> _partGroups; ///< パーツグループ
csmVector<csmInt32> _partGroupCounts; ///< それぞれのパーツグループの個数
csmFloat32 _fadeTimeSeconds; ///< フェード時間[秒]
csmFloat32 _lastTimeSeconds; ///< 最後に実行した時刻[秒]
CubismModel* _lastModel; ///< 前回操作したモデル
};

Expand Down
3 changes: 2 additions & 1 deletion CubismSDK/Framework/src/Model/CubismUserModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ CubismUserModel::CubismUserModel()
, _motionManager(NULL)
, _expressionManager(NULL)
, _eyeBlink(NULL)
, _breath(NULL)
, _modelMatrix(NULL)
, _pose(NULL)
, _dragManager(NULL)
, _physics(NULL)
, _modelUserData(NULL)
, _initialized(false)
, _updating(false)
, _opacity(1.0f)
Expand All @@ -33,7 +35,6 @@ CubismUserModel::CubismUserModel()
, _accelerationZ(0.0f)
, _debugMode(false)
, _renderer(NULL)
, _modelUserData(NULL)
{
// モーションマネージャーを作成
// MotionQueueManagerクラスからの継承なので使い方は同じ
Expand Down
4 changes: 2 additions & 2 deletions CubismSDK/Framework/src/Motion/CubismMotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ void CubismMotion::DoUpdateParameters(CubismModel* model, csmFloat32 userTimeSec
{
CubismLogDebug("too many eye blink targets : %d", _eyeBlinkParameterIds.GetSize());
}
if (_eyeBlinkParameterIds.GetSize() > MaxTargetSize)
if (_lipSyncParameterIds.GetSize() > MaxTargetSize)
{
CubismLogDebug("too many lip sync targets : %d", _eyeBlinkParameterIds.GetSize());
CubismLogDebug("too many lip sync targets : %d", _lipSyncParameterIds.GetSize());
}

const csmFloat32 tmpFadeIn = (_fadeInSeconds <= 0.0f)
Expand Down
4 changes: 2 additions & 2 deletions CubismSDK/Framework/src/Motion/CubismMotionInternal.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
Expand Down Expand Up @@ -136,8 +136,8 @@ struct CubismMotionData
: Duration(0.0f)
, Loop(0)
, CurveCount(0)
, Fps(0.0f)
, EventCount(0)
, Fps(0.0f)
{ }

csmFloat32 Duration; ///< モーションの長さ[秒]
Expand Down
10 changes: 0 additions & 10 deletions CubismSDK/Framework/src/Motion/CubismMotionQueueManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,6 @@ void CubismMotionQueueManager::StopAllMotions()
continue;
}

ACubismMotion* motion = motionQueueEntry->_motion;

if (motion == NULL)
{
CSM_DELETE(motionQueueEntry);
ite = _motions.Erase(ite);

continue;
}

// ----- 終了済みの処理があれば削除する ------
CSM_DELETE(motionQueueEntry);
ite = _motions.Erase(ite); //削除
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/

#pragma once

#include "CubismFrameworkConfig.hpp"

#ifdef CSM_DEBUG
// d3dヘッダの前にこれを定義するとデバッグ情報が増える 必要に応じてOn
#define D3D_DEBUG_INFO
#endif

#include <d3d9.h>
#include <d3dx9.h>
Loading

0 comments on commit 0d018a4

Please sign in to comment.