From eb5769e0ef5dec6000a01a0fc3af74defe70a43c Mon Sep 17 00:00:00 2001 From: Fabien_HENON Date: Thu, 5 Jul 2012 21:53:37 +0200 Subject: [PATCH] Added: #1469 Implementation of the sendCameraStep function for the basic animation + changing variables that express either a position or an entity from string to a type (to change it easily if needed) --HG-- branch : gsoc2012-fabien --- .../camera_animation_steps.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_steps.cpp b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_steps.cpp index 5317a91d4..e041f3b83 100644 --- a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_steps.cpp +++ b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_steps.cpp @@ -17,6 +17,8 @@ #include "camera_animation_manager/camera_animation_step_factory.h" +typedef std::string TPositionOrEntity; + /// Basic camera animation step that has generic values /// - look_at_position /// - text @@ -24,7 +26,7 @@ class CCameraAnimationStepBasic : public ICameraAnimationStep { protected: - std::string LookAtPos; + TPositionOrEntity LookAtPos; std::string Text; float Duration; @@ -73,7 +75,9 @@ public: virtual void sendAnimationStep(NLMISC::CBitMemStream& bms) { - + bms.serial(const_cast(LookAtPos)); + bms.serial(const_cast(Text)); + bms.serial(const_cast(Duration)); } virtual float getDuration() const @@ -110,7 +114,7 @@ CAMERA_ANIMATION_REGISTR_STEP(CCameraAnimationStepStatic, "camera_animation_stat class CCameraAnimationStepGoTo: public CCameraAnimationStepBasic { protected: - std::string EndPos; + TPositionOrEntity EndPos; public: CCameraAnimationStepGoTo() @@ -153,7 +157,7 @@ CAMERA_ANIMATION_REGISTR_STEP(CCameraAnimationStepGoTo, "camera_animation_go_to" class CCameraAnimationStepFollowEntity: public CCameraAnimationStepBasic { protected: - std::string EntityToFollow; + TPositionOrEntity EntityToFollow; float DistanceToEntity; public: @@ -211,7 +215,7 @@ CAMERA_ANIMATION_REGISTR_STEP(CCameraAnimationStepFollowEntity, "camera_animatio class CCameraAnimationStepTurnAround: public CCameraAnimationStepBasic { protected: - std::string PointToTurnAround; + TPositionOrEntity PointToTurnAround; float DistanceToPoint; float Speed;