mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 19:29:09 +00:00
Move AniGraph classes from plAvatar -> plAnimation.
This commit is contained in:
@ -27,5 +27,9 @@ set(plInterp_HEADERS
|
||||
|
||||
add_library(plInterp STATIC ${plInterp_SOURCES} ${plInterp_HEADERS})
|
||||
|
||||
target_link_libraries(plInterp pnFactory)
|
||||
target_link_libraries(plInterp pnNetCommon)
|
||||
target_link_libraries(plInterp plTransform)
|
||||
|
||||
source_group("Source Files" FILES ${plInterp_SOURCES})
|
||||
source_group("Header Files" FILES ${plInterp_HEADERS})
|
||||
|
@ -44,20 +44,18 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include "plAnimEaseTypes.h"
|
||||
#include "plAnimTimeConvert.h"
|
||||
#include "plAvatar/plAGAnim.h"
|
||||
|
||||
#include "hsTimer.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
#include "pnMessage/plEventCallbackMsg.h"
|
||||
#include "plMessage/plAnimCmdMsg.h"
|
||||
#include "plAvatar/plAGMasterSDLModifier.h"
|
||||
#include "plAvatar/plAGMasterMod.h"
|
||||
#include "plModifier/plLayerSDLModifier.h"
|
||||
#include "plSurface/plLayerAnimation.h"
|
||||
|
||||
#include "pnNetCommon/plSDLTypes.h"
|
||||
|
||||
#include "hsResMgr.h"
|
||||
#include "plgDispatch.h"
|
||||
#include "plCreatableIndex.h"
|
||||
|
||||
|
||||
plAnimTimeConvert::plAnimTimeConvert()
|
||||
@ -95,57 +93,6 @@ plAnimTimeConvert::~plAnimTimeConvert()
|
||||
IClearAllStates();
|
||||
}
|
||||
|
||||
void plAnimTimeConvert::Init(plATCAnim *anim, plAGAnimInstance *instance, plAGMasterMod *master)
|
||||
{
|
||||
// Set up our eval callbacks
|
||||
plAGInstanceCallbackMsg *instMsg;
|
||||
instMsg = new plAGInstanceCallbackMsg(master->GetKey(), kStart);
|
||||
instMsg->fInstance = instance;
|
||||
AddCallback(instMsg);
|
||||
hsRefCnt_SafeUnRef(instMsg);
|
||||
instMsg = new plAGInstanceCallbackMsg(master->GetKey(), kStop);
|
||||
instMsg->fInstance = instance;
|
||||
AddCallback(instMsg);
|
||||
hsRefCnt_SafeUnRef(instMsg);
|
||||
instMsg = new plAGInstanceCallbackMsg(master->GetKey(), kSingleFrameAdjust);
|
||||
instMsg->fInstance = instance;
|
||||
AddCallback(instMsg);
|
||||
hsRefCnt_SafeUnRef(instMsg);
|
||||
|
||||
SetOwner(master);
|
||||
ClearFlags();
|
||||
|
||||
for (int i = 0; i < anim->NumStopPoints(); i++)
|
||||
GetStopPoints().Append(anim->GetStopPoint(i));
|
||||
|
||||
SetBegin(anim->GetStart());
|
||||
SetEnd(anim->GetEnd());
|
||||
fInitialBegin = fBegin;
|
||||
fInitialEnd = fEnd;
|
||||
|
||||
if (anim->GetInitial() != -1)
|
||||
SetCurrentAnimTime(anim->GetInitial());
|
||||
else
|
||||
SetCurrentAnimTime(anim->GetStart());
|
||||
SetLoopPoints(anim->GetLoopStart(), anim->GetLoopEnd());
|
||||
Loop(anim->GetLoop());
|
||||
SetSpeed(1.f);
|
||||
SetEase(true, anim->GetEaseInType(), anim->GetEaseInMin(),
|
||||
anim->GetEaseInMax(), anim->GetEaseInLength());
|
||||
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
|
||||
Start();
|
||||
}
|
||||
else
|
||||
InitStop();
|
||||
}
|
||||
|
||||
//
|
||||
// 0=nil, 1=easeIn, 2=easeOut, 3=speed
|
||||
//
|
||||
@ -376,11 +323,13 @@ plAnimTimeConvert& plAnimTimeConvert::IProcessStateChange(double worldTime, floa
|
||||
fStates.push_front(state);
|
||||
IFlushOldStates();
|
||||
|
||||
const char* sdlName=nil;
|
||||
if (plLayerAnimation::ConvertNoRef(fOwner))
|
||||
const char* sdlName = nullptr;
|
||||
|
||||
// This is a huge hack, but avoids circular linking problems :(
|
||||
if (fOwner->GetInterface(CLASS_INDEX_SCOPED(plLayerAnimation)))
|
||||
sdlName=kSDLLayer;
|
||||
else
|
||||
if (plAGMasterMod::ConvertNoRef(fOwner))
|
||||
if (fOwner->GetInterface(CLASS_INDEX_SCOPED(plAGMasterMod)))
|
||||
sdlName=kSDLAGMaster;
|
||||
else
|
||||
{
|
||||
|
@ -119,8 +119,6 @@ public:
|
||||
plAnimTimeConvert();
|
||||
virtual ~plAnimTimeConvert();
|
||||
|
||||
void Init(plATCAnim *anim, plAGAnimInstance *instance, plAGMasterMod *master);
|
||||
|
||||
CLASSNAME_REGISTER( plAnimTimeConvert );
|
||||
GETINTERFACE_ANY( plAnimTimeConvert, plCreatable );
|
||||
|
||||
@ -143,6 +141,8 @@ public:
|
||||
void SetLoopPoints(float begin, float end) { SetLoopBegin(begin); SetLoopEnd(end); }
|
||||
void SetLoopBegin(float s) { fLoopBegin = s; }
|
||||
void SetLoopEnd(float s) { fLoopEnd = s; }
|
||||
void SetInitialBegin(float s) { fInitialBegin = s; }
|
||||
void SetInitialEnd(float s) { fInitialEnd = s; }
|
||||
void SetEase(bool easeIn, uint8_t inType, float minLength, float maxLength, float inLength);
|
||||
void SetCurrentEaseCurve(int x); // 0=nil, 1=easeIn, 2=easeOut, 3=speed
|
||||
|
||||
@ -150,6 +150,8 @@ public:
|
||||
float GetEnd() const { return fEnd; }
|
||||
float GetLoopBegin() const { return fLoopBegin; }
|
||||
float GetLoopEnd() const { return fLoopEnd; }
|
||||
float GetInitialBegin() const { return fInitialBegin; }
|
||||
float GetInitialEnd() const { return fInitialEnd; }
|
||||
float GetSpeed() const { return fSpeed; }
|
||||
hsTArray<float> &GetStopPoints() { return fStopPoints; }
|
||||
float GetBestStopDist(float min, float max, float norm, float time) const;
|
||||
|
Reference in New Issue
Block a user