From 4fc61a75db492dd0de94c160a9bcbc05cefa0188 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sun, 1 Jul 2012 03:45:38 +0200 Subject: [PATCH] CHANGED: #1471 CInterfaceAnim no longer depends on Ryzom game related code. --- .../src/interface_v3/action_handler_misc.cpp | 25 +++++++++++ .../src/interface_v3/interface_anim.cpp | 43 +++---------------- .../client/src/interface_v3/interface_anim.h | 1 - 3 files changed, 30 insertions(+), 39 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp index 273e05d36..aefc33d34 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp @@ -924,6 +924,31 @@ bool CStringPostProcessNPCRemoveTitle::cbIDStringReceived(ucstring &inOut) +// *************************************************************************** +class CAHAnimStart : public IActionHandler +{ +public: + virtual void execute (CCtrlBase * /* pCaller */, const std::string &Params) + { + CInterfaceManager *pIM = CInterfaceManager::getInstance(); + string sAnim = getParam(Params, "anim"); + pIM->startAnim(sAnim); + } +}; +REGISTER_ACTION_HANDLER (CAHAnimStart, "anim_start"); + +// *************************************************************************** +class CAHAnimStop : public IActionHandler +{ +public: + virtual void execute (CCtrlBase * /* pCaller */, const std::string &Params) + { + CInterfaceManager *pIM = CInterfaceManager::getInstance(); + string sAnim = getParam(Params, "anim"); + pIM->stopAnim(sAnim); + } +}; +REGISTER_ACTION_HANDLER (CAHAnimStop, "anim_stop"); diff --git a/code/ryzom/client/src/interface_v3/interface_anim.cpp b/code/ryzom/client/src/interface_v3/interface_anim.cpp index 6f3001dd9..4f9654b62 100644 --- a/code/ryzom/client/src/interface_v3/interface_anim.cpp +++ b/code/ryzom/client/src/interface_v3/interface_anim.cpp @@ -14,17 +14,11 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . - - -// ---------------------------------------------------------------------------- -#include "stdpch.h" - #include "interface_anim.h" -#include "interface_manager.h" +#include "nel/gui/widget_manager.h" #include "nel/gui/interface_expr.h" #include "nel/misc/xml_auto_ptr.h" #include "nel/gui/action_handler.h" -#include "../time_client.h" // ---------------------------------------------------------------------------- using namespace std; @@ -591,11 +585,13 @@ void CInterfaceAnim::update() if ((_Duration == 0) || (_Finished)) return; + const CWidgetManager::SInterfaceTimes × = CWidgetManager::getInstance()->getInterfaceTimes(); + // Delta time limiter - if (DT > 0.1) + if ( ( times.frameDiffMs / 1000.0f ) > 0.1) _CurrentTime += 0.1; else - _CurrentTime += DT; + _CurrentTime += ( times.frameDiffMs / 1000.0f ); // Stop the anim if we have to if (_AnimHasToBeStopped) @@ -640,37 +636,8 @@ void CInterfaceAnim::stop() { _Finished = true; - CInterfaceManager *pIM = CInterfaceManager::getInstance(); if (!_AHOnFinish.empty()) CAHManager::getInstance()->runActionHandler(_AHOnFinish, _Parent, _AHOnFinishParams); } -// ************************** -// Action handlers associated -// ************************** -// *************************************************************************** -class CAHAnimStart : public IActionHandler -{ -public: - virtual void execute (CCtrlBase * /* pCaller */, const std::string &Params) - { - CInterfaceManager *pIM = CInterfaceManager::getInstance(); - string sAnim = getParam(Params, "anim"); - pIM->startAnim(sAnim); - } -}; -REGISTER_ACTION_HANDLER (CAHAnimStart, "anim_start"); - -// *************************************************************************** -class CAHAnimStop : public IActionHandler -{ -public: - virtual void execute (CCtrlBase * /* pCaller */, const std::string &Params) - { - CInterfaceManager *pIM = CInterfaceManager::getInstance(); - string sAnim = getParam(Params, "anim"); - pIM->stopAnim(sAnim); - } -}; -REGISTER_ACTION_HANDLER (CAHAnimStop, "anim_stop"); diff --git a/code/ryzom/client/src/interface_v3/interface_anim.h b/code/ryzom/client/src/interface_v3/interface_anim.h index c8b06df5e..4154e790b 100644 --- a/code/ryzom/client/src/interface_v3/interface_anim.h +++ b/code/ryzom/client/src/interface_v3/interface_anim.h @@ -22,7 +22,6 @@ #include "nel/gui/interface_property.h" #include "nel/gui/interface_group.h" #include "nel/gui/interface_link.h" - #include "nel/3d/u_track.h" /**