Update of /cvsroot/simspark/simspark/spark/oxygen/sceneserver
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25267/sceneserver
Modified Files:
Tag: WIN32
sceneserver.cpp sceneserver.h
Log Message:
- cleanup
- use CachedPath objects to cache references
Index: sceneserver.h
===================================================================
RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/sceneserver.h,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -d -r1.1 -r1.1.2.1
*** sceneserver.h 5 Dec 2005 21:21:17 -0000 1.1
--- sceneserver.h 16 Feb 2007 15:42:53 -0000 1.1.2.1
***************
*** 37,40 ****
--- 37,41 ----
#include <zeitgeist/class.h>
#include <zeitgeist/node.h>
+ #include "scene.h"
namespace oxygen
***************
*** 66,70 ****
/** creates a new scene hierarchy at a specific location, new
hierarchy is also made current */
! boost::shared_ptr<Scene> CreateScene(const std::string &location);
/** sets the active scene */
--- 67,71 ----
/** creates a new scene hierarchy at a specific location, new
hierarchy is also made current */
! bool CreateScene(const std::string &location);
/** sets the active scene */
***************
*** 72,76 ****
/** returns a reference to the current active scene */
! boost::shared_ptr<Scene> GetActiveScene() { return mActiveScene; }
/** updates the state of the current active scene (deltaTime is in
--- 73,77 ----
/** returns a reference to the current active scene */
! boost::shared_ptr<Scene> GetActiveScene() { return mActiveScene.get(); }
/** updates the state of the current active scene (deltaTime is in
***************
*** 118,122 ****
private:
/** the current active scene */
! boost::shared_ptr<Scene> mActiveScene;
/** cached reference to the Space node below the active scene */
--- 119,123 ----
private:
/** the current active scene */
! CachedPath<Scene> mActiveScene;
/** cached reference to the Space node below the active scene */
Index: sceneserver.cpp
===================================================================
RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/sceneserver.cpp,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** sceneserver.cpp 18 Feb 2006 19:46:54 -0000 1.2
--- sceneserver.cpp 16 Feb 2007 15:42:53 -0000 1.2.2.1
***************
*** 49,53 ****
}
! boost::shared_ptr<Scene> SceneServer::CreateScene(const std::string &location)
{
shared_ptr<CoreContext> context = GetCore()->CreateContext();
--- 49,53 ----
}
! bool SceneServer::CreateScene(const std::string &location)
{
shared_ptr<CoreContext> context = GetCore()->CreateContext();
***************
*** 56,86 ****
(context->New("oxygen/Scene", location));
! if (scene.get() != 0)
! {
! ResetCache();
! mActiveScene = scene;
! }
!
! return scene;
}
bool SceneServer::SetActiveScene(const std::string &location)
{
! shared_ptr<Scene> scene =
! shared_dynamic_cast<Scene>(GetCore()->Get(location));
!
! if (scene.get() != 0)
! {
! ResetCache();
! mActiveScene = scene;
! return true;
! }
!
! return false;
}
void SceneServer::ResetCache()
{
- mActiveScene.reset();
mActiveSpace.reset();
mActiveWorld.reset();
--- 56,73 ----
(context->New("oxygen/Scene", location));
! ResetCache();
! RegisterCachedPath(mActiveScene, location);
! return (scene.get() != 0);
}
bool SceneServer::SetActiveScene(const std::string &location)
{
! ResetCache();
! RegisterCachedPath(mActiveScene, location);
! return (mActiveScene.get() != 0);
}
void SceneServer::ResetCache()
{
mActiveSpace.reset();
mActiveWorld.reset();
|