Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move AniGraph classes from plAvatar -> plAnimation. #457

Merged
merged 1 commit into from
Nov 1, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Sources/Plasma/Apps/plClient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ target_link_libraries(plClient pfPython)
target_link_libraries(plClient pfSurface)
target_link_libraries(plClient plAgeDescription)
target_link_libraries(plClient plAgeLoader)
target_link_libraries(plClient plAnimation)
target_link_libraries(plClient plAudible)
target_link_libraries(plClient plAudio)
target_link_libraries(plClient plAudioCore)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/Apps/plClient/plClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com

#include "pfJournalBook/pfJournalBook.h"

#include "plAvatar/plAGAnimInstance.h"
#include "plAnimation/plAGAnimInstance.h"
#include "plAgeLoader/plAgeLoader.h"

#include "plQuality.h"
Expand Down
6 changes: 3 additions & 3 deletions Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnSceneObject/plSceneObject.h"
#include "plSurface/hsGMaterial.h"
#include "plSurface/plLayerAnimation.h"
#include "plAvatar/plAGMasterMod.h"
#include "plAvatar/plAGAnimInstance.h"
#include "plAvatar/plAGAnim.h"
#include "plAnimation/plAGMasterMod.h"
#include "plAnimation/plAGAnimInstance.h"
#include "plAnimation/plAGAnim.h"
#include "plResMgr/plKeyFinder.h"
#include "plPipeline/plDebugText.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAvatar/plAvatarMgr.h"
#include "plAvatar/plSeekPointMod.h"
#include "plAvatar/plOneShotMod.h"
#include "plAvatar/plAGAnim.h"
#include "plAnimation/plAGAnim.h"
#include "plAvatar/plAvBrainUser.h"
#include "plAvatar/plAvBrainHuman.h"
#include "plAvatar/plNPCSpawnMod.h"
#include "plAvatar/plAGAnimInstance.h"
#include "plAnimation/plAGAnimInstance.h"
#include "plAvatar/plArmatureEffects.h"
#include "plAvatar/plAvTaskSeek.h"

Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIButtonMod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plRefMsg.h"
#include "pfMessage/pfGameGUIMsg.h"
#include "plMessage/plAnimCmdMsg.h"
#include "plAvatar/plAGModifier.h"
#include "plAnimation/plAGModifier.h"
#include "plgDispatch.h"
#include "hsResMgr.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plRefMsg.h"
#include "pfMessage/pfGameGUIMsg.h"
#include "plMessage/plAnimCmdMsg.h"
#include "plAvatar/plAGModifier.h"
#include "plAnimation/plAGModifier.h"
#include "plgDispatch.h"
#include "hsResMgr.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plRefMsg.h"
#include "pfMessage/pfGameGUIMsg.h"
#include "plMessage/plAnimCmdMsg.h"
#include "plAvatar/plAGModifier.h"
#include "plAnimation/plAGModifier.h"
#include "plgDispatch.h"
#include "hsResMgr.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plRefMsg.h"
#include "pfMessage/pfGameGUIMsg.h"
#include "plMessage/plAnimCmdMsg.h"
#include "plAvatar/plAGModifier.h"
#include "plAnimation/plAGModifier.h"
#include "plInputCore/plInputInterface.h"
#include "plgDispatch.h"
#include "hsResMgr.h"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plRefMsg.h"
#include "pfMessage/pfGameGUIMsg.h"
#include "plMessage/plAnimCmdMsg.h"
#include "plAvatar/plAGModifier.h"
#include "plAnimation/plAGModifier.h"
#include "plGImage/plDynamicTextMap.h"
#include "plgDispatch.h"
#include "hsResMgr.h"
Expand Down
6 changes: 3 additions & 3 deletions Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIKnobCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plRefMsg.h"
#include "pfMessage/pfGameGUIMsg.h"
#include "plMessage/plAnimCmdMsg.h"
// #include "plAvatar/plAGModifier.h"
#include "plAvatar/plAGMasterMod.h"
#include "plAvatar/plAGAnimInstance.h"
// #include "plAnimation/plAGModifier.h"
#include "plAnimation/plAGMasterMod.h"
#include "plAnimation/plAGAnimInstance.h"
#include "plSurface/plLayerAnimation.h"

