Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 330 vs 331 for /trunk/Source Code/Graphs/Components/AnimationComponent.cpp

Diff revisions: vs.
  @@ -6,14 +6,16 @@
6 6
7 7 namespace Divide {
8 8
9 - AnimationComponent::AnimationComponent(SceneAnimator* animator, SceneGraphNode* const parentSGN) : SGNComponent(SGNComponent::SGN_COMP_ANIMATION, parentSGN),
10 - _animator(animator),
11 - _skeletonAvailable(false),
12 - _playAnimations(true),
13 - _currentTimeStamp(-1.0),
14 - _currentAnimationID(0),
15 - _currentFrameIndex(0),
16 - _currentAnimIndex(0)
9 + AnimationComponent::AnimationComponent(SceneAnimator* animator,
10 + SceneGraphNode* const parentSGN) : SGNComponent(SGNComponent::SGN_COMP_ANIMATION,
11 + parentSGN),
12 + _animator(animator),
13 + _skeletonAvailable(false),
14 + _playAnimations(true),
15 + _currentTimeStamp(-1.0),
16 + _currentAnimationID(0),
17 + _currentFrameIndex(0),
18 + _currentAnimIndex(0)
17 19 {
18 20 assert(_animator != nullptr);
19 21
  @@ -21,7 +23,8 @@
21 23 _animationTransforms.reserve(40);
22 24 _readBuffer = 1;
23 25 _writeBuffer = 0;
24 - DIVIDE_ASSERT(_animator->GetBoneCount() <= Config::MAX_BONE_COUNT_PER_NODE, "AnimationComponent error: Too many bones for current node! Increase MAX_BONE_COUNT_PER_NODE in Config!");
26 + DIVIDE_ASSERT(_animator->GetBoneCount() <= Config::MAX_BONE_COUNT_PER_NODE,
27 + "AnimationComponent error: Too many bones for current node! Increase MAX_BONE_COUNT_PER_NODE in Config!");
25 28
26 29 _boneTransformBuffer[_writeBuffer] = GFX_DEVICE.newSB();
27 30 _boneTransformBuffer[_writeBuffer]->Create((U32)_animator->GetBoneCount(), sizeof(mat4<F32>));
  @@ -32,8 +35,8 @@
32 35
33 36 AnimationComponent::~AnimationComponent()
34 37 {
35 - MemoryManager::SAFE_DELETE( _boneTransformBuffer[0] );
36 - MemoryManager::SAFE_DELETE( _boneTransformBuffer[1] );
38 + MemoryManager::DELETE( _boneTransformBuffer[0] );
39 + MemoryManager::DELETE( _boneTransformBuffer[1] );
37 40 }
38 41
39 42 void AnimationComponent::update(const U64 deltaTime) {
  @@ -93,7 +96,9 @@
93 96 }
94 97
95 98 void AnimationComponent::renderSkeleton(){
96 - if (!_skeletonAvailable || (!GET_ACTIVE_SCENE()->renderState().drawSkeletons() && !_parentSGN->getComponent<RenderingComponent>()->renderSkeleton())) {
99 + if (!_skeletonAvailable ||
100 + (!GET_ACTIVE_SCENE()->renderState().drawSkeletons() &&
101 + !_parentSGN->getComponent<RenderingComponent>()->renderSkeleton())) {
97 102 return;
98 103 }
99 104
  @@ -141,7 +146,9 @@
141 146 Object3D* node = _parentSGN->getNode<Object3D>();
142 147 assert(node != nullptr);
143 148
144 - if (node->getObjectType() != Object3D::SUBMESH || (node->getObjectType() == Object3D::SUBMESH && !bitCompare(node->getFlagMask(), Object3D::OBJECT_FLAG_SKINNED))){
149 + if (node->getObjectType() != Object3D::SUBMESH ||
150 + (node->getObjectType() == Object3D::SUBMESH &&
151 + !bitCompare(node->getFlagMask(), Object3D::OBJECT_FLAG_SKINNED))) {
145 152 return _parentSGN->getComponent<PhysicsComponent>()->getWorldMatrix();
146 153 }
147 154