Added: #1469 CCameraAnimationManager base singleton class for camera animation parsing and execution

--HG--
branch : gsoc2012-fabien
hg/feature/gsoc2012-fabien
Fabien_HENON 13 years ago
parent 1e92233953
commit 99b9ef33b8

@ -0,0 +1,48 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// 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 <http://www.gnu.org/licenses/>.
//
#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()
{
}

@ -0,0 +1,50 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// 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 <http://www.gnu.org/licenses/>.
#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 */

@ -21,6 +21,10 @@
///////////// /////////////
// INCLUDE // // INCLUDE //
///////////// /////////////
/////////////
#include "camera_animation_manager/camera_animation_manager.h"
// misc // misc
#include "nel/misc/bit_mem_stream.h" #include "nel/misc/bit_mem_stream.h"
#include "nel/misc/path.h" #include "nel/misc/path.h"
@ -1519,6 +1523,8 @@ nlassert(nodeLeaf->getType() == ICDBStructNode::TEXT);
if (!packingSheets) CNamedItems::getInstance(); if (!packingSheets) CNamedItems::getInstance();
if (!packingSheets) CBuildingManager::init(); if (!packingSheets) CBuildingManager::init();
// Init camera animations
if (!packingSheets) CCameraAnimationManager::init();
if (!packingSheets) CMissionManager::init(); if (!packingSheets) CMissionManager::init();
if (!packingSheets) CMissionQueueManager::getInstance()->init(); if (!packingSheets) CMissionQueueManager::getInstance()->init();

Loading…
Cancel
Save