PATCH: Add/Remove plSceneObject from plSceneNode

Announcements and discussion regarding any projects related to Cyan Worlds' Plasma Engine including (but not limited to) CyanWorlds.com Engine, Drizzle, OfflineKI, PyPRP, and libHSPlasma.

PATCH: Add/Remove plSceneObject from plSceneNode

Postby Branan » Sun Feb 21, 2010 7:21 pm

Code: Select all
Index: core/PRP/plSceneNode.cpp
===================================================================
--- core/PRP/plSceneNode.cpp    (revision 368)
+++ core/PRP/plSceneNode.cpp    (working copy)
@@ -66,3 +66,16 @@
 plKey plSceneNode::getPoolObject(size_t idx) const { return fOtherObjects[idx]; }
 hsTArray<plKey>& plSceneNode::getSceneObjects() { return fSceneObjects; }
 hsTArray<plKey>& plSceneNode::getPoolObjects() { return fOtherObjects; }
+
+void plSceneNode::addSceneObject(plKey key)
+{
+    fSceneObjects.append(key);
+}
+
+void plSceneNode::removeSceneObject(plKey key)
+{
+    size_t i = fSceneObjects.find(key);
+    if(i == -1)
+        return;
+    fSceneObjects.remove(i);
+}
Index: core/PRP/plSceneNode.h
===================================================================
--- core/PRP/plSceneNode.h      (revision 368)
+++ core/PRP/plSceneNode.h      (working copy)
@@ -30,6 +30,8 @@
     plKey getPoolObject(size_t idx) const;
     hsTArray<plKey>& getSceneObjects();
     hsTArray<plKey>& getPoolObjects();
+    void addSceneObject(plKey key);
+    void removeSceneObject(plKey key);
 };

 #endif


EDIT: It helps to actually test changes before making a patch. This one compiles now
Image
Your friendly neighborhood shard admin
User avatar
Branan
Gehn Shard Admin
 
Posts: 694
Joined: Fri Nov 16, 2007 9:45 pm
Location: Portland, OR

Re: PATCH: Add/Remove plSceneObject from plSceneNode

Postby Zrax » Sun Feb 21, 2010 8:38 pm

Okay, but I've implemented it in a style more consistent with the rest of libPlasma...
User avatar
Zrax
 
Posts: 206
Joined: Fri Sep 28, 2007 5:19 pm
Location: Waist-deep in a conecano

Re: PATCH: Add/Remove plSceneObject from plSceneNode

Postby Branan » Sun Feb 21, 2010 8:47 pm

thanks :) I'm still trying to get a handle on the libPlasma style. Hopefully my next patch will be cleaner :/
Image
Your friendly neighborhood shard admin
User avatar
Branan
Gehn Shard Admin
 
Posts: 694
Joined: Fri Nov 16, 2007 9:45 pm
Location: Portland, OR


Return to Plasma Development

Who is online

Users browsing this forum: No registered users and 0 guests