|
|
@ -21,6 +21,7 @@
|
|
|
|
#include <string>
|
|
|
|
#include <string>
|
|
|
|
#include "camera_animation_manager/camera_animation_step_factory.h"
|
|
|
|
#include "camera_animation_manager/camera_animation_step_factory.h"
|
|
|
|
#include "nel/misc/entity_id.h"
|
|
|
|
#include "nel/misc/entity_id.h"
|
|
|
|
|
|
|
|
#include "game_share/timer.h"
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
/************************************************************************/
|
|
|
|
/* Class that manages the camera animations. (singleton).
|
|
|
|
/* Class that manages the camera animations. (singleton).
|
|
|
@ -60,10 +61,14 @@ private:
|
|
|
|
/// Class that contains information about an animation
|
|
|
|
/// Class that contains information about an animation
|
|
|
|
class TCameraAnimInfo
|
|
|
|
class TCameraAnimInfo
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
class TCameraAnimTimerEvent;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
TCameraAnimInfo()
|
|
|
|
TCameraAnimInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Name = "";
|
|
|
|
Name = "";
|
|
|
|
|
|
|
|
_Timer = new CTimer();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/// Function called to release the animations
|
|
|
|
/// Function called to release the animations
|
|
|
|
void release()
|
|
|
|
void release()
|
|
|
@ -77,16 +82,25 @@ private:
|
|
|
|
Steps.clear();
|
|
|
|
Steps.clear();
|
|
|
|
|
|
|
|
|
|
|
|
Name = "";
|
|
|
|
Name = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
delete _Timer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Function called to send the camera animation instruction specified by the current step to the client
|
|
|
|
/// Function called to send the camera animation instruction specified by the current step to the client
|
|
|
|
void sendAnimationStep(const NLMISC::CEntityId& eid, int currentStep);
|
|
|
|
/// The function returns false if the animation step does not exist
|
|
|
|
|
|
|
|
bool sendAnimationStep(const NLMISC::CEntityId& eid, int currentStep);
|
|
|
|
/// Function called to send all the camera animation instructions to the client
|
|
|
|
/// Function called to send all the camera animation instructions to the client
|
|
|
|
void sendAnimationSteps(const NLMISC::CEntityId& eid);
|
|
|
|
void sendAnimationSteps(const NLMISC::CEntityId& eid);
|
|
|
|
|
|
|
|
/// Function that sends the animation steps from the specified one to the last one
|
|
|
|
|
|
|
|
void sendAnimationStepsFrom(const NLMISC::CEntityId& eid, int firstStep, TCameraAnimTimerEvent* event = 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string Name;
|
|
|
|
std::string Name;
|
|
|
|
std::vector<ICameraAnimationStep*> Steps;
|
|
|
|
std::vector<ICameraAnimationStep*> Steps;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
|
|
|
|
CTimer* _Timer;
|
|
|
|
|
|
|
|
|
|
|
|
class TCameraAnimTimerEvent: public CTimerEvent
|
|
|
|
class TCameraAnimTimerEvent: public CTimerEvent
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
@ -98,8 +112,13 @@ private:
|
|
|
|
// Callback called when the timer finished
|
|
|
|
// Callback called when the timer finished
|
|
|
|
void timerCallback(CTimer* owner)
|
|
|
|
void timerCallback(CTimer* owner)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// We tell the camera anim info to send the current step
|
|
|
|
// We tell the camera anim info to send the current step and the next ones
|
|
|
|
_Infos->sendAnimationStep(_Eid, _Next);
|
|
|
|
_Infos->sendAnimationStepsFrom(_Eid, _Next, this);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void nextStep()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_Next++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|