]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
changed doom3 entity-create to add model key for brush-entities
authorspog <spog@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Sat, 3 Jun 2006 12:41:12 +0000 (12:41 +0000)
committerspog <spog@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Sat, 3 Jun 2006 12:41:12 +0000 (12:41 +0000)
git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk@75 8a3a26a2-13c4-0310-b231-cf6edde360e5

TODO
libs/traverselib.h
radiant/entity.cpp

diff --git a/TODO b/TODO
index 48f39efadf3f98569035d8bf5115ef52b85e0eae..43a22d7e2a362f798b58e9ad79355a3c6ee908da 100644 (file)
--- a/TODO
+++ b/TODO
@@ -12,12 +12,7 @@ Entity: creating a new entity with all the brushes of another entity selected re
 SConscript: build fails if SETUP=1
 GUI: can't use arrow keys to navigate in camera view when capslock is enabled
 GUI: screensaver causes: gdkgc-win32.c: line 905 (gdk_win32_hdc_get): assertion failed: (win32_gc->hdc == NULL)
-GUI: error! In camera window:
-  - press and release RightMouse
-  - press and hold LeftMouse
-  - press and release RightMouse
-  - press and release RightMouse
-  - release LeftMouse
+
 
 FEATURES
 
index 0f513a0c22702448370359bb53669052082345eb..99d5c33d0bb5c9ac8e27845006eea824f66e0805 100644 (file)
@@ -355,5 +355,42 @@ public:
   }
 };
 
+template<typename Type>
+class ReferenceSet
+{
+  typedef UniqueSet<Type*> Values;
+  Values m_values;
+public:
+  void attach(Type& t)
+  {
+    m_values.insert(&t);
+  }
+  void detach(Type& t)
+  {
+    m_values.erase(&t);
+  }
+  template<typename Functor>
+  void forEach(const Functor& functor)
+  {
+    for(Values::iterator i = m_values.begin(); i != m_values.end(); ++i)
+    {
+      functor(*(*i));
+    }
+  }
+};
+
+class TraversableObserverRelay : public ReferenceSet<scene::Traversable::Observer>, public scene::Traversable::Observer
+{
+public:
+  void insert(scene::Node& node)
+  {
+    forEach(TraversableObserverInsert(node));
+  }
+  void erase(scene::Node& node)
+  {
+    forEach(TraversableObserverErase(node));
+  }
+};
+
 
 #endif
index a68827e6bd4603462b7ae0ffd0808f4f508abf10..eb4dea509a246154f6de545a8025a7fe759e152a 100644 (file)
@@ -266,6 +266,11 @@ void Entity_createFromSelection(const char* name, const Vector3& origin)
   {
     Scene_parentSelectedBrushesToEntity(GlobalSceneGraph(), node);
     Scene_forEachChildSelectable(SelectableSetSelected(true), instance.path());
+
+    if (g_pGameDescription->mGameType == "doom3")
+    {
+      Node_getEntity(node)->setKeyValue("model", Node_getEntity(node)->getKeyValue("name"));
+    }
   }
 
   // tweaking: when right clic dropping a light entity, ask for light value in a custom dialog box