فهرست منبع

keep attrib and trans separate

David Rose 24 سال پیش
والد
کامیت
747f247745

+ 4 - 3
panda/src/pgui/pgEntry.cxx

@@ -132,8 +132,9 @@ make_copy() const {
 ////////////////////////////////////////////////////////////////////
 void PGEntry::
 draw_item(PGTop *top, GraphicsStateGuardian *gsg, 
-          const AllAttributesWrapper &attrib) {
-  PGItem::draw_item(top, gsg, attrib);
+          const AllAttributesWrapper &attrib,
+          const AllTransitionsWrapper &trans) {
+  PGItem::draw_item(top, gsg, attrib, trans);
   update_text();
   update_cursor();
 
@@ -143,7 +144,7 @@ draw_item(PGTop *top, GraphicsStateGuardian *gsg,
   // of the text.
   DirectRenderTraverser drt(gsg, RenderRelation::get_class_type());
   drt.set_view_frustum_cull(false);
-  drt.traverse(_text_render_root, attrib, AllTransitionsWrapper());
+  drt.traverse(_text_render_root, attrib, trans);
 }
 
 ////////////////////////////////////////////////////////////////////

+ 2 - 1
panda/src/pgui/pgEntry.h

@@ -46,7 +46,8 @@ public:
   virtual Node *make_copy() const;
 
   virtual void draw_item(PGTop *top, GraphicsStateGuardian *gsg, 
-                         const AllAttributesWrapper &attrib);
+                         const AllAttributesWrapper &attrib,
+                         const AllTransitionsWrapper &trans);
 
   virtual void press(const MouseWatcherParameter &param);
 

+ 4 - 3
panda/src/pgui/pgItem.cxx

@@ -200,7 +200,8 @@ activate_region(PGTop *, const LMatrix4f &transform, int sort) {
 ////////////////////////////////////////////////////////////////////
 void PGItem::
 draw_item(PGTop *top, GraphicsStateGuardian *gsg, 
-          const AllAttributesWrapper &attrib) {
+          const AllAttributesWrapper &attrib,
+          const AllTransitionsWrapper &trans) {
   if (has_state_def(get_state())) {
     // This item has a current state definition that we should use
     // to render the item.
@@ -211,11 +212,11 @@ draw_item(PGTop *top, GraphicsStateGuardian *gsg,
       // of the subgraph.
       DirectRenderTraverser drt(gsg, RenderRelation::get_class_type());
       drt.set_view_frustum_cull(false);
-      drt.traverse(def, attrib, AllTransitionsWrapper());
+      drt.traverse(def, attrib, trans);
 
     } else {
       QuickRenderTraverser qrt(gsg, RenderRelation::get_class_type());
-      qrt.traverse(def, attrib, AllTransitionsWrapper());
+      qrt.traverse(def, attrib, trans);
     }
   }
 }

+ 2 - 1
panda/src/pgui/pgItem.h

@@ -72,7 +72,8 @@ public:
   INLINE PGMouseWatcherRegion *get_region() const;
 
   virtual void draw_item(PGTop *top, GraphicsStateGuardian *gsg, 
-                         const AllAttributesWrapper &attrib);
+                         const AllAttributesWrapper &attrib,
+                         const AllTransitionsWrapper &trans);
 
   virtual void enter(const MouseWatcherParameter &param);
   virtual void exit(const MouseWatcherParameter &param);

+ 1 - 3
panda/src/pgui/pgTop.cxx

@@ -206,9 +206,7 @@ r_traverse(Node *node, const ArcChain &chain) {
     AllTransitionsWrapper complete_trans;
     wrt(pgi, chain.begin(), chain.end(), this,
         complete_trans, RenderRelation::get_class_type());
-    AllAttributesWrapper render_state;
-    render_state.apply_from(_attrib, complete_trans);
-    pgi->draw_item(this, _gsg, render_state);
+    pgi->draw_item(this, _gsg, _attrib, complete_trans);
 
   } else if (node->is_of_type(GeomNode::get_class_type())) {
     _gsg->_geom_nodes_pcollector.add_level(1);

+ 3 - 2
panda/src/pgui/pgWaitBar.cxx

@@ -96,9 +96,10 @@ make_copy() const {
 ////////////////////////////////////////////////////////////////////
 void PGWaitBar::
 draw_item(PGTop *top, GraphicsStateGuardian *gsg, 
-          const AllAttributesWrapper &attrib) {
+          const AllAttributesWrapper &attrib,
+          const AllTransitionsWrapper &trans) {
   update();
-  PGItem::draw_item(top, gsg, attrib);
+  PGItem::draw_item(top, gsg, attrib, trans);
 }
 
 ////////////////////////////////////////////////////////////////////

+ 2 - 1
panda/src/pgui/pgWaitBar.h

@@ -42,7 +42,8 @@ public:
   virtual Node *make_copy() const;
 
   virtual void draw_item(PGTop *top, GraphicsStateGuardian *gsg, 
-                         const AllAttributesWrapper &attrib);
+                         const AllAttributesWrapper &attrib,
+                         const AllTransitionsWrapper &trans);
 
 PUBLISHED:
   void setup(float width, float height, float range);