#include "pnSceneObject/plSceneObject.h"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListBoxMod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plRefMsg.h"
#include "pfMessage/pfGameGUIMsg.h"
#include "plMessage/plAnimCmdMsg.h"
#include "plAvatar/plAGModifier.h"
#include "plAnimation/plAGModifier.h"
#include "plGImage/plDynamicTextMap.h"
#include "plInputCore/plInputInterface.h"
#include "plgDispatch.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plRefMsg.h"
#include "pfMessage/pfGameGUIMsg.h"
#include "plMessage/plAnimCmdMsg.h"
#include "plAvatar/plAGModifier.h"
#include "plAnimation/plAGModifier.h"
#include "plGImage/plDynamicTextMap.h"
#include "plgDispatch.h"
#include "hsResMgr.h"
Expand Down
6 changes: 3 additions & 3 deletions Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIProgressCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pfMessage/pfGameGUIMsg.h"
#include "plMessage/plAnimCmdMsg.h"
#include "plMessage/plTimerCallbackMsg.h"
// #include "plAvatar/plAGModifier.h"
#include "plAvatar/plAGMasterMod.h"
#include "plAvatar/plAGAnimInstance.h"
// #include "plAnimation/plAGModifier.h"
#include "plAnimation/plAGMasterMod.h"
#include "plAnimation/plAGAnimInstance.h"
#include "plSurface/plLayerAnimation.h"

#include "pnSceneObject/plSceneObject.h"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plRefMsg.h"
#include "pfMessage/pfGameGUIMsg.h"
#include "plMessage/plAnimCmdMsg.h"
#include "plAvatar/plAGModifier.h"
#include "plAnimation/plAGModifier.h"
#include "plGImage/plDynamicTextMap.h"
#include "plgDispatch.h"
#include "hsResMgr.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plRefMsg.h"
#include "pfMessage/pfGameGUIMsg.h"
#include "plMessage/plAnimCmdMsg.h"
#include "plAvatar/plAGModifier.h"
#include "plAnimation/plAGModifier.h"
#include "plgDispatch.h"
#include "hsResMgr.h"

Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAvatar/plClothingLayout.h"
#include "plAvatar/plArmatureMod.h"
#include "plAvatar/plAvBrainHuman.h" // needed to call the emote
#include "plAvatar/plAGAnim.h" // to get the BodyUsage enum
#include "plAnimation/plAGAnim.h" // to get the BodyUsage enum
#include "plInputCore/plAvatarInputInterface.h"
#include "plMessage/plSimStateMsg.h"

Expand Down
1 change: 1 addition & 0 deletions Sources/Plasma/PubUtilLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ add_definitions(-D_LIB)

add_subdirectory(plAgeDescription)
add_subdirectory(plAgeLoader)
add_subdirectory(plAnimation)
add_subdirectory(plAudible)
add_subdirectory(plAudio)
add_subdirectory(plAudioCore)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/PubUtilLib/inc/plAllCreatables.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plParticleSystem/plParticleCreatable.h"
#include "plNetCommon/plNetCommonCreatable.h"
#include "plVault/plVaultCreatable.h"
#include "plAnimation/plAnimationCreatable.h"
#include "plAvatar/plAvatarCreatable.h"
#include "plIntersect/plIntersectCreatable.h"
#include "plNetMessage/plNetMessageCreatable.h"
Expand All @@ -72,4 +73,3 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAgeLoader/plAgeLoaderCreatable.h"

#endif // plAllCreatables_inc

43 changes: 43 additions & 0 deletions Sources/Plasma/PubUtilLib/plAnimation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
include_directories("../../CoreLib")
include_directories("../../FeatureLib")
include_directories("../../NucleusLib/inc")
include_directories("../../NucleusLib")
include_directories("../../PubUtilLib")

set(plAnimation_SOURCES
plAGAnim.cpp
plAGAnimInstance.cpp
plAGApplicator.cpp
plAGChannel.cpp
plAGMasterMod.cpp
plAGModifier.cpp
plMatrixChannel.cpp
plPointChannel.cpp
plQuatChannel.cpp
plScalarChannel.cpp
)

set(plAnimation_HEADERS
plAGAnim.h
plAGAnimInstance.h
plAGApplicator.h
plAGChannel.h
plAGDefs.h
plAGMasterMod.h
plAGModifier.h
plAnimationCreatable.h
plMatrixChannel.h
plPointChannel.h
plQuatChannel.h
plScalarChannel.h
)

add_library(plAnimation STATIC ${plAnimation_SOURCES} ${plAnimation_HEADERS})

