diff --git a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.cpp b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.cpp new file mode 100644 index 000000000..901ef5ded --- /dev/null +++ b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.cpp @@ -0,0 +1,48 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// + +#include "stdpch.h" + +#include "camera_animation_manager/camera_animation_manager.h" + +using namespace std; + +CCameraAnimationManager* CCameraAnimationManager::_Instance = NULL; + +void CCameraAnimationManager::init() +{ + // Just asserts the instance is not already created and we create the manager that will load the camera animations + nlassert(_Instance == NULL); + _Instance = new CCameraAnimationManager(); +} + +void CCameraAnimationManager::release() +{ + // We delete the instance of the manager which will delete the allocated resources + delete _Instance; + _Instance = NULL; +} + +CCameraAnimationManager::CCameraAnimationManager() +{ + +} + +CCameraAnimationManager::~CCameraAnimationManager() +{ + +} diff --git a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.h b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.h new file mode 100644 index 000000000..73c9de92f --- /dev/null +++ b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.h @@ -0,0 +1,50 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef RY_CAMERAANIMATIONMANAGER_H +#define RY_CAMERAANIMATIONMANAGER_H + +/************************************************************************/ +/* Class that manages the camera animations. (singleton). + * It's responsible of : + * - Parsing camera animations in primitives + * - Sending a specified animation to the client + * + * \author Fabien Henon + * \date 2012 + */ +/************************************************************************/ +class CCameraAnimationManager +{ +public: + /// Gets the current instance of the manager + static CCameraAnimationManager* getInstance() { return _Instance; } + /// Creates the instance of the manager and parse the animations + static void init(); + /// Releases the animations + static void release(); + +private: + // Constructor + CCameraAnimationManager(); + // Destructor + ~CCameraAnimationManager(); + // Instance of the manager + static CCameraAnimationManager* _Instance; +}; + + +#endif /* RY_CAMERAANIMATIONMANAGER_H */ diff --git a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp index f431372cd..632287ec6 100644 --- a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp +++ b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp @@ -21,6 +21,10 @@ ///////////// // INCLUDE // ///////////// +///////////// + +#include "camera_animation_manager/camera_animation_manager.h" + // misc #include "nel/misc/bit_mem_stream.h" #include "nel/misc/path.h" @@ -1519,6 +1523,8 @@ nlassert(nodeLeaf->getType() == ICDBStructNode::TEXT); if (!packingSheets) CNamedItems::getInstance(); if (!packingSheets) CBuildingManager::init(); + // Init camera animations + if (!packingSheets) CCameraAnimationManager::init(); if (!packingSheets) CMissionManager::init(); if (!packingSheets) CMissionQueueManager::getInstance()->init();