[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Usata-commits] Changes to usata2/src/scene-manager.cpp
From: |
David Lau |
Subject: |
[Usata-commits] Changes to usata2/src/scene-manager.cpp |
Date: |
Sun, 02 Jan 2005 01:13:11 -0500 |
Index: usata2/src/scene-manager.cpp
diff -u usata2/src/scene-manager.cpp:1.4 usata2/src/scene-manager.cpp:1.5
--- usata2/src/scene-manager.cpp:1.4 Sun Jan 2 02:48:32 2005
+++ usata2/src/scene-manager.cpp Sun Jan 2 06:01:19 2005
@@ -10,12 +10,11 @@
// included in the software distribution, or visit
// http://www.fsf.org/licenses/gpl.html.
//
-// $Id: scene-manager.cpp,v 1.4 2005/01/02 02:48:32 skunix Exp $
+// $Id: scene-manager.cpp,v 1.5 2005/01/02 06:01:19 skunix Exp $
#include "scene-manager.hpp"
+#include <boost/bind.hpp>
#include <map>
-#include <boost/lambda/bind.hpp>
-#include <boost/lambda/lambda.hpp>
namespace
usata
{
@@ -24,14 +23,6 @@
namespace SM_internal
{
-template <typename P>
-struct FW : public std::unary_function<P,void>
-{
- void operator()(P t)
- {
- t.second->draw();
- }
-};
struct Impl
{
@@ -44,10 +35,25 @@
void draw()
{
- using namespace ::boost::lambda;
+ using boost::bind;
std::for_each(children.begin(), children.end(),
- FW<ChildrenMap::value_type>());
+ bind(&Object::draw,
bind(&Object_sp::get,
+
bind(&ChildrenMap::value_type::second, _1))));
}
+
+
+ void update()
+ {
+ using std::for_each;
+ using boost::bind;
+ for_each(children.begin(), children.end(),
+ bind(&Object::update,
+ bind(&Object_sp::get,
+
bind(&ChildrenMap::value_type::second,_1)
+ )
+ ));
+
+ }
AddStatus add(const Object_sp& obj)
{
@@ -133,7 +139,8 @@
return;
}
- return child_interface->add_child(pObj, cpy);
+ child_interface->add_child(pObj, cpy);
+ return;
}
Object_sp
SceneManager::get_child(const std::string& name)
@@ -145,7 +152,15 @@
void
SceneManager::draw()
{
+ impl->draw();
+ return;
+}
+void
+SceneManager::update()
+{
+ impl->update();
+ return;
}
- [Usata-commits] Changes to usata2/src/scene-manager.cpp, David Lau, 2005/01/01
- [Usata-commits] Changes to usata2/src/scene-manager.cpp, David Lau, 2005/01/01
- [Usata-commits] Changes to usata2/src/scene-manager.cpp,
David Lau <=
- [Usata-commits] Changes to usata2/src/scene-manager.cpp, David Lau, 2005/01/03
- [Usata-commits] Changes to usata2/src/scene-manager.cpp, David Lau, 2005/01/07
- [Usata-commits] Changes to usata2/src/scene-manager.cpp, David Lau, 2005/01/07
- [Usata-commits] Changes to usata2/src/scene-manager.cpp, David Lau, 2005/01/09
- [Usata-commits] Changes to usata2/src/scene-manager.cpp, David Lau, 2005/01/09
- [Usata-commits] Changes to usata2/src/scene-manager.cpp, David Lau, 2005/01/09
- [Usata-commits] Changes to usata2/src/scene-manager.cpp, David Lau, 2005/01/10