target_link_libraries(plAnimation pnModifier)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these links are unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is sadly not the case on Linux with gcc & clang. Each library must link against its dependencies, and there can be no loops (which was part of the reason for splitting this out).

target_link_libraries(plAnimation plInterp)
target_link_libraries(plAnimation plSDL)
target_link_libraries(plAnimation plTransform)

source_group("Source Files" FILES ${plAnimation_SOURCES})
source_group("Header Files" FILES ${plAnimation_HEADERS})
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ plAGAnimInstance::plAGAnimInstance(plAGAnim * anim, plAGMasterMod * master,
if (atcAnim)
{
fTimeConvert = new plAnimTimeConvert();
fTimeConvert->Init(atcAnim, this, master);
IInitAnimTimeConvert(fTimeConvert, atcAnim, master);
//fTimeConvert->Init(atcAnim, this, master);
timeChan = new plATCChannel(fTimeConvert);
}
else
Expand Down Expand Up @@ -185,6 +186,73 @@ plAGAnimInstance::~plAGAnimInstance()
delete fTimeConvert;
}


void plAGAnimInstance::IInitAnimTimeConvert(plAnimTimeConvert* atc, plATCAnim* anim, plAGMasterMod* master)
{
// Set up our eval callbacks
plAGInstanceCallbackMsg* instMsg;

instMsg = new plAGInstanceCallbackMsg(master->GetKey(), kStart);
instMsg->fInstance = this;
atc->AddCallback(instMsg);
hsRefCnt_SafeUnRef(instMsg);

instMsg = new plAGInstanceCallbackMsg(master->GetKey(), kStop);
instMsg->fInstance = this;
atc->AddCallback(instMsg);
hsRefCnt_SafeUnRef(instMsg);

instMsg = new plAGInstanceCallbackMsg(master->GetKey(), kSingleFrameAdjust);
instMsg->fInstance = this;
atc->AddCallback(instMsg);
hsRefCnt_SafeUnRef(instMsg);

atc->SetOwner(master);
atc->ClearFlags();

for (size_t i = 0; i < anim->NumStopPoints(); i++)
{
atc->GetStopPoints().Append(anim->GetStopPoint(i));
}

atc->SetBegin(anim->GetStart());
atc->SetEnd(anim->GetEnd());
atc->SetInitialBegin(atc->GetBegin());
atc->SetInitialEnd(atc->GetEnd());

if (anim->GetInitial() != -1)
{
atc->SetCurrentAnimTime(anim->GetInitial());
}
else
{
atc->SetCurrentAnimTime(anim->GetStart());
}

atc->SetLoopPoints(anim->GetLoopStart(), anim->GetLoopEnd());
atc->Loop(anim->GetLoop());
atc->SetSpeed(1.f);

atc->SetEase(true, anim->GetEaseInType(), anim->GetEaseInMin(),
anim->GetEaseInMax(), anim->GetEaseInLength());

atc->SetEase(false, anim->GetEaseOutType(), anim->GetEaseOutMin(),
anim->GetEaseOutMax(), anim->GetEaseOutLength());


// set up our time converter based on the animation's specs...
// ... after we've set all of its other state values.
if (anim->GetAutoStart())
{
plSynchEnabler ps(true); // enable dirty tracking so that autostart will send out a state update
atc->Start();
}
else
{
atc->InitStop();
}
}

// SearchForGlobals ---------------------
// -----------------
void plAGAnimInstance::SearchForGlobals()
Expand Down Expand Up @@ -611,14 +679,3 @@ void UnRegisterAGAlloc(plAGChannel *object)
delete al;
}
}











Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ class plAGAnimInstance {

void IRegisterDetach(const plString &channelName, plAGChannel *channel);

void IInitAnimTimeConvert(plAnimTimeConvert* atc, plATCAnim* anim, plAGMasterMod* master);

const plAGAnim * fAnimation;
plAGMasterMod * fMaster;

Expand Down Expand Up @@ -270,24 +272,3 @@ void DumpAGAllocs();
#endif // TRACK_AG_ALLOCS

#endif // PLAGANIMINSTANCE_INC





















Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class plAGModifier;
//
/////////////////////////////////////////////////////////////////////////////////////////
#include "pnFactory/plCreatable.h"
#include "plAvDefs.h"
#include "plAGDefs.h"
#include "plString.h"

/////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Loading