Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 167 vs 168 for /trunk/Source Code/Managers/CameraManager.cpp

Diff revisions: vs.
  @@ -1,7 +1,8 @@
1 1 #include "Headers/CameraManager.h"
2 2 #include "Rendering/Camera/Headers/FreeFlyCamera.h"
3 3
4 - CameraManager::CameraManager() : _camera(NULL) {
4 + CameraManager::CameraManager() : _camera(NULL)
5 + {
5 6 }
6 7
7 8 CameraManager::~CameraManager() {
  @@ -13,6 +14,13 @@
13 14 }
14 15 _cameraPool.clear();
15 16 }
17 +
18 + void CameraManager::tick(U32 elapsedTime){
19 + for_each(CameraPool::value_type& it, _cameraPool){
20 + it.second->tick(elapsedTime);
21 + }
22 + }
23 +
16 24 Camera* const CameraManager::getActiveCamera() {
17 25 if(!_camera && !_cameraPool.empty())
18 26 _camera = _cameraPool.begin()->second;
  @@ -20,15 +28,10 @@
20 28 }
21 29
22 30 void CameraManager::setActiveCamera(const std::string& name) {
23 - if(!_cameraPool.empty()){
24 - if(_cameraPool.find(name) != _cameraPool.end())
25 - _camera = _cameraPool[name];
26 - else _camera = _cameraPool.begin()->second;
27 - }else{
28 - _camera = New FreeFlyCamera();
29 - assert(_camera != NULL);
30 - addNewCamera(name, _camera);
31 - }
31 + assert(!_cameraPool.empty());
32 + if(_cameraPool.find(name) != _cameraPool.end()) _camera = _cameraPool[name];
33 + else _camera = _cameraPool.begin()->second;
34 +
32 35 for_each(boost::function0<void > listener, _listeners){
33 36 listener();
34 37 }
  @@ -39,5 +42,6 @@
39 42 ERROR_FN(Locale::get("ERROR_CAMERA_MANAGER_CREATION"),cameraName.c_str());
40 43 return;
41 44 }
45 + camera->setName(cameraName);
42 46 _cameraPool.insert(make_pair(cameraName,camera));
43 47 }